我在 Ubuntu 20.04.3 上安装了 owncloud。它可以通过 ssl 访问(使用 no-ip 的 IP 地址),并且一切运行良好。
几天前,我尝试使用 samba(它也运行良好),看看能否让 Apple Time Machine 正常工作。但没成功。更糟糕的是:Apache 服务器不再能从互联网访问。
根据浏览器的不同,错误消息可能类似于“无法连接到服务器”或“ERR_ADDRESS_UNREACHABLE”。
我的路由器(Fritz.box 7490)中的设置似乎没有问题。
Apache 正在运行:
fambopp@fambopp-MacBookAir:~$ sudo systemctl status apache2
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2021-12-14 06:35:00 CET; 30min ago
Docs: https://httpd.apache.org/docs/2.4/
Process: 3993 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
Process: 5017 ExecReload=/usr/sbin/apachectl graceful (code=exited, status=0/SUCCESS)
Main PID: 3997 (apache2)
Tasks: 6 (limit: 4531)
Memory: 15.5M
CGroup: /system.slice/apache2.service
├─3997 /usr/sbin/apache2 -k start
├─5021 /usr/sbin/apache2 -k start
├─5022 /usr/sbin/apache2 -k start
├─5023 /usr/sbin/apache2 -k start
├─5024 /usr/sbin/apache2 -k start
└─5025 /usr/sbin/apache2 -k start
Dez 14 06:35:00 fambopp-MacBookAir systemd[1]: Starting The Apache HTTP Server...
Dez 14 06:35:00 fambopp-MacBookAir systemd[1]: Started The Apache HTTP Server.
Dez 14 07:05:04 fambopp-MacBookAir systemd[1]: Reloading The Apache HTTP Server.
Dez 14 07:05:04 fambopp-MacBookAir systemd[1]: Reloaded The Apache HTTP Server.
我使用 nmap 检查了一下,没有发现任何问题:
Starting Nmap 7.80 ( https://nmap.org ) at 2021-12-14 07:33 CET
Nmap scan report for fambopp-MacBookAir.fritz.box (192.168.10.194)
Host is up (0.000010s latency).
Not shown: 994 closed ports
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
139/tcp open netbios-ssn
443/tcp open https
445/tcp open microsoft-ds
5900/tcp open vnc
Nmap done: 1 IP address (1 host up) scanned in 0.16 seconds
我没有激活 ufw。因此我激活了它并允许一切:
Status: active
Logging: on (low)
Default: deny (incoming), allow (outgoing), disabled (routed)
New profiles: skip
To Action From
-- ------ ----
22/tcp ALLOW IN Anywhere
80,443/tcp (Apache Full) ALLOW IN Anywhere
137,138/udp (Samba) ALLOW IN Anywhere
139,445/tcp (Samba) ALLOW IN Anywhere
5900/tcp ALLOW IN Anywhere
22/tcp (v6) ALLOW IN Anywhere (v6)
80,443/tcp (Apache Full (v6)) ALLOW IN Anywhere (v6)
137,138/udp (Samba (v6)) ALLOW IN Anywhere (v6)
139,445/tcp (Samba (v6)) ALLOW IN Anywhere (v6)
5900/tcp (v6) ALLOW IN Anywhere (v6)
我可以成功 ping 通该页面:
PING 93.104.185.180 (93.104.185.180) 56(84) bytes of data.
64 bytes from 93.104.185.180: icmp_seq=1 ttl=63 time=0.606 ms
64 bytes from 93.104.185.180: icmp_seq=2 ttl=63 time=0.613 ms
64 bytes from 93.104.185.180: icmp_seq=3 ttl=63 time=0.595 ms
--- 93.104.185.180 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2037ms
rtt min/avg/max/mdev = 0.595/0.604/0.613/0.007 ms
我已经想不出问题出在哪里了,非常感谢大家的帮助。Rainer
答案1
谢谢 Doug Smithies。您关于端口转发的提示让我找到了正确的问题。出于一个非常奇怪的原因,我的路由器为服务器分配了一个新 IP,尽管它被设置为静态 IP 地址。但它并没有在端口转发页面中更改此信息(我不知道这是否是正确的措辞,路由器是德国的……)。所以我将 IP 改回了原来的状态。现在一切正常。最大的问题是:为什么在 Samba 上工作时会发生这种情况。无论如何,现在这无关紧要了。