apache2默认使用80端口,有时候会很不方便,下面介绍如何修改端口
1.vim /etc/apache2/ports.conf文件,修改:
Listen 8001
2.vim /etc/apache2/sites-enabled/000-default.conf文件,修改为:
<VirtualHost *:5001>
3.重启apache2服务
sudo /etc/init.d/apache2 restart
在浏览器中输入http://localhost:8001/ 可以查看成功
linux可以curl http://127.0.0.1:8001/