我已经在linux服务器CentOS 6.4上安装了apache和php。我遵循了以下步骤
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我将/etc/httpd/conf/httpd.conf中的ServerName从
#ServerName www.example.com:80至
ServerName 172.32.35.14 (ip address of the server)
/sbin/service httpd restart我有一个包含以下代码的php示例pas:
<?php
phpinfo();
?>但是当我试图从我的本地机器访问页面http://172.32.35.14/info.php时,它显示“加载页面时出现问题”。然而,当我连接到来自172.32.35.15的页面时,我得到了正确的响应
我的ISP不阻止http请求。172.*网络是VPN。我连接到VPN,能够ping机器,使用putty建立到机器的ssh连接。但是当我无法从本地机器访问php页面时。
我遗漏了什么?敬请指教
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/rpcbindiptables -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发布于 2015-11-30 02:18:01
请确认你安装php和mysql的server(172.32.35.14),对吗?
您的本机ip是多少?
请从本地计算机运行tracert和nslookup命令:
tracert 172.32.35.14
nslookup 172.32.35.14并查看数据包的丢弃位置。
https://stackoverflow.com/questions/33986128
复制相似问题