#CentOS Install Nginx Server #
1, if not installed GCC development tools, please install first: Yum groupinstall-y "Development Tools"
2, download the new version of the nginx:http://nginx.org/en/download.html,
Download to Local: wget http://nginx.org/download/nginx-1.4.3.tar.gz
3, Extract source package: Tar zxvf nginx-1.4.3.tar.gz
4, into the extracted source folder: CD nginx-1.4.3
5. Configure Nginx:./configure
6, when the installation of error:./configure:error:the HTTP Rewrite module requires the PCRE library.
Input command: Yum install-y pcre-devel
7, when the installation of error:./configure:error:the HTTP gzip module requires the Zlib library.
Input command: Yum install-y zlib-devel
8, compile Nginx: input command: Make
9, installation nginx: Input command: Make install
10, start Nginx:
Since Nginx is installed by default on/usr/local/nginx, enter at startup:/usr/local/nginx/sbin/nginx
11, Stops Nginx:/usr/local/nginx/sbin/nginx-s stop
12. Heavy Duty Nginx:/usr/local/nginx/sbin/nginx-s Reload
A workaround that cannot be accessed via IP after #配置 Nginx #
The native or local area network cannot access the Nginx server via IP because of the CentOS firewall problem, which is handled as follows:
/sbin/iptables-i input-p tcp–dport 80-j ACCEPT
/etc/init.d/iptables Save
/etc/init.d/iptables restart