2013-07-24 82 views
1

我在更改Apache2的默認端口進行偵聽時發生了一些問題,但它不起作用。在Debian系統上更改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> 

然後調整好自己的虛擬主機文件(它符號鏈接到網站啓用 - ):

<VirtualHost *:9000> 

    ServerAdmin [email protected] 
    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可以重寫端口號嗎?

回答

0

好的。

在我的問題結束時,我發現我搜索WordPress的障礙,我在頭兩分鐘內找到了我的答案。我將包括我的修補程序給其他人有相同的問題...

似乎WordPress的端口號有點時髦,並試圖刪除它們,如果WordPress地址或站點地址設置不符合端口你正試圖從中訪問它。

轉到WordPress管理面板中的設置 - >常規,並將端口:9000添加到您的WordPress Address (URL)Site Address (URL)值。

請記住在通過Apache更改端口之前執行此操作,否則您必須將其更改回以更新WordPress設置。請注意,當您將Apache重新配置到正確的端口時,您的WordPress將會變得眩目。