First, install Nginx
1, download a package on the official Nginx website, is: http://nginx.org/en/download.html
2. WinSCP (FTP Upload tool). exe FTP upload tool uploaded to CentOS
3, I was first to build a directory, the use of the installation package to put together.
#mkdir/home/
#tar ZXF nginx-1.4.1.tar.gz
#cd nginx-1.4.1
4. Install PCRE Development Kit
#yum install-y Pcre-devel
5. If the installation appears in the following error, the compilation environment is missing. Install the tools and libraries needed to compile the source code
./configure:error:c compiler cc is not found
#yum install gcc gcc-c++ ncurses-devel perl
6, install CMake, download the source code from http://www.cmake.org and compile the installation
#yum-y install make gcc gcc-c++ ncurses-devel
#yum-y install zlib zlib-devel
7. The OpenSSL library is required if SSL function is required
#yum-y Install OpenSSL openssl--devel
8. Installing Nginx
#cd nginx-1.4.1
#./configure--prefix=/opt/nginx
#make
#make Install
9. Start the service
#/opt/nginx/sbin/nginx-c/opt/nginx/conf/nginx.conf
10. Stop the Service
#/opt/nginx/sbin/nginx-s stop
11. Check Port occupancy
#netstat-TUNLP
12. If other machines are inaccessible, the workaround is as follows:
#/sbin/iptables-i input-p TCP--dport 80-j ACCEPT
Then Save:
#/etc/rc.d/init.d/iptables Save
Restarting the firewall
#/etc/init.d/iptables restart