linux - 更改默认端口后 Apache2 不工作

标签 linux apache ubuntu

将默认端口从 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/

相关文章:

jquery - 防止在html中加载图像

ubuntu - Docker 无法运行

linux - 如何在X86_64 CentOS系统上安装32位gcc编译器

python - 如何在 Linux 上快速将大数据从 C++ 发送到 Python?

python - 我是否必须不断更改默认的 python 版本?

apache - 无法让 Pyramid 与 mod_wsgi 一起使用

php - 网站文字大小限制

ubuntu - 如何检查 docker 是否由 apt-get 在 ubuntu 中安装?

linux - 无法在 tmp 中创建目录(overthewire bandit24)

linux - 将自定义 header 添加到目录中的特定文件