CentOS7.2 安裝 Nginx 1.9.9 教程
阿新 • • 發佈:2019-02-19
Linux系統:Centos 7.2 x64
Nginx版本:1.9.9
1、安裝prce(重定向支援)和openssl(https支援,如果不需要https可以不安裝。)
- yum -y install pcre*
- yum -y install openssl*
2、下載nginx 1.9.9
- wget http://nginx.org/download/nginx-1.9.9.tar.gz
- tar -zxvf nginx-1.9.9.tar.gz
- cd nginx-1.9.9
-
./congigure --prefix=/usr/local/nginx;
make && make install;
-
make
- make install
- /usr/local/nginx/sbin/nginx
-
/usr/local/nginx/sbin/nginx -s
reload
- /usr/local/nginx/sbin/nginx -s stop
- service iptables stop
- vi /etc/sysconfig/iptables
- -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
- service iptables restart