从远程计算机访问Apache Server

时间:2014-04-19 22:43:04

标签: apache rhel

我使用的是Red Hat 4.4.7-4。我已经使用

安装了Apache服务器

yum install httpd

/etc/init.d/httpd start

/etc/init.d/httpd状态 httpd(pid 1371)正在运行......

可以使用ssh终端通过VPN客户端访问本机。当我点击

http://ip address:80 

在浏览器中,页面不会加载。我收到以下错误:

This Page Cannot Be Displayed

The system cannot communicate with the external server ( 173.39.232.226 ). The Internet server may be busy, may be permanently down, or may be unreachable because of network problems.

Please check the spelling of the Internet address entered. If it is correct, try this request later.

If you have questions, or feel this is an error, please contact your corporate network administrator and provide the codes shown below.
Notification codes:     (1, GATEWAY_TIMEOUT, 173.39.232.226)

另外,下面是iptables的输出

[root@blended-services-demo html]# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:http 
ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:http 

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination 

1 个答案:

答案 0 :(得分:0)

您需要在端口80上启用对服务器的访问,因为它目前被iptables阻止。

sudo /sbin/iptables -I INPUT -p tcp -m tcp --dport 80 -j ACCEPT

这将在开始时将规则插入到iptables配置中。完成此操作并测试它是否有效之后,您应该保存配置,以便下次启动服务时使用它,

sudo /sbin/service iptables save

这会将当前配置写入/ etc / sysconfig / iptables。

如果这不能解决你的问题,我建议你看看这里: apache not accepting incoming connections from outside of localhost