LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 04-03-2006, 04:04 AM   #1
john_f
LQ Newbie
 
Registered: Apr 2006
Posts: 1

Rep: Reputation: 0
virtual hosts problem - fedora core 4


hy,

i want to setup some virtual hosts on fedora (core 4), when i add the first host in httpd.conf localhost will go in the directory of my first virtual host (site1), same as the second host (site2)

what's the problem in the following lines



<VirtualHost *:80>
DocumentRoot var/www/html/site1
ServerName wwwsite1com (i cannot post links (
</VirtualHost>

<VirtualHost *:80>
DocumentRoot var/www/html/site2
ServerName wwwsite2com (same here (
</VirtualHost>

i already setup site1 and 2 in /etc/hosts


Thank you.
 
Old 04-04-2006, 12:28 AM   #2
WhatsHisName
Senior Member
 
Registered: Oct 2003
Location: /earth/usa/nj (UTC-5)
Distribution: RHEL, AltimaLinux, Rocky
Posts: 1,151

Rep: Reputation: 46
Didn’t understand the question, but I think you are probably puzzled by why all calls for localhost only load the first virtual host.

The first virtual host is the default for any requests that do not match subsequent virtual hosts’ ServerName or ServerAlias. Although most people usually define the ServerName for the first virtual host, you really don’t even need a ServerName for the first virtual host.

Since “localhost” does not match the second virtual host ServerName, then the default when you call for localhost is to load the first virtual host. You can use a ServerAlias alone or in combination with different ports to locally distinguish between the two sites.

For example, ServerAlias for the second virtual host could be defined as the LAN ip address of the system. Any local call to the LAN ip address would select the second virtual host, whereas localhost would default to the first virtual host.

Also, you should use a DirectoryIndex for each virtual host.
 
  


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
Postfix + Virtual Hosts Problem vbfischer Linux - Networking 1 03-30-2005 08:42 PM
virtual hosts problem newuser455 Linux - Software 0 08-29-2004 08:01 PM
Java Virtual Machine on Fedora Core 2 sonesay Fedora 3 06-06-2004 07:14 AM
IP based virtual hosts problem adm1329 Linux - Networking 4 03-11-2004 10:40 AM
Problem with Apache Virtual Hosts jaberwooky Linux - Software 4 09-23-2003 01:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora

All times are GMT -5. The time now is 06:50 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