1. Install nginx
1. Download a package on the official nginx website, is: http://nginx.org/en/download.html
2、winscp(ftpupload tool: cmd.exe FTP upload tool uploaded to centos
3. I first created a directory and put the installation package to be used together.
# Mkdir/home/
# Tar zxf nginx-1.4.1.tar.gz
# Cd nginx-1.4.1
4. Install the PCRE Development Kit
# Yum install-y PCRE-devel
5. If the following error occurs during installation, the compilation environment is missing. Install the tools and libraries required for compiling 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 the http://www.cmake.org and compile and install
# Yum-y install make GCC gcc-C ++ ncurses-devel
# Yum-y install zlib-devel
7. OpenSSL library is required for SSL Functions
# Yum-y install OpenSSL -- devel
8. Install 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. view port usage
# Netstat-tunlp
12. If other machines cannot be accessed, the solution is as follows:
#/Sbin/iptables-I input-P TCP -- dport 80-J accept
Then save:
#/Etc/rc. d/init. d/iptables save
Restart Firewall
#/Etc/init. d/iptables restart