Ubuntu 18.04 && Apache 2.4.29
安装了灯和WordPress,我和我可以进入槽192.168.1.80。
已经在路由器上打开了端口80,并在这里上进行了检查。
这是我的Apache2站点配置:
(用我的实际DNS替换xx )
<VirtualHost *:80>
ServerAdmin xx.ddns.net
ServerName xx.ddns.net
ServerAlias www.xx.ddns.net
DocumentRoot /var/www/wordpress
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /var/www/wordpress/>
AllowOverride All
</Directory>
</VirtualHost>检查Ubuntu是否在监听:
root@ubuntudiogo:~# sudo iptables -L -nv
Chain INPUT (policy ACCEPT 479 packets, 42264 bytes)
pkts bytes target prot opt in out source destination
79 15269 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:80
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 402 packets, 55621 bytes)
pkts bytes target prot opt in out source destination在当地一切都很好。当我试图通过外部网络(在这种情况下,我的手机通过4G)访问它时,页面重定向到我的内部IP。
找不到解决这个问题的办法。
发布于 2019-04-02 12:59:16
您的服务器别名需要更改为
ServerName xx.ddns.net
ServerAlias xx.ddns.nethttps://stackoverflow.com/questions/55464851
复制相似问题