1, 修改 /etc/apache2/ports.conf 将
Listen 80
改为自己需要的端口,如
Listen 7779
2,修改/etc/apache2/sites-enabled/000-default.conf 将第一行的
<VirtualHost *:80>
改为自己需要的端口
<VirtualHost *:7779>
3 重启
service apache2 restart
或者
/etc/init.d/apache2 restart
4 打开浏览器验证
http://服务器ip:7779/
参考:https://blog.csdn.net/wuzhong8809/article/details/84061144