编辑3:
奇怪的发现。此问题仅发生在一个特定客户端上。除我的主桌面外,所有三个站点都可以通过域名从任何计算机访问。此桌面只能通过本地 IP 地址 192.168.0.X 访问服务器(用于 HTTP 或 SSH),而不能通过外部 IP 或域名访问。从所有其他机器上,一切都按预期运行。
我检查了我的 fail2ban 日志和防火墙,以确保这台特定的机器没有被阻止。还有什么问题?无法从我的主桌面访问我的服务器真是太痛苦了。
如果重要的话,两者都通过以太网电缆硬连线到同一个路由器。
原始帖子:
我在 Apache 中定义了三个虚拟主机(所有三个虚拟主机都存储了 .conf 文件,/etc/apache2/sites-available
并且已通过 启用a2ensite
)。
在从 Ubuntu 16.04 更新到 Ubuntu 18.04 之前,这三个都运行良好。更新后,它们都无法在浏览器中加载,因此我进行了大量故障排除。以下是我迄今为止所做/复查的内容:
- 重新安装 apache2 和 php
- 已检查
apache2.conf
,包括运行apache2ctl -t
调试 - 没有错误。 - 检查了每个站点的 conf 文件,并运行
apache2ctl -S
以确保所有文件均已识别。每个文件都指定了 ServerName(域名)和 DocumentRoot(本地目录)。这些值已经过三重检查以确保正确性。 - 检查了 DNS 设置。所有三个域名都指向正确的 IP 地址(用于
dig
确认)。 - 检查防火墙设置 - 端口 80 已打开并且 Apache 正在监听它。
当通过域名访问这三个站点中的任何一个时,浏览器都会给出错误信息:“无法访问该站点。domain.com 响应时间过长。”
如果我在浏览器中输入 IP 地址而不是域名,我可以毫无问题地访问默认站点(Apache 加载的第一个站点)。
我觉得这是某种 Apache 配置,我不知怎么搞乱了,但我所拥有的只是apache2.conf
全新安装的默认文件以及虚拟主机配置文件,它们都具有以下格式:
<VirtualHost *:80>
ServerName somedomain.com
DocumentRoot "/var/www/foldername"
<Directory /var/www/foldername>
Options -Indexes
AllowOverride XXXXXXXXXX
</Directory>
</VirtualHost>
AllowOverride 适用None
于一个站点和Fileinfo Options
另外两个站点。
知道我错过了什么吗?
编辑1:添加来自dig
、ping
和 的输出curl
angela@pop-os:~$ dig mydomain.com
; <<>> DiG 9.11.5-P1-1ubuntu2.5-Ubuntu <<>> mydomain.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 65412
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;mydomain.com. IN A
;; ANSWER SECTION:
mydomain.com. 1799 IN A MY_SERVER_IP
;; Query time: 60 msec
;; SERVER: 127.0.0.53#53(127.0.0.53)
;; WHEN: Sat Aug 31 23:54:55 EDT 2019
;; MSG SIZE rcvd: 57
angela@pop-os:~$ ping mydomain.com
PING mydomain.com (MY_SERVER_IP) 56(84) bytes of data.
^C
--- mydomain.com ping statistics ---
18 packets transmitted, 0 received, 100% packet loss, time 415ms
angela@pop-os:~$ curl -v mydomain.com
* Expire in 0 ms for 6 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 1 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 2 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 2 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 2 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 2 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 2 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 2 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 2 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 2 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 2 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 2 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 2 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 2 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 2 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 2 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 2 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 2 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 2 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 2 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Expire in 0 ms for 1 (transfer 0x558ffb3d7880)
* Trying MY_SERVER_IP...
* TCP_NODELAY set
* Expire in 200 ms for 4 (transfer 0x558ffb3d7880)
编辑2:添加curl ip_address
和 netstat 的输出。
angela@pop-os:~$ curl -v MY_SERVER_IP
* Expire in 0 ms for 6 (transfer 0x5601183bb880)
* Trying MY_SERVER_IP...
* TCP_NODELAY set
* Expire in 200 ms for 4 (transfer 0x5601183bb880)
* connect to MY_SERVER_IP port 80 failed: Connection timed out
* Failed to connect to MY_SERVER_IP port 80: Connection timed out
* Closing connection 0
curl: (7) Failed to connect to MY_SERVER_IP port 80: Connection timed out
user@server:~$ sudo netstat -anp | grep apache
tcp6 0 0 :::80 :::* LISTEN 28228/apache2
答案1
我不确定这是否是“正确”的解决方案,但对我来说很管用。最后,我所做的就是在/etc/hosts
无法连接到服务器的“损坏”客户端上添加一行。我输入了内部 IP 地址(我已将路由器设置为使所有主要设备(包括服务器)都保持相同的 IP 地址),后面跟着一个空格分隔的该服务器上托管的域列表。示例:
192.168.0.1 domain1.com domain2.com domain3.com sub.domain3.com
这似乎不是一个好的、动态的、永久的解决方案。但它暂时解决了问题。