1. Official website
http://nginx.org/
2.nginx Installation
2.1cd/user/local/software directory (if not, create)
2.2 Upload Nginx Package and high-availability package to this directory
nginx-1.6.2. tar.gzkeepalived-1.2.18.tar.gz
2.3 Unzip to/usr/local
TAR-ZXF nginx-1.6.2.tar.gz/usr/local
2.4 Download the dependent library files required for the lock:
yum Install pcre yum install pcre-devel yum install zlib yum install zlib-devel
2.5 For Configure configuration:
CD nginx-1.6.2 &&/configure--prefix=/usr/local/nginx
Represents success
See if you have an error:
Error 1:ERROR:C compiler cc is not found
Solution:
Install gcc-c++-y install gcc-c++-y: All queries are selected Yes
2.6 Compiling the installation (CD to/usr/local/nginx-1.6.2 directory)
Make && make install
2.7 Start Nginx
cd/usr/local/Nginx Directory: see the following 4 directories .... conf configuration file ... HTML Web page file ... logs log file ... sbin primary binary program
Start command: (/usr/local/nginx/sbin/nginx-s start)
/usr/local/nginx/sbin/nginx
To see if it started successfully: (Netstat-ano | grep 80) or as follows:
Ps-ef|grep Nginx
Close command: (/usr/local/nginx/sbin/nginx-s stop)
/usr/local/nginx/sbin/nginx-s stop
Restart command: (/usr/local/nginx/sbin/nginx-s reload)
/usr/local/nginx/sbin/nginx-s Reload
Browser Access address: (see Welcome page)
Http://192.168.0.100:80
If it fails: it may be 80 ports occupied and so on.
LSOF-I:80 View the process PID and then kill-9 the PID
Nginx Installation and Basic configuration