Ubuntu compile and install Nginx and add Substitutions4nginx module

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.