Results 1 to 8 of 8

Thread: Apache2 virtual hosts help

  1. #1
    Join Date
    Jan 2011
    Beans
    13

    Apache2 virtual hosts help

    Im trying to configure a virtual host on my machine but all the tutorials I'm finding seem to be a bit fragmented and incomplete. I know that I have to do the configuring but I'm not exactly sure what to configure.

  2. #2
    Join Date
    Feb 2011
    Location
    Europe
    Beans
    82

    Re: Apache2 virtual hosts help

    And where exactly is the problem ?

    http://httpd.apache.org/docs/2.2/vhosts/

    Pretty much sums it up.
    There's no place like localhost

  3. #3
    Join Date
    Jan 2011
    Beans
    13

    Re: Apache2 virtual hosts help

    I dont understand this, theres too much on these pages with far too little instruction. I set up my httpd.conf the way it says, but when I restart apache it tells me that the documentroots do not exist.

  4. #4
    Join Date
    Jan 2011
    Beans
    13

    Re: Apache2 virtual hosts help

    Ok, I managed to get one of the virtual hosts working, but the other still doesn't work. The configuration files for each site are almost exactly the same with the only difference being the names, but the second site cannot be found.

  5. #5
    James78's Avatar
    James78 is offline Extra Foam Sugar Free Ubuntu
    Join Date
    Sep 2008
    Beans
    Hidden!

    Re: Apache2 virtual hosts help

    Please post your configuration files in [CODE] tags.

  6. #6
    Join Date
    Aug 2010
    Location
    hole
    Beans
    419
    Distro
    Ubuntu

    Re: Apache2 virtual hosts help


  7. #7
    Join Date
    Jan 2011
    Beans
    13

    Re: Apache2 virtual hosts help

    Quote Originally Posted by elico View Post
    I added this to my httpd.conf and it didnt work, then I found that I had to create a new configuration for each site which I set up like this:

    Code:
    <VirtualHost *:80>
    ServerName www.mywebsite.tk
    ServerAlias *mywebsite.tk
    DocumentRoot /var/www/mywebsite
    </VirtualHost>
    My other site is set up the same way with the changes made for the diferent sites and folders. The first one I set up works, but the second one doesnt.

  8. #8
    Join Date
    Mar 2006
    Location
    Williams Lake
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Apache2 virtual hosts help

    If you are using a recent version of Ubuntu server, http.conf isn't used anymore, the way it's done now is to set up your virtual web sites in /etc/apache2/sites-available, then when you have set it up to your liking, use a2ensite to enable the site.

    This page, may be more relevant

Tags for this Thread

Bookmarks

Posting Permissions

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