2 回答

TA貢獻1797條經(jīng)驗 獲得超6個贊

TA貢獻1780條經(jīng)驗 獲得超5個贊
方法很簡單:
1、修改 /etc/apache2/ports.conf將 NameVirtualHost *:80和Listen 80修改為自己需要的端口,例如:
NameVirtualHost *:1000 Listen 1000
2、修改/etc/apache2/sites-available/default
將第一行的 VirtualHost :80 改為自己需要的端口VirtualHost :1000
3、修改 /etc/init.d/apache2/httpd.conf 添加Servername localhost,否則重啟時會報如下錯誤
* Restarting web server apache2apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName ... waiting apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 forServerNam
4.重啟apache
sudo /etc/init.d/apache2 restart
端口修改完畢。apache的端口修改為1000了。
添加回答
舉報