VPS侦探论坛

 找回密码
 注册
查看: 6038|回复: 7

用的橙云主机,重启之后ping得通,但无法通过ip或者域名访问

[复制链接]
发表于 2013-5-23 09:28:39 | 显示全部楼层 |阅读模式

美橙的人说服务器内未安装 web服务 80端口未监听。

晕倒。重启之前访问得好好的啊,在其它vps上使用都没有这种问题。

停了iptables防火墙也不行。

请问军哥这种情况一般是什么原因?


  1. 操作系统:
  2.        

  3. CentOS 6.2 32位
复制代码


  1. [root@S058781 ~]# netstat
  2. Active Internet connections (w/o servers)
  3. Proto
  4. Recv-Q Send-Q Local Address               Foreign Address            
  5. Stat                                                                    
  6.           e
  7. tcp        0     52 210.209.68.211:ssh         
  8. 120.82.134.89:34739         ESTA                                       
  9.                                       BLISHED
  10. tcp        0      0
  11. 210.209.68.211:ssh          110.4.78.170:41845          ESTA            
  12.                                                                   
  13. BLISHED
  14. Active UNIX domain sockets (w/o servers)
  15. Proto RefCnt Flags       Type       State         I-Node Path
  16. unix  2      [ ]         DGRAM                    7043   @/org/kernel/udev/udevd
  17. unix  12     [ ]         DGRAM                    8563   /dev/log
  18. unix
  19.   2      [ ]         DGRAM                    8803   
  20. @/org/freedesktop/hal/u                                                
  21.                              dev_event
  22. unix  2      [ ]         DGRAM                    29256
  23. unix  2      [ ]         DGRAM                    29249
  24. unix  3      [ ]         STREAM     CONNECTED     29242
  25. unix  3      [ ]         STREAM     CONNECTED     29241
  26. unix  2      [ ]         DGRAM                    27417
  27. unix  2      [ ]         DGRAM                    15055
  28. unix  3      [ ]         STREAM     CONNECTED     13446
  29. unix  3      [ ]         STREAM     CONNECTED     13445
  30. unix  3      [ ]         STREAM     CONNECTED     13442
  31. unix  3      [ ]         STREAM     CONNECTED     13441
  32. unix  2      [ ]         DGRAM                    9774
  33. unix  2      [ ]         DGRAM                    9741
  34. unix  2      [ ]         DGRAM                    9641
  35. unix
  36.   3      [ ]         STREAM     CONNECTED     9638   
  37. /var/run/dbus/system_bu                                                
  38.                              s_socket
  39. unix  3      [ ]         STREAM     CONNECTED     9637
  40. unix  2      [ ]         DGRAM                    9584
  41. unix  3      [ ]         STREAM     CONNECTED     9574
  42. unix  3      [ ]         STREAM     CONNECTED     9573
  43. unix  3      [ ]         STREAM     CONNECTED     9570
  44. unix  3      [ ]         STREAM     CONNECTED     9569
  45. unix  3      [ ]         STREAM     CONNECTED     9566
  46. unix  3      [ ]         STREAM     CONNECTED     9565
  47. unix  3      [ ]         STREAM     CONNECTED     9562
  48. unix  3      [ ]         STREAM     CONNECTED     9561
  49. unix  3      [ ]         STREAM     CONNECTED     9558
  50. unix  3      [ ]         STREAM     CONNECTED     9557
  51. unix  3      [ ]         STREAM     CONNECTED     9554
  52. unix  3      [ ]         STREAM     CONNECTED     9553
  53. unix  3      [ ]         STREAM     CONNECTED     9550
  54. unix  3      [ ]         STREAM     CONNECTED     9549
  55. unix  3      [ ]         STREAM     CONNECTED     9546
  56. unix  3      [ ]         STREAM     CONNECTED     9545
  57. unix  3      [ ]         STREAM     CONNECTED     9542
  58. unix  3      [ ]         STREAM     CONNECTED     9541
  59. unix  3      [ ]         STREAM     CONNECTED     9538
  60. unix  3      [ ]         STREAM     CONNECTED     9537
  61. unix  3      [ ]         STREAM     CONNECTED     9534
  62. unix  3      [ ]         STREAM     CONNECTED     9533
  63. unix  3      [ ]         STREAM     CONNECTED     9530
  64. unix  3      [ ]         STREAM     CONNECTED     9529
  65. unix  3      [ ]         STREAM     CONNECTED     9526
  66. unix  3      [ ]         STREAM     CONNECTED     9525
  67. unix  3      [ ]         STREAM     CONNECTED     9522
  68. unix  3      [ ]         STREAM     CONNECTED     9521
  69. unix  3      [ ]         STREAM     CONNECTED     9518
  70. unix  3      [ ]         STREAM     CONNECTED     9517
  71. unix  3      [ ]         STREAM     CONNECTED     9514
  72. unix  3      [ ]         STREAM     CONNECTED     9513
  73. unix  3      [ ]         STREAM     CONNECTED     9510
  74. unix  3      [ ]         STREAM     CONNECTED     9509
  75. unix  3      [ ]         STREAM     CONNECTED     9506
  76. unix  3      [ ]         STREAM     CONNECTED     9505
  77. unix  3      [ ]         STREAM     CONNECTED     9502
  78. unix  3      [ ]         STREAM     CONNECTED     9501
  79. unix  3      [ ]         STREAM     CONNECTED     9498
  80. unix  3      [ ]         STREAM     CONNECTED     9497
  81. unix  3      [ ]         STREAM     CONNECTED     9494
  82. unix  3      [ ]         STREAM     CONNECTED     9493
  83. unix  3      [ ]         STREAM     CONNECTED     9491
  84. unix  3      [ ]         STREAM     CONNECTED     9490
  85. unix  3      [ ]         STREAM     CONNECTED     9487
  86. unix  3      [ ]         STREAM     CONNECTED     9486
  87. unix  3      [ ]         STREAM     CONNECTED     9482
  88. unix  3      [ ]         STREAM     CONNECTED     9481
  89. unix  2      [ ]         DGRAM                    9436
  90. unix  3      [ ]         STREAM     CONNECTED     9037   /var/run/acpid.socket
  91. unix  3      [ ]         STREAM     CONNECTED     9036
  92. unix
  93.   3      [ ]         STREAM     CONNECTED     9031   
  94. @/var/run/hald/dbus-JvR                                                
  95.                              iEWuVI3
  96. unix  3      [ ]         STREAM     CONNECTED     9030
  97. unix
  98.   3      [ ]         STREAM     CONNECTED     8969   
  99. @/var/run/hald/dbus-JvR                                                
  100.                              iEWuVI3
  101. unix  3      [ ]         STREAM     CONNECTED     8888
  102. unix
  103.   3      [ ]         STREAM     CONNECTED     8798   
  104. @/var/run/hald/dbus-J0d                                                
  105.                              vdSzGL7
  106. unix  3      [ ]         STREAM     CONNECTED     8797
  107. unix
  108.   3      [ ]         STREAM     CONNECTED     8778   
  109. /var/run/dbus/system_bu                                                
  110.                              s_socket
  111. unix  3      [ ]         STREAM     CONNECTED     8777
  112. unix  2      [ ]         DGRAM                    8750
  113. unix
  114.   3      [ ]         STREAM     CONNECTED     8695   
  115. /var/run/dbus/system_bu                                                
  116.                              s_socket
  117. unix  3      [ ]         STREAM     CONNECTED     8694
  118. unix  3      [ ]         STREAM     CONNECTED     8690
  119. unix  3      [ ]         STREAM     CONNECTED     8689
  120. unix  3      [ ]         DGRAM                    7059
  121. unix  3      [ ]         DGRAM                    7058
  122. [root@S058781 ~]#
复制代码




本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2013-5-23 10:31:42 | 显示全部楼层


ps aux 看是否有nginx进程
netstat -ntl看是否有80端口
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2013-5-23 11:33:45 | 显示全部楼层

  1. [root@S058781 ~]# ps aux
  2. USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
  3. root         1  0.0  0.2   2892  1424 ?        Ss   05:22   0:01 /sbin/init
  4. root         2  0.0  0.0      0     0 ?        S    05:22   0:00 [kthreadd]
  5. root         3  0.0  0.0      0     0 ?        S    05:22   0:00 [migration/0]
  6. root         4  0.0  0.0      0     0 ?        S    05:22   0:00 [ksoftirqd/0]
  7. root         5  0.0  0.0      0     0 ?        S    05:22   0:00 [migration/0]
  8. root         6  0.0  0.0      0     0 ?        S    05:22   0:00 [watchdog/0]
  9. root         7  0.0  0.0      0     0 ?        S    05:22   0:01 [events/0]
  10. root         8  0.0  0.0      0     0 ?        S    05:22   0:00 [cpuset]
  11. root         9  0.0  0.0      0     0 ?        S    05:22   0:00 [khelper]
  12. root        10  0.0  0.0      0     0 ?        S    05:22   0:00 [netns]
  13. root        11  0.0  0.0      0     0 ?        S    05:22   0:00 [async/mgr]
  14. root        12  0.0  0.0      0     0 ?        S    05:22   0:00 [pm]
  15. root        13  0.0  0.0      0     0 ?        S    05:22   0:00 [sync_supers]
  16. root        14  0.0  0.0      0     0 ?        S    05:22   0:00 [bdi-default]
  17. root        15  0.0  0.0      0     0 ?        S    05:22   0:00 [kintegrityd/0]
  18. root        16  0.0  0.0      0     0 ?        S    05:22   0:00 [kblockd/0]
  19. root        17  0.0  0.0      0     0 ?        S    05:22   0:00 [kacpid]
  20. root        18  0.0  0.0      0     0 ?        S    05:22   0:00 [kacpi_notify]
  21. root        19  0.0  0.0      0     0 ?        S    05:22   0:00 [kacpi_hotplug]
  22. root        20  0.0  0.0      0     0 ?        S    05:22   0:00 [ata/0]
  23. root        21  0.0  0.0      0     0 ?        S    05:22   0:00 [ata_aux]
  24. root        22  0.0  0.0      0     0 ?        S    05:22   0:00 [ksuspend_usbd]
  25. root        23  0.0  0.0      0     0 ?        S    05:22   0:00 [khubd]
  26. root        24  0.0  0.0      0     0 ?        S    05:22   0:00 [kseriod]
  27. root        25  0.0  0.0      0     0 ?        S    05:22   0:00 [md/0]
  28. root        26  0.0  0.0      0     0 ?        S    05:22   0:00 [md_misc/0]
  29. root        27  0.0  0.0      0     0 ?        S    05:22   0:00 [khungtaskd]
  30. root        28  0.0  0.0      0     0 ?        S    05:22   0:00 [kswapd0]
  31. root        29  0.0  0.0      0     0 ?        SN   05:22   0:00 [ksmd]
  32. root        30  0.0  0.0      0     0 ?        S    05:22   0:00 [aio/0]
  33. root        31  0.0  0.0      0     0 ?        S    05:22   0:00 [crypto/0]
  34. root        36  0.0  0.0      0     0 ?        S    05:22   0:00 [kthrotld/0]
  35. root        38  0.0  0.0      0     0 ?        S    05:22   0:00 [kpsmoused]
  36. root        39  0.0  0.0      0     0 ?        S    05:22   0:00 [usbhid_resumer]
  37. root        70  0.0  0.0      0     0 ?        S    05:22   0:00 [kstriped]
  38. root       242  0.0  0.0      0     0 ?        S    05:22   0:00 [scsi_eh_0]
  39. root       243  0.0  0.0      0     0 ?        S    05:22   0:00 [scsi_eh_1]
  40. root       312  0.0  0.0      0     0 ?        S    05:22   0:00 [virtio-blk]
  41. root       356  0.0  0.0      0     0 ?        S    05:22   0:00 [kdmflush]
  42. root       358  0.0  0.0      0     0 ?        S    05:22   0:00 [kdmflush]
  43. root       377  0.0  0.0      0     0 ?        S    05:22   0:00 [jbd2/dm-0-8]
  44. root       378  0.0  0.0      0     0 ?        S    05:22   0:00 [ext4-dio-unwrit]
  45. root       464  0.0  0.1   2748   916 ?        S<s -d
  46. root       646  0.0  0.0      0     0 ?        S    05:22   0:00 [vballoon]
  47. root       772  0.0  0.1   2744   980 ?        S<   05:22   0:00 /sbin/udevd -d
  48. root       802  0.0  0.0      0     0 ?        S    05:22   0:00 [jbd2/vda1-8]
  49. root       803  0.0  0.0      0     0 ?        S    05:22   0:00 [ext4-dio-unwrit]
  50. root       841  0.0  0.0      0     0 ?        S    05:22   0:00 [kauditd]
  51. root      1001  0.0  0.0      0     0 ?        S    05:22   0:00 [flush-253:0]
  52. root      1046  0.0  0.1  13956   852 ?        S<sl 05:22="" auditd
  53. root      1062  0.0  0.2  35564  1484 ?        Sl   05:22   0:01 /sbin/rsyslogd -i /var/run/syslogd.pid -c 4
  54. dbus      1113  0.0  0.1   2976   908 ?        Ss   05:22   0:00 dbus-daemon --system
  55. root      1137  0.0  0.1   2020   604 ?        Ss   05:22   0:00 /usr/sbin/acpid
  56. 68        1146  0.0  0.7   6136  3700 ?        Ss   05:22   0:00 hald
  57. root      1147  0.0  0.2   3784  1208 ?        S    05:22   0:00 hald-runner
  58. root      1175  0.0  0.2   3860  1024 ?        S    05:22   0:00 hald-addon-input: Listening on /dev/input/event2 /dev/input/event0
  59. 68        1187  0.0  0.1   3504  1016 ?        S    05:22   0:00 hald-addon-acpi: listening on acpid socket /var/run/acpid.socket
  60. root      1222  0.0  0.1   8516  1000 ?        Ss   05:22   0:01 /usr/sbin/sshd
  61. root      1417  0.0  0.5  12788  2648 ?        Ss   05:22   0:00 /usr/libexec/postfix/master
  62. postfix   1433  0.0  0.5  12932  2636 ?        S    05:22   0:00 qmgr -l -t fifo -u
  63. root      1441  0.0  0.2   5604  1172 ?        Ss   05:22   0:00 /usr/sbin/abrtd
  64. root      1449  0.0  0.1   3032   620 ?        Ss   05:22   0:00 abrt-dump-oops -d /var/spool/abrt -rwx /var/log/messages
  65. root      1456  0.0  0.1   7952   532 ?        Ss   05:22   0:00 pure-ftpd (SERVER)
  66. root      1463  0.0  0.2   5916  1196 ?        Ss   05:22   0:00 crond
  67. root      1474  0.0  0.0   2900   464 ?        Ss   05:22   0:00 /usr/sbin/atd
  68. root      1487  0.0  0.0   2008   484 tty1     Ss+  05:22   0:00 /sbin/mingetty /dev/tty1
  69. root      1489  0.0  0.0   2008   476 tty2     Ss+  05:22   0:00 /sbin/mingetty /dev/tty2
  70. root      1491  0.0  0.0   2008   480 tty3     Ss+  05:22   0:00 /sbin/mingetty /dev/tty3
  71. root      1493  0.0  0.1   2744   916 ?        S<   05:22   0:00 /sbin/udevd -d
  72. root      1494  0.0  0.0   2008   480 tty4     Ss+  05:22   0:00 /sbin/mingetty /dev/tty4
  73. root      1496  0.0  0.0   2008   480 tty5     Ss+  05:22   0:00 /sbin/mingetty /dev/tty5
  74. root      1498  0.0  0.0   2008   484 tty6     Ss+  05:22   0:00 /sbin/mingetty /dev/tty6
  75. root      2299  0.0  0.8  28764  4356 ?        Ss   17:00   0:00 /usr/local/php/bin/php-cgi --fpm --fpm-config /usr/local/php/etc/php-fpm.conf
  76. www       2300  0.0  0.8  27484  4184 ?        S    17:00   0:00 /usr/local/php/bin/php-cgi --fpm --fpm-config /usr/local/php/etc/php-fpm.conf
  77. www       2301  0.0  0.8  27484  4184 ?        S    17:00   0:00 /usr/local/php/bin/php-cgi --fpm --fpm-config /usr/local/php/etc/php-fpm.conf
  78. www       2302  0.0  0.8  27484  4184 ?        S    17:00   0:00 /usr/local/php/bin/php-cgi --fpm --fpm-config /usr/local/php/etc/php-fpm.conf
  79. www       2303  0.0  0.8  27484  4184 ?        S    17:00   0:00 /usr/local/php/bin/php-cgi --fpm --fpm-config /usr/local/php/etc/php-fpm.conf
  80. www       2304  0.0  0.8  27484  4184 ?        S    17:00   0:00 /usr/local/php/bin/php-cgi --fpm --fpm-config /usr/local/php/etc/php-fpm.conf
  81. root      2314  0.0  0.2   5068  1256 ?        S    17:00   0:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/usr/local/mysql/var --pid-file=/usr/loca
  82. mysql     2417  0.0  1.3  40012  7100 ?        Sl   17:00   0:00 /usr/local/mysql/libexec/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/var --
  83. root      3483  0.0  0.6  11856  3552 ?        S    17:21   0:00 sshd: root@notty
  84. root      3487  0.0  0.3   8024  1932 ?        Ss   17:21   0:00 /usr/libexec/openssh/sftp-server
  85. root      6006  0.0  0.6  11600  3444 ?        S    18:22   0:00 sshd: root@notty
  86. root      6009  0.0  0.3   8728  1748 ?        Ss   18:22   0:00 /usr/libexec/openssh/sftp-server
  87. postfix   6021  0.0  0.5  12864  2596 ?        S    18:42   0:00 pickup -l -t fifo -u
  88. root      6666  0.0  0.6  11460  3432 ?        S    19:04   0:00 sshd: root@pts/0
  89. root      6672  0.0  0.3   5128  1604 pts/0    Ss+  19:04   0:00 -bash
  90. root      7067  0.0  0.6  11600  3468 ?        S    19:15   0:00 sshd: root@notty
  91. root      7069  0.0  0.3   7844  1780 ?        Ss   19:15   0:00 /usr/libexec/openssh/sftp-server
  92. root      7154  0.0  0.7  11592  3712 ?        S    19:17   0:00 sshd: root@pts/1
  93. root      7160  0.0  0.3   5128  1612 pts/1    Ss   19:17   0:00 -bash
  94. root      7428  1.0  0.2   4936  1056 pts/1    R+   19:23   0:00 ps aux
  95. [root@S058781 ~]# ^C
  96. [root@S058781 ~]# ^C
  97. [root@S058781 ~]# netstat -ntl
  98. Active Internet connections (only servers)
  99. Proto Recv-Q Send-Q Local Address               Foreign Address             State
  100. tcp        0      0 0.0.0.0:21                  0.0.0.0:*                   LISTEN
  101. tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN
  102. tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN
  103. tcp        0      0 0.0.0.0:3306                0.0.0.0:*                   LISTEN
  104. tcp        0      0 :::21                       :::*                        LISTEN
  105. tcp        0      0 :::22                       :::*                        LISTEN
  106. tcp        0      0 ::1:25                      :::*                        LISTEN
复制代码
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2013-5-23 11:34:24 | 显示全部楼层



我重启之前都是正常可以访问的,请问军哥这是怎么回事呢
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2013-5-23 13:38:10 | 显示全部楼层

nginx 没启动

有很少一部分系统模板好像无法随系统启动

执行:
echo "/etc/init.d/lnmp start" >> /etc/rc.local 后重启试试看
不行就只能/etc/init.d/lnmp start手动启动

军哥运维代购:http://shop63846532.taobao.com/

 楼主| 发表于 2013-5-23 14:17:51 | 显示全部楼层

  1. [root@S058781 etc]# cd init.d
  2. [root@S058781 init.d]# dir
  3. abrt-ccpp  acpid   cpuspeed   haldaemon  iptables    killall       messagebus  netfs    ntpd     postfix   quota_nld    rsyslog    single  sysstat
  4. abrtd      atd     crond      halt       irqbalance  lvm2-monitor  mysql       network  ntpdate  psacct    rdisc        sandbox    smartd  udev-post
  5. abrt-oops  auditd  functions  ip6tables  kdump       mdmonitor     netconsole  nginx    php-fpm  pureftpd  restorecond  saslauthd  sshd
  6. [root@S058781 init.d]# /etc/init.d/lnmp start
  7. -bash: /etc/init.d/lnmp: No such file or directory
  8. [root@S058781 init.d]#
复制代码



晕,这到底是怎么回事,lnmp被删了吗?明明先前是好好的啊。
 楼主| 发表于 2013-5-23 14:27:13 | 显示全部楼层

  1. [root@S058781 ~]# /root/lnmp start
  2. =========================================================================
  3. Manager for LNMP V0.9  ,  Written by Licess
  4. =========================================================================
  5. LNMP is a tool to auto-compile & install Nginx+MySQL+PHP on Linux
  6. This script is a tool to Manage status of lnmp
  7. For more information please visit http://www.lnmp.org

  8. Usage: /root/lnmp {start|stop|reload|restart|kill|status}
  9. =========================================================================
  10. Starting LNMP...
  11. nginx: [emerg] duplicate location "/" in /usr/local/nginx/conf/wordpress.conf:1
  12. Nginx start successfully!
  13. php-fpm is runing!
  14. MySQL is runing!
复制代码


/usr/local/nginx/conf/wordpress.conf:文件内容如下:
  1. location / {
  2. if (-f $request_filename/index.html){
  3.                 rewrite (.*) $1/index.html break;
  4.         }
  5. if (-f $request_filename/index.php){
  6.                 rewrite (.*) $1/index.php;
  7.         }
  8. if (!-f $request_filename){
  9.                 rewrite (.*) /index.php;
  10.         }
  11. }
复制代码

用/root/lnmp start命令提示这个,是否这个文件有错导致的呢?
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2013-5-23 14:36:25 | 显示全部楼层

看起来是在一个虚拟主机配置文件中同时引用了两个rewrite配置导致的?
删掉一个之后现在可以启动lnmp了。

server
        {
                listen       80;
                server_name qd.gs;
                index index.html index.htm index.php default.html default.htm default.php;
                root  /home/wwwroot/qd.gs;

                include discuz.conf;
                include wordpress.conf;

                location ~ .*\.(php|php5)?$
                        {
                                try_files $uri =404;
                                fastcgi_pass  unix:/tmp/php-cgi.sock;
                                fastcgi_index index.php;
                                include fcgi.conf;
                        }

                location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
                        {
                                expires      30d;
                        }

                location ~ .*\.(js|css)?$
                        {
                                expires      12h;
                        }

                access_log off;
        }
~

[ 本帖最后由 veryad 于 2013-5-23 14:37 编辑 ]
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-9-24 13:15 , Processed in 0.029471 second(s), 17 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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