簡體   English   中英

這個apache2配置有什么問題?

[英]What is wrong with this apache2 configuration?

我想設置apache2,以便wordpress網站通過端口80服務,而其他一些php網站通過端口8080服務。這是在運行Ubuntu 15.10的本地計算機上。

sites-available / 000-default.conf包含:

Listen 80
Listen 8080

NameVirtualHost *:8080
NameVirtualHost *:80


<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html
        <Directory /var/www/html/>
                AllowOverride All
        </Directory>
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

<VirtualHost *:8080>
        DocumentRoot /var/www/php-website

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

當我在瀏覽器中輸入localhost時 ,我得到了Wordpress網站。 當我輸入localhost:8080時 ,我得到了(重定向到)本地主機。

這有什么問題嗎? 我雖然第二個VirtualHost配置可能有問題,所以它默認為第一個,所以我更改了它們的順序。 然而,同樣的事情發生了。

可能是wordpress配置出現問題。 我認為wordpress使用wordpress地址(url)或網站地址(url)進行重定向(如果您在另一個域中)。 因此,您應該將此地址配置為localhost和localhost:8080。

這是一個瀏覽器問題。 Chrome和Firefox會自動將URL更改為localhost。 它適用於curl和隱身/私人模式。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM