
1.安装ng需要的依赖a.安装gccyum install gcc-cb安装PCREyum install -y pcre pcre-develc.安装zlibyum install -y zlib zlib-develd.安装opensslyum install -y openssl openssl-devel./configure 没写什么,相当于都用默认的配置(比如日志路径等)2.上传ng安装包到 /usr/local目录下tar -zxvf nginx-1.8.0.tar.gzcd nginx-1.8.0./configuremakesudo make install./nginx访问 ip:80 访问成功 即安装ok了访问时访问 ip:80, 需关闭防火墙 用 telnet ip空格80 看端口通不通(前提是 80的jar需要先启动, 否则报错 refuesed),若不通,检查防火墙状态 闭防火墙有2种方式: 第一种: 临时关闭防火墙,重启后防火墙又开启 systemctl stop firewalld 第二种: 永久关闭防火墙(重启后才生效,以后都是关闭状态) systemctl disable firewalld 已经禁用了firewalld防火墙但不生效自己电脑仍连不上服务器。还需要禁用iptables防火墙 命令是 systemctl stop iptables systemctl disable iptables 开启防火墙 systemctl start firewalld systemctl enable firewalld 开放80 端口 firewall-cmd --permanent --add-port80/tcp firewall-cmd --reload 验证 firewall-cmd --list-portscd /usr/local/nginx/sbin/./nginx -s reload 重新加载配置(不停止服务)./nginx -s quit 停止 Nginx./nginx 就是启动ngng占用3个进程pid