How can I set up sub domains on a ubuntu machine

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.

Read More

For example:

 NameVirtualHost *:80
 <VirtualHost *:80>
      ServerAdmin webmaster@localhost
      ServerName mysite.com
      #We want to be able to access the web site using www.dev.example.com or dev.example.com
      ServerAlias 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>

But this method does not work with sub domains.
What do I have to change so all sub domains point to my installation as well?
I thank you in advance.

Related posts

Leave a Reply

2 comments

  1. Have you tried checking your entire httpd.conf syntax?
    “apachectl confitest”.

    Have you tried restarting apache?
    “sudo apachectl restart”.

    Have you tried checking if the subdomains really point to your server’s ip?
    – ping domain.com
    – ping subdomain.domain.com

    Check the ip’s. if they’re different, then you have to update your subdomains dns configurations.

    If that doesn’t help, it would be helpful if you could tell us what exactly happens when you get into the subdomain. Do you get a different output then expected? does it not even connect?