将默认端口从80更改为8099后,Apache2不工作
我做了以下工作:
在/etc/apache2/ports.conf中,将端口更改为:
Listen 8099
在/etc/apache2/sites enabled/000-default.conf中,执行了以下操作:
<VirtualHost *:8099>
然后:
sudo /etc/init.d/apache2 reload
sudo /etc/init.d/apache2 restart
我尝试使用:sudo netstat-plunt检查打开的端口,结果如下:
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 1179/mysqld
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1005/sshd
tcp6 0 0 :::8099 :::* LISTEN 6337/apache2
tcp6 0 0 :::22 :::* LISTEN 1005/sshd
udp 0 0 0.0.0.0:14717 0.0.0.0:* 641/dhclient
udp 0 0 0.0.0.0:68 0.0.0.0:* 641/dhclient
udp6 0 0 :::48002 :::* 641/dhclient
我有什么遗漏吗?谢谢
最佳答案
似乎它只对ipv6有效,但奇怪的是。
这里有一种强制它使用IPv4的方法:https://unix.stackexchange.com/a/237610
Listen 0.0.0.0:8099
关于linux - 更改默认端口后,Apache2无法正常工作,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/35373707/