开发者

How Can I setup Subdomains un

开发者 https://www.devze.com 2023-02-28 09:43 出处:网络
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 ent

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>
0

精彩评论

暂无评论...
验证码 换一张
取 消