Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Sub Domains not working!

    I have tried to set up sub domains using Apache Webserver - Virtual Hosts, however I cannot get them to work.

    The directoryfor the sub-domian is different from the main domain does this make a difference?

    What could I try to get it to work?

    Thanks in Advance for any help!

  2. #2
    There are two parts to this. One by itself, however perfect, cannot work without the other.

    1: Configure Apache’s virtual host.

    Here is an example of the virtual host of "" and its sub domain ""

    <VirtualHost *:80>
        DocumentRoot /var/www/
    <VirtualHost *:80>
        DocumentRoot /var/www/
    Make DocumentRoot whatever you want. Mine is merely an example. The location is irrelevant as long as the path exists.

    2: Make an entry for this sub domain on the Domain Name Server for your domain name.

    I use Fedora 7’s GUI to configure mine, but all you need is to add an A record pointing “” to your server’s IP address. This A record is supposed to be in your “” zone file where the A record for “” is also located. If that is not familiar to you, please refer to google and many other resources on DNS servers.

    After searching google myself, I find that a CNAME record would also work if the IP address is the same. For more information visit:
    Subdomain Configuration - How To Setup A Sub Domain - WebsiteGear

    Or google:
    dns subdomain - Google Search

    And good luck.

  3. #3

    Apache virtual hosts

    I'm running several named virtual hosts using LAMP (Linux/Apache/MySQL/PHP). Some have the same directory and some have different directories. Make sure you have a Directory section or the virtual host document root.

  4. $spacer_open

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts