Editing Nginx/MediaWiki

From Bibliotheca Anonoma

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
{{Note|These Nginx configs are written without HTTPS for simplicity, but you should be [https://letsencrypt.org/getting-started/ using SSL certificates from LetsEncrypt.] They're free!}}
{{Note|These Nginx configs are written without HTTPS for simplicity, but you should be [https://letsencrypt.org/getting-started/ using SSL certificates from LetsEncrypt.] They're free!}}


The Web Server sends and receives data over the HTTP protocol. In the case of MediaWiki, the web server serves HTML pages to a user’s web browser. We’ve chosen Nginx instead of Apache for it’s greater effectiveness with serving and caching static HTML.
== PHP-FPM Nginx Config ==
 
== Installing Nginx ==
 
Follow one of these guides to install Nginx for your Linux Distribution.
 
* Debian 8: https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-debian-8
* Ubuntu 16.04 LTS: https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-16-04
* RHEL/CentOS 7: https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-centos-7
 
== HHVM ==
 
If you are using [[PHP/HHVM|HHVM]] as your PHP Engine, use these Nginx Configs.
 
== PHP-FPM ==
 
If you are using PHP-FPM as your PHP Engine, use these Nginx Configs.
 
=== PHP-FPM Nginx Config ===


To make it easy to switch all our present or future PHP apps between TCP ports and UNIX sockets, we use a specific `php-fpm.conf` file which can be called with {{ic|fastcgi_pass php-fpm;}}. Create this file:
To make it easy to switch all our present or future PHP apps between TCP ports and UNIX sockets, we use a specific `php-fpm.conf` file which can be called with {{ic|fastcgi_pass php-fpm;}}. Create this file:
Line 29: Line 11:
upstream php-fpm {
upstream php-fpm {
         #server 127.0.0.1:9000;
         #server 127.0.0.1:9000;
         server unix:/var/run/php7.0-fpm.sock; # use this if you have php7.0-fpm
         server unix:/var/run/php5-fpm.sock;
        #server unix:/var/run/php5-fpm.sock; # use this if you have php5-fpm
}
}
</nowiki>}}
</nowiki>}}


=== MediaWiki Nginx Config ===
== MediaWiki Nginx Config ==


This is the Nginx Config that we use when when setting up MediaWiki for the first time over conventional HTTP, with PHP-FPM:
This is the Nginx Config that we use when when setting up MediaWiki for the first time over conventional HTTP, with PHP-FPM:
Please note that all contributions to Bibliotheca Anonoma are considered to be released under the Creative Commons Attribution-ShareAlike (see Bibliotheca Anonoma:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!
Cancel Editing help (opens in new window)

Templates used on this page: