View the Most Wanted LQ Wiki articles.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 09-24-2007, 07:06 AM   #1
LQ Newbie
Registered: Mar 2007
Posts: 14

Rep: Reputation: 0
Ubuntu Linux Virtual hosting

The implementation of apache2 in ubuntu does not match implementation in other distributions, or as described at the documention sites.

I'm trying to figure out how to add multiple virtual hosts to the apache2 configuration. Here's what I understand...

1.) There is no more httpd.conf. It exists, but is empty. Everything is done in apache2.conf.

2.) Virtual sites are added in /etc/apache2/sites-available/ where a configuration file (NameVirtualHost directive) is placed for each host, including the default host (named default). Then, a symbolic link is added to /etc/apache2/sites-enabled/, pointing to each file in /sites-available.

3) To fully enable a virtual host, a symbolic link has to point to the file. That is created by "sudo a2ensite [I]nameofnewsite[I]. This is per the ubuntu documentation for apache2, which differs from the apache2 documentation, even though it also points to apache's documentation.

That is, I have followed the instructions in the Ubuntu HTTPD - Apache2 Web Server documentation and I still can't get the virtual hosting to work.

Apache2 is working fine. I have unbuntu 6.06 running on this machine. It has several web pages. My fixed IP address is and all of my multiple DNS entries point to that address. (I actually own a whole range of addresses, but I kept it simple for the moment because of a possible router issue.) points to and is now the default web page. It comes up fine. That is, I call up my friend and say, look at the web site _______ (there are several), and apache shows the web site. The DEFAULT web site is now cthia, and it shows up fine out on the external world. also points to the same external IP and my router successfully sends a port 80 request to the same internal machine. But ... cthia comes up. loads the correct page. Ditto for /mikhailbadenov or /primumnonnocere which are two other web pages.

I copied the file /etc/apache2/sites-available/default file and made modifications. The default file now points to cthia. I modified the copies and have one for laxlinux and one for mikhailbadenov and one for primumnonnocere.

I enabled laxlinux and mikhailbadenov, as per the instructions in the ubuntu documentation with sudo a2ensite laxlinux (etc) for each site. Each site's file in /sites-available is appropriately copied over to sites-enabled and I restarted apache2. There is a ServerName statement in each file and a DirectoryRoot statement in each file, pointing to the respective directories. The RedirectMatch statement in each file is modified to reflect the appropriate virtual host.

When I reboot apache2, I get a statement:
Name or service not known: Cannot resolve host name laxlinux (or www.laxlinux) -- Ignoring!

If I try to put these directives in apache2.conf, it chokes and gives me a FAIL message.

I'm missing something, somewhere.

Anyone have any clue what I might be forgetting?


Thanks, in advance.

Old 09-25-2007, 01:59 PM   #2
LQ Newbie
Registered: Mar 2007
Posts: 14

Original Poster
Rep: Reputation: 0
More data, Possible Cause:

The Ubuntu Linux Bible section on virtual hosting tells you uncomment "line 16" in the default configuration file in /etc/apache2/sites-available and then also tells you to copy the file and use slightly different versions of that file for each of the virtual hosts.

Line 16 is the RedirectMatch directive. It might be the issue.


apache2, configuration, ubuntu606, virtual host

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Virtual Hosting bstuart Linux - Software 1 06-19-2005 12:26 PM
Virtual Hosting? nr5 Linux - Software 10 06-03-2005 02:30 PM
Virtual hosting... id10t Linux - Networking 4 02-02-2004 06:43 PM
Virtual Hosting - what does it actually do? gevers1 Linux - General 3 02-01-2004 10:28 AM
Virtual Hosting marson Linux - General 2 12-28-2000 09:14 PM

All times are GMT -5. The time now is 04:29 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration