Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 08-10-2001, 12:12 AM   #1
LQ Newbie
Registered: Aug 2001
Location: Canada
Distribution: RedHat
Posts: 14

Rep: Reputation: 0
Apache Virtual Host Question

I have Linux RedHat 6.2 running on a box on my LAN.

I have installed Apache 1.3.20.

(I am concerned with getting this working on my LAN only right now)

I can hit my server through localhost. The IP for my server is

I have added a virtual host to my httpd.conf file, the host I want to add is called and I also edited my /etc/hosts file as such:

The problem is that when I type the URL into the browser I go straight to the Default Apache Web Server Page that you get if your installation was successful. Ideally the server should see that URL "" and direct the request to the path I put in the DocumentRoot directive in the Virtual Host Definition.

ServerAlias *
DocumentRoot /home/httpd/orbital

Now I would like to give you one more piece of information that may or may not be useful in helping me isolate what is happening.

When I view my httpd.conf for the 'Main Server Configuration' I have listed as DocumentRoot "/home/httpd/html"
That directory contains an index.html file that states the Apache Install was successful.

I decided to change that index.htm so that it only rendered a few words (because of another problem entirely - IE had garbled characters - yet to solve that one) and I went back to the browser and called up the URL to localhost. Much to my amazement I did not get my recently edited index.htm file instead I received the same "Apache Install Successful..." page.

I find this bizarre because the default page for the server is not /home/httpd/html/ as listed in the conf file.

I will be eagerly awaiting help on this one.

Thank-you in advance

Neil Jubinville
Old 08-10-2001, 03:58 AM   #2
Senior Member
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243

Rep: Reputation: 46
At the risk of stating the obvious did you remember to restart Apache after making the change?


Old 08-10-2001, 12:10 PM   #3
LQ Newbie
Registered: Aug 2001
Location: Canada
Distribution: RedHat
Posts: 14

Original Poster
Rep: Reputation: 0
Apache vhost

Yes, everytime I have made changes to the httpd.conf file I have restarted apache. (Stop then start)

Do I have to set an alias somewhere?

I also found out that Apache does something interesting:

In my hosts file ..... Fed007

If I enter "www.orbital...." into my browser I will get into the specified vhost directory. Which is /home/httpd/orbital

I also get to the same place if I enter ???

If I enter "" I get the default documentroot which is /home/httpd/html

For some reason Apache is reading is the host info but only for the "" and defaulting the other.

Old 08-10-2001, 12:22 PM   #4
LQ Newbie
Registered: Aug 2001
Location: Canada
Distribution: RedHat
Posts: 14

Original Poster
Rep: Reputation: 0
Another Note

I have identified now that every virtual host is is going to the

This has been confirmed by my URL entries in the browser

Does this have anything to do with my hosts file?
Old 08-10-2001, 02:15 PM   #5
LQ Newbie
Registered: Aug 2001
Location: Canada
Distribution: RedHat
Posts: 14

Original Poster
Rep: Reputation: 0

I have isolated the problem,

For some reason there were conf files in two directories




It seems as though Apache knows that both locations can exist because during my testing I realized that Apache loaded the
/usr/.... then the /etc/....

at any rate I removed the etc/conf files and everything works as I would expect.


This is fun - I will have to get back to some real work soon.
Old 12-01-2002, 10:05 PM   #6
LQ Newbie
Registered: Nov 2002
Location: US
Distribution: Redhat *.0
Posts: 18

Rep: Reputation: 0
Greetings Friend:

I am having the same problem and was wondering if you had to manually enter the hosts names in yout /etc/hosts file?
Old 12-02-2002, 05:46 AM   #7
Senior Member
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 48
Yes if you don't have a dns server to check the ip number against, especially during testing before the true dns is setup.

In the file /etc/nsswitch.conf, there is a line
hosts: files dns

This says go to /etc/hosts before looking for a dns server.

Last edited by peter_robb; 12-02-2002 at 05:47 AM.


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
Apache - Name virtual host tisource Linux - Networking 5 03-03-2006 03:52 AM
Apache 2.0 Virtual Host? w0lfeyes Linux - Networking 1 05-03-2004 04:09 PM
Apache virtual host question fredws Linux - Software 1 01-22-2004 01:12 PM
Apache: Virtual Host Config question rajanr Linux - Software 5 08-30-2003 01:41 PM
apache virtual host mimi Linux - General 1 04-06-2002 06:11 AM

All times are GMT -5. The time now is 11:37 PM.

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