Forum Moderators: phranque

Message Too Old, No Replies

How can I set up sub domains on a ubuntu machine

         

ryy705

12:03 am on Apr 23, 2011 (gmt 0)

10+ Year Member



down vote favorite


Hello,

I am trying to setup WordPress multi site on my ubuntu 10.04 laptop with apache2.

For normal WordPress 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>

jdMorgan

5:42 pm on Apr 25, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You will need to declare each subdomain in your hsots file, AFAIK.

You do not need to include the "ServerName" in the "ServerAlias" list. It's redundant there.

Jim