LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-24-2008, 01:45 PM   #1
bunty82
LQ Newbie
 
Registered: Apr 2008
Location: New Delhi, India
Distribution: RHEL 5
Posts: 13

Rep: Reputation: 0
Apache(everything works ????????????Correct config


Hello,
I am posting this as a result of a long testing .I have tried configuring in a lot mannier ways, and end up failing or not getting the correct results.
Now
Let me explain few things i have done tell now and Apache worked.

I made a web page index.html in the default directory
/var/www/html/
added the following line in the /etc/hosts
192.168.0.10 www.google.com
and restarted the httpd.
when i entered the site name i get the web page correctly
This can be done by editing the last 8 lines of httpd.conf files.
what is this how the apache knows that the page is there and link this web address to it.

Now when it comes to hosting Virtual websites this method fails
so what i did as its reading the default address for one website.
I configurred the other one in a folder /virt
so that lines goes like this

</virtual>
document root /virt/
Servername www.yahoo.com
<virtual>

Assume that the virtual is the same lines in the httpd.conf i dont edit them
now problem is both the websites reads one index.html
not the other one
what is this
 
Old 07-24-2008, 03:20 PM   #2
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
http://httpd.apache.org/docs/2.0/vhosts/name-based.html

Code:
NameVirtualHost *:80

<VirtualHost *:80>
ServerName www.domain.tld
ServerAlias domain.tld *.domain.tld
DocumentRoot /www/domain
</VirtualHost>

<VirtualHost *:80>
ServerName www.otherdomain.tld
DocumentRoot /www/otherdomain
</VirtualHost>


Quote:
Originally Posted by bunty82
now problem is both the websites reads one index.html
not the other one
what is this
Quote:
As a consequence, the first listed virtual host is the default virtual host. The DocumentRoot from the main server will never be used when an IP address matches the NameVirtualHost directive. If you would like to have a special configuration for requests that do not match any particular virtual host, simply put that configuration in a <VirtualHost> container and list it first in the configuration file.

Last edited by farslayer; 07-24-2008 at 03:41 PM.
 
  


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
correct config of Hosts file ankycooper Red Hat 1 06-15-2006 01:07 AM
Networking issues/problems in 9.3 is my config correct? A6Quattro SUSE / openSUSE 9 07-12-2005 11:36 PM
Is my Exim4 config file correct?... need help. ExCIA Debian 9 05-09-2005 02:58 PM
CDRW drive works as Slave, but not as Master - jumpers are correct k4zau Linux - Hardware 4 06-01-2004 07:09 PM
Mandrake won't config. correct Darkangel90 Linux - Newbie 3 06-04-2002 06:21 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:13 AM.

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