LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-09-2001, 11:12 PM   #1
fed007
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 192.168.1.3


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

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 "www.orbitalsoftware.ca" and direct the request to the path I put in the DocumentRoot directive in the Virtual Host Definition.



<VirtualHost 192.168.1.3>
ServerName www.orbitalsoftware.ca
ServerAlias orbitalsoftware.ca *.orbitalsoftware.ca
DocumentRoot /home/httpd/orbital
ServerAdmin hostmaster@orbitalsoftware.ca
</VirtualHost>



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, 02:58 AM   #2
jharris
Senior Member
 
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243

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

cheers

Jamie...
 
Old 08-10-2001, 11:10 AM   #3
fed007
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 .....


127.0.0.1 Fed007
192.168.1.3 www.orbitalsoftware.ca
192.168.1.3 www.softwarejedi.com



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 192.168.1.3 ???

If I enter "www.softwarejedi.com" I get the default documentroot which is /home/httpd/html

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

Thanks
 
Old 08-10-2001, 11:22 AM   #4
fed007
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
/home/httpd/orbital

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, 01:15 PM   #5
fed007
LQ Newbie
 
Registered: Aug 2001
Location: Canada
Distribution: RedHat
Posts: 14

Original Poster
Rep: Reputation: 0
Talking

I have isolated the problem,

For some reason there were conf files in two directories

/etc/httpd/conf/

and

/usr/local/apache/conf/

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.

NOW I SETUP THE DNS!!!

This is fun - I will have to get back to some real work soon.
 
Old 12-01-2002, 09:05 PM   #6
disayas
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, 04:46 AM   #7
peter_robb
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 04:47 AM.
 
  


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:43 PM.

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