: This article describes how to install nginx in Linux. if you are interested in the PHP Tutorial, refer to it. Zookeeper
1. install nginx
1. download a package on the official nginx website, is: http://nginx.org/en/download.html
2. upload the file over ftp to the CentOS server
3. first create a directory and put together the installation packages to be used.
# Mkdir/data/kkweb
# 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-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-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 =/data/kkweb/nginx
# Make
# Make install
9. start the service
#/Data/kkweb/nginx/sbin/nginx
10. stop the service
#/Data/kkweb/nginx/sbin/nginx-s stop
11. view port usage
# Netstat-tunlp
12. if other machines cannot be accessed, the solution is as follows:
Check whether port 80 is enabled. If no
# Vi/etc/sysconfig/iptables
Added:-a input-m tcp-p tcp -- dport 80-j ACCEPT
Save: wq!
Restart firewall
# Service iptables start
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.
The above describes how to install nginx in Linux, including some content. if you are interested in the PHP Tutorial.