我在更改 Apache2 监听的默认端口方面有所尝试,但它不起作用。
我编辑了我的 ports.conf 文件,如下所示:
# Edited:
NameVirtualHost *:9000
Listen 9000
# Kept the same:
<IfModule mod_ssl.c>
# If you add NameVirtualHost *:443 here, you will also have to change
# the VirtualHost statement in /etc/apache2/sites-available/default-ssl
# to <VirtualHost *:443>
# Server Name Indication for SSL named virtual hosts is currently not
# supported by MSIE on Windows XP.
Listen 443
</IfModule>
<IfModule mod_gnutls.c>
Listen 443
</IfModule>
然后调整我的 VHost 文件(并将其符号链接到启用站点):
<VirtualHost *:9000>
ServerAdmin webmaster@mysite.co.uk
ServerName www.mysite.co.uk
ServerAlias mysite.co.uk
# Directory Root
DocumentRoot /home/mysite/www
# Logfiles
ErrorLog /home/mysite/log/error.log
CustomLog /home/mysite/log/www.log "%v %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\""
</VirtualHost>
作为记录,如果我将所有端口引用 (9000) 替换为 80,该站点将再次运行。
DocumentRoot 是一个 WordPress 站点。WordPress有可能重写端口号吗?