1. Download the source package to Nginx website.
2. Install nginx Dependency Pack Run command: sudo apt-get install Libssl-dev
sudo apt-get install libpcre3 libpcre3-dev
3. Extract the downloaded Nginx source package. Check the compilation Environment command as follows: enter Nginx directory: #./configure--prefix=/usr/local/nginx
4. Compile and install, command as follows: make
Make Install
5. To the Nginx installation directory execution launch command:/usr/local/nginx/sbin/nginx Close command:/usr/local/sbin/nginx-s Stop (stop)
Reboot command:/usr/local/sbin/nginx-s reload (reboot) after startup http://localhost/see if the browser is successful. 6. Sometimes restart Nginx use./nginx-s Reload to re-read the configuration file, discover the report nginx: [ERROR] Open () "/usr/local/nginx/logs/nginx.pid" failed (2:no such file or directory) error, the logs file found that there is indeed no nginx.pid solution: root@alice-vostro-3800:/usr/local/nginx/ sbin#./nginx-c/usr/local/nginx/conf/nginx.conf uses nginx-c parameters to specify the location of the nginx.conf file, which solves the problem.
by Alice