網頁無法從世界進入!

網頁無法從世界進入!

我已經安裝了一個新的 Apache 和一個新的 Ubuntu 伺服器。我還沒有對我的伺服器進行任何更改。預設 Apache 網站對於專用網路內的其他 PC 是可見的。

連接埠 80 和 22 已正確轉送至伺服器,並且我已從路由器設定了固定 IP DHCP 192.168.10.116。

可以從公共或專用網路存取 SSH。但該網站只能透過專用網路存取。我想讓這個網站向全世界開放。

請注意,我已使用 Windows PC + XAMMP 嘗試過此設置,從公用 IP 可以看到預設的 Apache 網頁。

以下是一些細節:

mg@node1:~$ sudo ufw status
Status: inactive
mg@node1:~$ sudo iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
mg@node1:~$ cat /etc/apache2/ports.conf

Listen 80

<IfModule ssl_module>
        Listen 443
</IfModule>

<IfModule mod_gnutls.c>
        Listen 443
</IfModule>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
mg@node1:~$ sudo netstat -nptl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      702/systemd-resolve
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      780/sshd
tcp        0      0 127.0.0.1:6010          0.0.0.0:*               LISTEN      1039/sshd: mg@pts/0
tcp6       0      0 :::80                   :::*                    LISTEN      2340/apache2
tcp6       0      0 :::22                   :::*                    LISTEN      780/sshd
tcp6       0      0 ::1:6010                :::*                    LISTEN      1039/sshd: mg@pts/0
mg@node1:~$ cat /etc/hosts
127.0.0.1 localhost
127.0.1.1 node1

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
mg@node1:~$ curl http://192.168.10.116
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML ... ...
mg@node1:~$ curl http://43.xxx.xxx.95
curl: (7) Failed to connect to 43.xxx.xxx.95 port 80: Connection refused

我的路由器連接埠轉送記錄

相關內容