gpt4 book ai didi

php - 无法从本地计算机连接到 apache 服务器

转载 作者:太空宇宙 更新时间:2023-11-04 13:00:43 26 4
gpt4 key购买 nike

我在 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/rpcbind

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

最佳答案

请确认您的服务器(172.32.35.14)是否正确安装了php和mysql?

你的 native ip是多少?

请从您的本地计算机运行 tracert 和 nslookup 命令:

tracert 172.32.35.14

nslookup 172.32.35.14

并查看数据包丢失的位置。

关于php - 无法从本地计算机连接到 apache 服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33986128/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com