1. Installation Instructions
System Environment: CentOS-6.3
Software: nginx-1.9.0.tar.gz
Installation method: Source code compiled and installed
Installation Location:/usr/local/src/nginx_1.9.0
: http://nginx.org/en/download.html
2. Installation Prerequisites
Before installing Nginx, you need to ensure that the system has g++, GCC, Openssl-devel, Pcre-devel, and Zlib-devel software installed. Installation must be software:
The installation commands are as follows:
[Root@localhost/]# Yum Install gcc-c++
[root@localhost/]# yum-y install zlib zlib-devel OpenSSL openssl–devel pcre pcre-devel
Check the system installation Nginx:
[Root@localhost/]# find-name Nginx
./usr/local/src/nginx_1.9.0/sbin/nginx
To uninstall the original nginx:
[Root@localhost/]# Yum Remove Nginx
3. Installation
Upload the installation package file to/usr/local/src/to do the following:
[Root@localhost/]# CD/USR/LOCAL/SRC
[Root@localhost src]# TAR-ZXVF nginx-1.9.0.tar.gz
[Root@localhost src]# RM-RF nginx-1.2.6.tar.gz
[Root@localhost src]# cd/usr/local/src/nginx-1.9.0
[Root@localhost nginx_1.9.0]#./configure–prefix=/usr/local/nginx_1.9.0
[Root@localhost nginx_1.9.0]# make && make install
4. Configuration
Go to modify firewall configuration:
[Root@localhost nginx_1.9.0]# Vi/etc/sysconfig/iptables
To add a configuration entry:
-A input-m state–state new-m tcp-p tcp–dport 80-j ACCEPT
To restart the firewall:
[root@localhost nginx_1.9.0]# Service iptables restart
5. Start Nginx
[Root@localhost nginx_1.9.0]# Cd/usr/local/src/nginx_1.9.0/sbin
[Root@localhost sbin]#./nginx
6. The test is successful
Enter test address in browser: http://ip:80
Install Nginx under CentOS