我在Ubuntu 18.04测试服务器上设置了mailhog。因为它是服务器设置,所以无法从CLI运行Web界面。因此,我需要可以从服务器外部对其进行访问。我知道它正在端口8025上运行,因此我尝试通过输入服务器IP:8025来访问它。但这不起作用。
我在防火墙中打开了端口8025:
$ sudo ufw status verbose
Status: active
Logging: on (low)
Default: deny (incoming), allow (outgoing), disabled (routed)
New profiles: skip
To Action From
-- ------ ----
443/tcp ALLOW IN Anywhere
22/tcp ALLOW IN Anywhere
80/tcp ALLOW IN Anywhere
80,443/tcp (Apache Full) ALLOW IN Anywhere
8025 ALLOW IN Anywhere
8025/tcp ALLOW IN Anywhere
443/tcp (v6) ALLOW IN Anywhere (v6)
22/tcp (v6) ALLOW IN Anywhere (v6)
80/tcp (v6) ALLOW IN Anywhere (v6)
80,443/tcp (Apache Full (v6)) ALLOW IN Anywhere (v6)
8025 (v6) ALLOW IN Anywhere (v6)
8025/tcp (v6) ALLOW IN Anywhere (v6)
我添加了端口转发功能,因此端口8025如本post中所述转发到本地ip 127.0.0.1。
但是当运行10.0.0.2:8025时,出现连接超时。同样,在使用中,在服务器上运行的网站(10.0.0.2),例如www.example.loc:8025。
如何使其可访问?