LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
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 06-18-2004, 01:40 PM   #1
ridertech
Member
 
Registered: Dec 2003
Location: Seattle, Washington
Distribution: Debian 'Sarge'
Posts: 85

Rep: Reputation: 15
Apache Virtual Host only hitting first entry, but why?


No matter which of the three address I hit, they all go to the first entry in my virtual hosts. What am I missing? Also, is it correct to use the <Directory> directive inside <VirtualHost>?

ServerName 888.888.888.888
NameVirtualHost *

# ADDRESS 1
<VirtualHost *>
ServerName *.address1.com
DocumentRoot /home/www-address1
</VirtualHost>

# ADDRESS 2
<VirtualHost *>
ServerName *.address2.net
DocumentRoot /home/www-address2
</VirtualHost>

# ADDRESS 3
<VirtualHost *>
ServerName *.address3.com
DocumentRoot /home/www-address3

<Directory "/home/www-address3">
Options None
AllowOverride None
Order allow,deny
Allow from all
</Directory>

<Directory "/home/www-address3/admin">
Options None
AllowOverride None
AuthType Basic
AuthName "Admin Privileges Required"
AuthUserFile /usr/local/apache2/passwd/.htpasswd
Require user admin
</Directory>

<Directory "/home/www-address3/share">
Options None
AllowOverride None
AuthType Basic
AuthName "Private Share Directory"
AuthUserFile /usr/local/apache2/passwd/.htpasswd
Require valid-user
</Directory>
</VirtualHost>
 
Old 06-18-2004, 02:06 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 65
I think the ServerName needs to be absolute - you can then use wildcards in the ServerAlias
 
Old 06-18-2004, 02:10 PM   #3
MadTurki
Member
 
Registered: Nov 2003
Location: Toronto
Distribution: RedHat 9, Mandrake 10, OS X
Posts: 114

Rep: Reputation: 15
Yeah - I believe that's right. You'd need to have dev.address1.com, ftp.address1.com etc. all listed as serate virtual hosts
 
Old 06-18-2004, 03:08 PM   #4
ridertech
Member
 
Registered: Dec 2003
Location: Seattle, Washington
Distribution: Debian 'Sarge'
Posts: 85

Original Poster
Rep: Reputation: 15
My ServerName is set to my static ip address (I used 888.888.888.888 so my ip is not posted). As for the second replay, I do want everything (*.address3.com ) going to each domain name. These are three different domains.
 
Old 06-18-2004, 03:23 PM   #5
ridertech
Member
 
Registered: Dec 2003
Location: Seattle, Washington
Distribution: Debian 'Sarge'
Posts: 85

Original Poster
Rep: Reputation: 15
Sorry, that worked...

ServerName www.address1.com
ServerAlias address1 *.address1.com

Not sure how I missed this...
http://httpd.apache.org/docs-2.0/vhosts/name-based.html
 
  


Reply


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 Virtual host eckertc1 Linux - Software 6 03-22-2005 10:58 PM
Virtual host and apache Samspeed Linux - General 8 08-06-2003 08:41 AM
apache virtual host navinc Linux - Software 10 05-22-2003 01:16 PM
apache virtual host mimi Linux - General 1 04-06-2002 06:11 AM


All times are GMT -5. The time now is 09:31 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration