IT Development/Doc: Difference between revisions
(add) |
(→Paths: +tools) |
||
Line 14: | Line 14: | ||
;/etc/nginx | ;/etc/nginx | ||
Nginx config path. Core vhosts are stored in /etc/nginx/sites-available. It is recommended not to touch these as they are in version control. Website vhosts can be configured with the tools detailed below. | Nginx config path. Core vhosts are stored in /etc/nginx/sites-available. It is recommended not to touch these as they are in version control (SCM: config/nginx). Website vhosts can be configured with the tools detailed below. | ||
;/var/www | ;/var/www | ||
Root path for websites etc. Each virtual host will be given a sub-directory (with the name of the domain, see below). | Root path for websites etc. Each virtual host will be given a sub-directory (with the name of the domain, see below). | ||
==Tools== | |||
Nginx/vhost management tools are stored on the SCM, using Mercurial, under config/Nginx-Config. | |||
;generate_vhost | |||
Used to set up new virtual host domains based on skeleton files. See below. | |||
;nginx_ensite/nginx_dissite | |||
Core tool for managing the master nginx configurations, should be rarely needed | |||
;htpasswd.py | |||
Used to generate htpasswd files for HTTP basic auth (when the normal htpasswd tool is unavailable). Again, rarely needed. | |||
==Nginx== | ==Nginx== |
Revision as of 16:44, 27 November 2012
IT Development |
Main page — Infrastructure — Documentation / Tools — Portfolio — Technology Committee — Project requests |
This page documents how to configure or otherwise manage the WMUK servers.
Overview
The servers run:
- PHP 5.x
- MySQL
- Nginx (web server)
Paths
- /etc/nginx
Nginx config path. Core vhosts are stored in /etc/nginx/sites-available. It is recommended not to touch these as they are in version control (SCM: config/nginx). Website vhosts can be configured with the tools detailed below.
- /var/www
Root path for websites etc. Each virtual host will be given a sub-directory (with the name of the domain, see below).
Tools
Nginx/vhost management tools are stored on the SCM, using Mercurial, under config/Nginx-Config.
- generate_vhost
Used to set up new virtual host domains based on skeleton files. See below.
- nginx_ensite/nginx_dissite
Core tool for managing the master nginx configurations, should be rarely needed
- htpasswd.py
Used to generate htpasswd files for HTTP basic auth (when the normal htpasswd tool is unavailable). Again, rarely needed.
Nginx
Very easy to configure using files, but an automated tool is also installed. Configuration guide for Nginx.
Using the generate_vhost tool
In a console run:
sudo generate_vhosts
It will ask you for the domain name you are hosting, and also to type in the public IP of the server (it will remind you). It will create a directory /var/www/<domain name> and copy a skeleton configuration into it. Then run:
sudo service nginx reload
This reloads the nginx config; if you see errors contact Tom.
Source code for the tool: Nginx-Config in the SCM
.htaccess??
.htaccess is a system of Apache web server most often used to do URL rewriting. Nginx does not support this method. If you have a .htaccess file then set up the vhost using the above tool then ping Tom who will convert the .htaccess to Nginx format.