Results 1 to 3 of 3

Thread: Using a domain

  1. #1
    Join Date
    Mar 2010

    Using a domain

    Okay I have a Ubuntu Server that is correctly set up and has been working for awhile.

    It currently has a domain (Registered by GoDaddy) and it is used as the main.

    I just bought another domain (From GoDaddy) and I want it to connect to the same server but a different section to host a second site completely separate from the first.

    So this is how I want it to be setup:

    Domain1 = /var/www/
    Domain2 = /var/www/website2

    When I put Domain1 in the url like it will connect to /var/www/
    When I put Domain2 in the url like it will connect to /var/www/website2

    Is there a way to do that or a better way to do it?

  2. #2
    Join Date
    May 2009
    Vancouver, BC
    Ubuntu 10.10 Maverick Meerkat

    Re: Using a domain

    It sounds like you might want to use virtual hosting in Apache. Virtual hosting allows you to host multiple sites with one server by creating a separate configuration file for each site.

    Check out the Ubuntu server documentation and the Apache docs on virtual hosting for more info.

  3. #3
    Join Date
    Jan 2010
    Ubuntu 11.04 Natty Narwhal

    Re: Using a domain

    Basically, you just copy /etc/apache2/sites-available/default (ie. copy default and call it something like domain2), then edit the file and change the DocumentRoot and so on.

    Then run a2ensite default2 (or whatever you called it) to enable that host, then /etc/init.d/apache2 reload so Apache starts serving the new host.

Tags for this Thread


Posting Permissions

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