0
我想在我的ubuntu 10.04筆記本電腦上用apache2設置WordPress多站點。我如何設置子域名
對於普通的WordPress安裝,在/ etc/hosts文件中創建一個條目,並在/ etc/apace2/sites-available目錄中創建虛擬主機條目,然後將其鏈接到啓用了站點的目錄。 對於子域,我添加了服務器別名指令。但那沒有做任何事情。我有語法錯誤嗎?請指教。
NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName mysite.com
ServerAlias mysite.com *.mysite.com
DocumentRoot /home/myhome/Sites/public_html/mysite.com
#if using awstats
ScriptAlias /awstats/ /usr/lib/cgi-bin/
#we want specific log file for this server
CustomLog /var/log/apache2/example.com-access.log combined
</VirtualHost>
@Jesse Bunch:重啓apache會給出如下警告:'NameVirtualHost *:80沒有VirtualHosts'。我刪除了mysite.com並將* .mysite.com更改爲www.mysite.com。即使這是工作。很困惑。 – ryy705 2011-04-23 01:29:43
你可以發佈你的整個httpd.conf文件嗎? – 2011-04-23 01:32:44
@Jesse Bunch:Ubuntu上的Apache不依賴於httpd.conf。它使用apache2.conf,其中包含httpd.conf和/ etc/apache2/sites-enabled目錄中的所有內容。您應該在/ etc/apache2/sites-available目錄中設置虛擬主機,然後在/ etc/apache2/sites-enabled direcory中爲它們創建一個軟鏈接。我的機器上的httpd.conf文件是空白的。這裏是apache2.conf文件:[link] http://pastebin.com/0TjKYxx1 [/ link]。我創建了一個名爲mysite.com.conf的文件,它粘貼在我的第一篇文章中。 – ryy705 2011-04-23 01:48:55