Maison > Article > développement back-end > centos 7.0最小化安装nginx 源代码编译安装 过程都记录下来了 不能访问 这是什么原因?
新手 想直接wget 下载 源代码编辑
编译好了 后没有反应 怎么查看正常开启
查看进程显示三个
[root@localhost sbin]# ps -ef|grep nginxroot 13536 1 0 14:14 ? 00:00:00 nginx: master process ./nginxnobody 13537 13536 0 14:14 ? 00:00:00 nginx: worker processroot 13540 2281 0 14:16 pts/0 00:00:00 grep --color=auto nginx
[root@localhost sbin]# ip addr1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever2: enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 6c:62:6d:73:e6:4a brd ff:ff:ff:ff:ff:ff inet 192.168.1.103/24 brd 192.168.1.255 scope global enp2s0 valid_lft forever preferred_lft forever inet6 fe80::6e62:6dff:fe73:e64a/64 scope link valid_lft forever preferred_lft forever
这个看样子好像已经成功了啊。进程都有了。
你在服务器上wget一下本机IP,看看能不能获取到内容。
这个看样子好像已经成功了啊。进程都有了。
你在服务器上wget一下本机IP,看看能不能获取到内容。
[root@localhost sbin]# iptables -nL --line-numberChain INPUT (policy ACCEPT)num target prot opt source destination1 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 ctstate RELATED,ESTABLISHED2 ACCEPT all -- 0.0.0.0/0 0.0.0.0/03 INPUT_direct all -- 0.0.0.0/0 0.0.0.0/04 INPUT_ZONES_SOURCE all -- 0.0.0.0/0 0.0.0.0/05 INPUT_ZONES all -- 0.0.0.0/0 0.0.0.0/06 ACCEPT icmp -- 0.0.0.0/0 0.0.0.0/07 REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibitedChain FORWARD (policy ACCEPT)num target prot opt source destination1 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 ctstate RELATED,ESTABLISHED2 ACCEPT all -- 0.0.0.0/0 0.0.0.0/03 FORWARD_direct all -- 0.0.0.0/0 0.0.0.0/04 FORWARD_IN_ZONES_SOURCE all -- 0.0.0.0/0 0.0.0.0/05 FORWARD_IN_ZONES all -- 0.0.0.0/0 0.0.0.0/06 FORWARD_OUT_ZONES_SOURCE all -- 0.0.0.0/0 0.0.0.0/0 7 FORWARD_OUT_ZONES all -- 0.0.0.0/0 0.0.0.0/08 ACCEPT icmp -- 0.0.0.0/0 0.0.0.0/09 REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibitedChain OUTPUT (policy ACCEPT)num target prot opt source destination1 OUTPUT_direct all -- 0.0.0.0/0 0.0.0.0/0Chain FORWARD_IN_ZONES (1 references)num target prot opt source destination1 FWDI_public all -- 0.0.0.0/0 0.0.0.0/0 [goto]2 FWDI_public all -- 0.0.0.0/0 0.0.0.0/0 [goto]Chain FORWARD_IN_ZONES_SOURCE (1 references)num target prot opt source destinationChain FORWARD_OUT_ZONES (1 references)num target prot opt source destination1 FWDO_public all -- 0.0.0.0/0 0.0.0.0/0 [goto]2 FWDO_public all -- 0.0.0.0/0 0.0.0.0/0 [goto]Chain FORWARD_OUT_ZONES_SOURCE (1 references)num target prot opt source destinationChain FORWARD_direct (1 references)num target prot opt source destinationChain FWDI_public (2 references)num target prot opt source destination1 FWDI_public_log all -- 0.0.0.0/0 0.0.0.0/02 FWDI_public_deny all -- 0.0.0.0/0 0.0.0.0/03 FWDI_public_allow all -- 0.0.0.0/0 0.0.0.0/0Chain FWDI_public_allow (1 references)num target prot opt source destinationChain FWDI_public_deny (1 references)num target prot opt source destinationChain FWDI_public_log (1 references)num target prot opt source destinationChain FWDO_public (2 references)num target prot opt source destination1 FWDO_public_log all -- 0.0.0.0/0 0.0.0.0/02 FWDO_public_deny all -- 0.0.0.0/0 0.0.0.0/03 FWDO_public_allow all -- 0.0.0.0/0 0.0.0.0/0Chain FWDO_public_allow (1 references)num target prot opt source destinationChain FWDO_public_deny (1 references)num target prot opt source destinationChain FWDO_public_log (1 references)num target prot opt source destinationChain INPUT_ZONES (1 references)num target prot opt source destination1 IN_public all -- 0.0.0.0/0 0.0.0.0/0 [goto]2 IN_public all -- 0.0.0.0/0 0.0.0.0/0 [goto]Chain INPUT_ZONES_SOURCE (1 references)num target prot opt source destinationChain INPUT_direct (1 references)num target prot opt source destinationChain IN_public (2 references)num target prot opt source destination1 IN_public_log all -- 0.0.0.0/0 0.0.0.0/02 IN_public_deny all -- 0.0.0.0/0 0.0.0.0/03 IN_public_allow all -- 0.0.0.0/0 0.0.0.0/0Chain IN_public_allow (1 references)num target prot opt source destination1 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:22 ctstate NEWChain IN_public_deny (1 references)num target prot opt source destinationChain IN_public_log (1 references)num target prot opt source destinationChain OUTPUT_direct (1 references)num target prot opt source destination复制代码
[root@localhost /]# wget localhost--2015-01-24 17:04:52-- http://localhost/正在解析主机 localhost (localhost)... ::1, 127.0.0.1正在连接 localhost (localhost)|::1|:80... 失败:拒绝连接。正在连接 localhost (localhost)|127.0.0.1|:80... 已连接。已发出 HTTP 请求,正在等待回应... 200 OK长度:612 [text/html]正在保存至: “index.html”100%[======================================>] 612 --.-K/s 用时 0s2015-01-24 17:04:52 (91.0 MB/s) - 已保存 “index.html” [612/612])
[root@localhost sbin]# lsof -i:80COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAMEnginx 13536 root 6u IPv4 32434 0t0 TCP *:http (LISTEN)nginx 13548 nobody 6u IPv4 32434 0t0 TCP *:http (LISTEN)
如果直接 wget IP 地址 完全没有问题
[root@localhost /]# wget 192.168.1.103--2015-01-24 17:10:40-- http://192.168.1.103/正在连接 192.168.1.103:80... 已连接。已发出 HTTP 请求,正在等待回应... 200 OK长度:612 [text/html]正在保存至: “index.html.1”100%[======================================>] 612 --.-K/s 用时 0s2015-01-24 17:10:40 (84.4 MB/s) - 已保存 “index.html.1” [612/612])
总算解决了~