VPS侦探论坛

 找回密码
 注册
查看: 5187|回复: 2

【已解决】虚拟机装好centos后直接装lnmp可以用,重启虚拟机就打不开网页了

[复制链接]
发表于 2015-2-13 03:45:16 | 显示全部楼层 |阅读模式

centos安装在虚拟机内,使用桥接网卡网络模式,宿主机可ssh到centos虚拟机上,代表宿主机和虚拟机是连通的。虚拟机刚装好系统就进去装Lnmp了,装好lnmp后是可以用的,虚拟机重启后就访问不到网页了。
centos 7 minimal不带iptables,所以排除了iptables阻挡80端口的可能性。
虚拟机重启几次,lnmp也restart几次,问题依旧。
真找不出问题在哪了。。。只好厚颜来请教军哥了。
以下都是ssh到虚拟机后执行的,ip确认是正确的
  1. [root@localhost ~]# ip a
  2. 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
  3.     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
  4.     inet 127.0.0.1/8 scope host lo
  5.        valid_lft forever preferred_lft forever
  6.     inet6 ::1/128 scope host
  7.        valid_lft forever preferred_lft forever
  8. 2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
  9.     link/ether 08:00:27:a0:31:5d brd ff:ff:ff:ff:ff:ff
  10.     inet 192.168.1.4/24 brd 192.168.1.255 scope global enp0s3
  11.        valid_lft forever preferred_lft forever
  12.     inet6 fe80::a00:27ff:fea0:315d/64 scope link
  13.        valid_lft forever preferred_lft forever

  14. [root@localhost ~]# /root/lnmp status
  15. =========================================================================
  16. Manager for LNMP V1.1  ,  Written by Licess
  17. =========================================================================
  18. LNMP is a tool to auto-compile & install Nginx+MySQL+PHP on Linux
  19. This script is a tool to Manage status of lnmp
  20. For more information please visit http://www.lnmp.org

  21. Usage: /root/lnmp {start|stop|reload|restart|kill|status}
  22. =========================================================================
  23. nginx (pid 2500 2499 2498) is running...
  24. php-fpm is runing!
  25. SUCCESS! MySQL running (2816)

  26. [root@localhost ~]# netstat -tanp
  27. Active Internet connections (servers and established)
  28. Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
  29. tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 2816/mysqld
  30. tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 2498/nginx: master
  31. tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1122/sshd
  32. tcp 0 0 192.168.1.4:22 192.168.1.3:53923 ESTABLISHED 2820/sshd: root@not
  33. tcp 0 0 192.168.1.4:22 192.168.1.3:53890 ESTABLISHED 2293/sshd: root@pts
  34. tcp6 0 0 :::22 :::* LISTEN 1122/sshd
复制代码

[ 本帖最后由 碌木 于 2015-2-13 03:53 编辑 ]
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2015-2-13 03:47:00 | 显示全部楼层


index.html
Index.php
aaa.txt
这三种文件都无法访问
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2015-2-13 03:54:41 | 显示全部楼层

原来是centos 7 用firewall 代替了 iptables,
firewall-cmd --zone=public --add-port=80/tcp --permanent
加上80端口就可以了
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-5-17 18:26 , Processed in 0.026182 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表