将默认端口从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
我在这里缺少什么?感谢
答案 0 :(得分:1)
答案 1 :(得分:0)
注意粗体部分:
<VirtualHost *:80>
#ServerName www.example.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/'Your folder acess'/public
<Directory /var/www/'Your folder acess'/public>
AllowOverride All
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet