1. Install the Nginx on the CentOS system
in the CentOS6 version of the Epel source, the Nginx RPM package has been added, but the RPM package version is lower. If you need an updated version, you can use the official RPM package, or compile the installation using the source package.
You can also use some of the two development enhancements of the Nginx version, such as Taobao's Tengine and openresty are good choices.
1.1 Common compilation parameters
--prefix=path: Specifies the Nginx installation directory
--conf-path=path: Specify nginx.conf Profile Path
Users of the--user=name:nginx worker process
--with-pcre: Turn on support for pcre regular expressions
--with-http_ssl_module: Support for enabling SSL
--with-http_stub_status_module: Used to monitor the status of Nginx
--with-http-realip_module: Allows changing client IP addresses in client request headers
--with-file-aio: Enable file Aio
--add-module=path: Add third party external module
A complete compilation scenario is provided here:
--prefix=/usr/local/nginx \
--conf-path=/etc/nginx/nginx.conf \
--error-log-path=/var/log/nginx/ Error.log \
--http-log-path=/var/log/nginx/access.log \
--http-client-body-temp-path=/var/tmp/nginx/ client_body \
--http-proxy-temp-path=/var/tmp/nginx/proxy \
--http-fastcgi-temp-path=/var/tmp/nginx/ fastcgi \
--http-uwsgi-temp-path=/var/tmp/nginx/uwsgi \
--pid-path=/var/run/nginx.pid \
--lock-path=/ Var/lock/nginx \
--user=nginx \
--group=nginx \
--with-file-aio \
--with-http_ssl_module \
--with-http_realip_module \
--with-http_sub_module \
--with-http_gzip_static_module \--
With-http_stub_status_module \
--with-pcre
Startup and shutdown of 1.2 nginx
Start Nginx:
# nginx-c/etc/nginx/nginx.conf
Close Nginx
Reread configuration file
# nginx-s Reload
# pkill-hup Nginx
Reopen the log file
# nginx-s Reopen
# PKILL-USR1 Nginx
You can also download the/etc/init.d/nginx file in the Nginx RPM package and use it after modifying the path:
# service Nginx {start|stop|status|restart|reload|configtest|}
2. Install Nginx on a Windows system
first go to the official website to download nginx1.0.11 version of Windows, website download: http://nginx.org/download/nginx-1.0.11.zip
After downloading to the package, unzip the Nginx-nginx1.0.11.zip package to your favorite root directory and change the directory name to Nginx.
Then, do the following:
In this way, the Nginx service is started. Open Task Manager, view the Nginx.exe process, there are two processes will show, occupy system resources, that is quite small. Then open the browser, input HTTP://127.0.0.1/will be able to see the Nginx Welcome page, Very friendly
Nginx-s Stop// stops Nginx
nginx-s reload //Reload configuration file
Nginx-s quit //exit Nginx