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

    Subdomain, virtualhosts, and DNS, oh my

    This question has probably been answered in bits and pieces, but I searched and I couldn't find a satisfying answer. I have a domain with, and I host it on my own server. I also have a dynamic IP address, so I have my domain forwarded to (the 8080 is to get around the port-blocking). so I want to set up a couple subdomains. I want to go to /var/www/forums, to go to /var/www/family, etc. Can somebody just outline how to do all of this?

  2. #2
    Linux Newbie deek's Avatar
    Join Date
    Mar 2005
    Fort Wayne, IN
    I think you need to do two things:

    1) setup DNS records to correctly point the subdomains to your IP address
    2) create virtual host blocks that recognize the subdomains and point the the document roots to the appropriate subdirectories you are serving

    That is really all you should need to get that to work...
    Join the Open Source Revolution. Support GNU/Linux.

    Find me at:
    Registered GNU/Linux User #395777

  3. #3
    Yes, but how exactly do I do that?

  4. $spacer_open
  5. #4
    Super Moderator Roxoff's Avatar
    Join Date
    Aug 2005
    Nottingham, England
    What you want here is a Virtual Host under apache.

    Set up your DNS records for your server so that you have something like this in it:

    family IN CNAME
    forums IN CNAME

    Then enable virtual hosts in your apache config for and

    Apache will decide which website to serve based on the requested address, and you'll be able to provide as many websites as you like.

    Have a go at setting up your virtual hosts from the apache documentation, and if you get stuck, come back here. Good luck.
    Linux user #126863 - see

Posting Permissions

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