1. Create a user group first
sudo groupadd www
2. Create a user
sudo useradd-g www www
3. Installing Nginx Dependency Packages
sudo apt-get install Libpcre3-dev zlibc zlib-bin Libssl-dev
4. Install make
sudo apt-get install make
5. Install git
sudo apt-get install git
6. Download Substitutions4nginx
git clone https://github.com/yaoweibin/ngx_http_substitutions_filter_module
7. Download Nginx Source Package
Wget-c http://www.nginx.org/download/nginx-1.0.8.tar.gz
8. Unzip
Tar zxvf nginx-1.0.8.tar.gz
(z use gzip to compress or unzip the archive; X to expand files from the archive; V to display the processed files in detail; F Specify an archive or device)
9. Compiling the installation
./configure--user=www--group=www--prefix=/usr/local/nginx--with-http_stub_status_module--with-http_ssl_module- -with-http_gzip_static_module--add-module=/home/zbs/ngx_http_substitutions_filter_module
sudo make
sudo make install
10. Start Nginx
/usr/local/nginx/sbin/nginx
Close command:/usr/local/nginx/sbin/nginx-s Stop (stop)
Restart command:/usr/local/nginx/sbin/nginx-s Reload (restart)
Startup error
1. Change permissions: sudo chmod a+rwx-r/usr/local/nginx/logs && sudo chmod a+rwx-r/usr/local/nginx
2. Proper operation: sudo chown www:www/usr/local/nginx/logs
11.nginx Dependency
Http://www.2cto.com/os/201203/125517.html
Ubuntu compile and install Nginx and add Substitutions4nginx module