I am trying to setup WordPress multi site on my ubuntu 10.04 laptop with apache2.
For normal WordPres开发者_运维知识库s installs in create an entry in the /etc/hosts file and create virtual hosts entry in /etc/apace2/sites-available directory and then soft link it to sites-enabled directory. For sub domains, I added the server alias directive. But that is not doing anything. Do I have a syntax error. Please advice.
NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin webmaster@localhost
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>
You must restart or reload Apache after making changes to your Apache configuration file. What does it tell you when you run:
sudo /etc/init.d/apache2 restart
Does it show you any error messages? That will tell you if you have a syntax error. For your reference, here is an example of using ServerAlias
that I have on my own server. Note the difference between mine and yours. Maybe you should remove the initial mysite.com
part and just leave *.mysite.com
?
Let me know if that helps.
<VirtualHost *:80>
ServerAdmin jesse@domain.com
ServerAlias www.domain.com
DocumentRoot /var/www/vhosts/domain.com/httpdocs
ServerName domain.com
ErrorLog /var/log/domain.com-error_log
CustomLog /var/log/domain.com-access_log common
</VirtualHost>
精彩评论