简体   繁体   English

无法从本地计算机连接到Apache服务器

[英]Cannot connect to apache server from local machine

I have installed apache and php on a linux server CentOS 6.4. 我已经在Linux服务器CentOS 6.4上安装了apache和php。 I followed these steps 我按照这些步骤

yum install -y httpd
/sbin/service httpd restart
yum install -y php php-mysql
yum install -y mod_ssl openssl
/sbin/service httpd restart
service iptables stop

I changed the ServerName in /etc/httpd/conf/httpd.conf from 我从/etc/httpd/conf/httpd.conf中更改了ServerName

#ServerName www.example.com:80

to

ServerName 172.32.35.14 (ip address of the server)
/sbin/service httpd restart

I have a php sample pas with the following code: 我有以下示例的php示例pas:

<?php
phpinfo();
?>

But when I try to access the page http://172.32.35.14/info.php from my local machine it says "Problem loading page". 但是,当我尝试从本地计算机访问页面http://172.32.35.14/info.php时 ,它显示“问题加载页面”。 Whereas, I get proper response when connected to the page from 172.32.35.15 而从172.32.35.15连接到页面后,我得到了正确的响应

My ISP doesnt block http requests. 我的ISP不会阻止http请求。 172.* network is a VPN. 172. *网络是VPN。 I connected to the VPN, able to ping the machine, do a ssh connection to the machine using putty. 我连接到VPN,能够ping通计算机,并使用腻子与计算机建立ssh连接。 But when I cannot access the php page from my local machine. 但是,当我无法从本地计算机访问php页面时。

What am I missing? 我想念什么? Please advice 请指教

netstat -tulpn output is: netstat -tulpn输出为:

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name
tcp        0      0 0.0.0.0:111                 0.0.0.0:*                   LISTEN      1235/rpcbind
tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN      4406/sshd
tcp        0      0 127.0.0.1:631               0.0.0.0:*                   LISTEN      4198/cupsd
tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN      4636/master
tcp        0      0 0.0.0.0:52330               0.0.0.0:*                   LISTEN      1253/rpc.statd
tcp        0      0 :::111                      :::*                        LISTEN      1235/rpcbind
tcp        0      0 :::80                       :::*                        LISTEN      30170/httpd
tcp        0      0 :::22                       :::*                        LISTEN      4406/sshd
tcp        0      0 ::1:631                     :::*                        LISTEN      4198/cupsd
tcp        0      0 ::1:25                      :::*                        LISTEN      4636/master
tcp        0      0 :::443                      :::*                        LISTEN      30170/httpd
tcp        0      0 :::46690                    :::*                        LISTEN      1253/rpc.statd
udp        0      0 0.0.0.0:1005                0.0.0.0:*                               1253/rpc.statd
udp        0      0 0.0.0.0:111                 0.0.0.0:*                               1235/rpcbind
udp        0      0 0.0.0.0:631                 0.0.0.0:*                               4198/cupsd
udp        0      0 0.0.0.0:68                  0.0.0.0:*                               1129/dhclient
udp        0      0 0.0.0.0:986                 0.0.0.0:*                               1235/rpcbind
udp        0      0 0.0.0.0:39783               0.0.0.0:*                               1253/rpc.statd
udp        0      0 :::111                      :::*                                    1235/rpcbind
udp        0      0 :::38152                    :::*                                    1253/rpc.statd
udp        0      0 :::986                      :::*                                    1235/rpcbind

iptables -L iptables -L

Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

Please confirm your server( 172.32.35.14 ) where you have install php and mysql right? 请确认您的服务器( 172.32.35.14 )是否已安装php和mysql,对吗?

What is your local machine ip? 您的本地机器IP是什么?

Please run tracert and nslookup command from your local machine: 请从您的本地计算机运行tracert和nslookup命令:

tracert 172.32.35.14

nslookup 172.32.35.14

and see where packets drops. 并查看丢包的位置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM