System environment: CentOS-6.5
Software: nginx-1.6.2.tar.gz
Installation method: Source code compilation and installation
Installation location: /opt/program/nginx-1.6.2
Download address: http://nginx.org/en/download.html
Before installing nginx, you need to ensure that the system has g++, gcc, openssl-devel, pcre-devel and zlib-devel software. Install necessary software:
# yum install gcc-c++ # yum -y install zlib zlib-devel openssl openssl--devel pcre pcre-devel |
# find -name nginx . /nginx ./nginx/sbin/nginx ./nginx-1.2.6/objs/nginx |
Check the Nginx installed on the system:
Uninstall the original Nginx
# yum remove nginx |
Upload the installation package file to /opt/software and perform the following operations:
# cd /opt/program # mkdir nginx # tar -zxvf ../software/nginx -1.6.2.tar.gz # cd nginx-1.6.2 # ./configure --prefix=/opt/program/nginx Note: This is the installation directory for specifying nginx. Most users are accustomed to installing it in /usr Under /local/nginx # make using using using using use using ‐ through off under ‐ ‐ ‐ /iptables #Add configuration item | -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
#Method 1 | # /opt/program/nginx/sbin/nginx -c /opt/program/nginx/sbin/nginx/conf/nginx.conf
| ps -ef | grep nginx
|
#Test port | netstat –na|grep 80
1. Install directly through yum # yum list | grep nginx |
Reference URL:
http://www.cnblogs.com/zhoulf/archive/2013/02/09/2909653.html
The above introduces the installation of Nginx on CentOS6.5 system on Alibaba Cloud, including the relevant aspects. I hope it will be helpful to friends who are interested in PHP tutorials.