返回首页
Linux 实践

Apache HTTP Server实践

修改端口号

  • /etc/apache2/ports.conf
sudo nano /etc/apache2/ports.conf
# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default.conf

Listen 8081
......
......
  • /etc/apache2/sites-enabled/000-default.conf
sudo nano /etc/apache2/sites-enabled/000-default.conf
<VirtualHost *:8081>
......
......
</VirtualHost>
  • 重启服务
sudo systemctl restart apache2

参考资料