wget -c http://nginx.org/download/nginx-1.9.9.tar.gz &
tar zxvf nginx-1.9.9.tar.gz
make && make install
###添加端口监听
vi + /etc/sysconfig/iptables-config
内容添加两行
########nginx
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
重启 iptables
service iptables restart
完成安装. 配置nginx.conf看文件
操作
启动
/Java/nginx/sbin/nginx
重启
/Java/nginx/sbin/nginx -s reload
关闭
/Java/nginx/sbin/nginx -s stop
tar zxvf nginx-1.9.9.tar.gz
cd nginx-1.9.9
yum install gcc-c++
yum -y install zlib zlib-devel openssl openssl-devel pcre pcre-devel
make && make install
###添加端口监听
vi + /etc/sysconfig/iptables-config
内容添加两行
########nginx
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
重启 iptables
service iptables restart
完成安装. 配置nginx.conf看文件
操作
启动
/Java/nginx/sbin/nginx
重启
/Java/nginx/sbin/nginx -s reload
关闭
/Java/nginx/sbin/nginx -s stop
添加service nginx指令
# cp /Java/nginx/sbin/nginx /etc/init.d/nginx
# chmod 755 /etc/init.d/nginx
启动
service nginx
重启
service nginx -s reload
关闭
service nginx -s stop