源码中安装显示代码过多所以显示我操作的部分,IP用你们虚拟机的IP
1. [root@localhost nginx-1.6.3]# useradd www -s /sbin/nologin -M
[root@localhost nginx-1.6.3]# ./configure –user=www –group=www –with-http_ssl_module –with-http_stub_status_module –prefix=/application/nginx-1.6.3
[root@localhost nginx-1.6.3]# yum install openssl openssl-devel -y
[root@localhost nginx-1.6.3]# echo $?
0
出现0前面均正确[root@localhost nginx-1.6.3]# make install
看到80口处于监听(listen )状态
[root@localhost nginx-1.6.3]# netstat -lntup|grep 80
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 17331/nginx: master
[root@localhost nginx-1.6.3]# lsof -i :80
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
nginx 17331 root 6u IPv4 40493 0t0 TCP *:http (LISTEN)
nginx 17332 www 6u IPv4 40493 0t0 TCP *:http (LISTEN)- Centos7下防火墙关闭
[root@localhost nginx-1.6.3]# firewall-cmd –state
running
[root@localhost nginx-1.6.3]# systemctl stop firewalld.service
[root@localhost nginx-1.6.3]# firewall-cmd –state
not running [root@localhost nginx-1.6.3]# curl 10.10.10.2
看结果中有welcome nginx[root@localhost nginx-1.6.3]# wget http://10.10.10.2
–2018-08-01 01:15:36– http://10.10.10.2/
正在连接 192.168.9.128:80… 已连接。
已发出 HTTP 请求,正在等待回应… 200 OK
长度:612 [text/html]
正在保存至: “index.html.4”
结果中有200 OK
10. 打开浏览器输入http://10.10.10.2/
看结果中有welcome nginx 安装成功