【问题标题】:Can't connect to Apache Server Remotely无法远程连接到 Apache 服务器
【发布时间】:2014-01-15 19:58:27
【问题描述】:

我在puppy linux中设置了apache,可以在localhost中看到文件。但是,当我打开port80并尝试从iphone连接apache但它失败了。我只能看到一个白页。可能不是 404,因为它没有显示 404 错误。(在我打开端口之前,我看到了 404。)

我已将 apache.conf 配置为 Allow from all。

访问日志和错误日志什么也没显示。

这是 iptables-L

Chain INPUT (policy DROP)
target     prot opt source               destination         
ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED 
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:ftp 
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:ssh 
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:smtp 
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:domain 
ACCEPT     udp  --  anywhere             anywhere            state NEW udp dpt:domain 
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:finger 
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:www 
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:pop3 
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:auth 
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:imap2 
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:443 
ACCEPT     udp  --  anywhere             anywhere            state NEW udp dpt:syslog 
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:printer 
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:993 
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:995 
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:www 
ACCEPT     udp  --  anywhere             anywhere            state NEW udp dpt:www 
A   CCEPT     all  --  anywhere             anywhere            state NEW 
 TRUSTED    all  --  anywhere             anywhere            state NEW 

Chain FORWARD (policy DROP)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         
DROP       icmp --  anywhere             anywhere            state INVALID 

Chain TRUSTED (1 references)
target     prot opt source               destination         
ACCEPT     icmp --  anywhere             anywhere            icmp echo-request 
DROP       icmp --  anywhere             anywhere            
REJECT     all  --  anywhere             anywhere            reject-with icmp-port-            unreachable 

网络统计

tcp        0      0 192.168.100.100:80      0.0.0.0:*               LISTEN     
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN 

我该如何解决这个问题?

【问题讨论】:

    标签: linux apache


    【解决方案1】:

    tcp 0 0 192.168.100.100:80

    问题就在这里。服务器正在侦听特定的本地 IP 地址,而不是 0.0.0.0。

    【讨论】:

    • 感谢您的回复。当我在我的rooter中打开端口80时,我使用了那个ip,所以我认为我必须使用它。那么,我应该使用什么ip?你能告诉我吗?
    • 我在 ports.conf 中写了“Listen 0.0.0.0.:80”,但是没有用。404 error.netstat 显示“tcp 0 0 0.0.0.0:80 0.0. 0.0:* LISTEN 9608/apache2 "抱歉又打扰了。我该怎么解决这个问题?
    • 这正是它应该显示的内容。错误 404 证明连接有效。服务器通过连接向您发送了该代码。这意味着在那里找不到您请求的 URL。这是进步。
    • 谢谢。现在,我可以从另一台机器连接到 apache。
    猜你喜欢
    • 2017-09-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-04-20
    • 2011-04-29
    • 2010-11-13
    相关资源
    最近更新 更多