apache和httpd正在运行,但我看不到我的网站 [英] apache and httpd running but I can't see my website
问题描述
我已经在服务器上安装了apache,但是无法通过服务器的IP浏览我的网站. apache的设置是/var/www/htdocs/下的单个帐户服务器.
I have installed apache on my server however I can not browse my website through my server's IP. the setup of the apache is a single account server under /var/www/htdocs/.
我还需要做其他事情才能通过服务器的IP查看帐户吗?
Is there anything else I need to do to be able to see the account via my server's IP?
推荐答案
有几种可能性.
- 防火墙,iptables配置
- Apache监听地址/端口
需要有关您的配置的更多信息.您正在使用什么发行版?您可以通过127.0.0.1进行连接吗?
More information is needed about your configuration. What distro are you using? Can you connect via 127.0.0.1?
如果问题出在防火墙/iptables上,则可以将以下行添加到/etc/sysconfig/iptables:
If the issue is with the firewall/iptables, you can add the following lines to /etc/sysconfig/iptables:
-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 443 -j ACCEPT
(第二行仅适用于https)
(Second line is only needed for https)
请确保该行位于会全局限制访问权限的所有行的上方,如下所示:
Make sure this is above any lines that would globally restrict access, like the following:
-A INPUT -j REJECT --reject-with icmp-host-prohibited
在CentOS 6.3上测试
Tested on CentOS 6.3
最后
service iptables restart
这篇关于apache和httpd正在运行,但我看不到我的网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!