LinuxQuestions.org
Help answer threads with 0 replies.
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 06-18-2004, 12: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, 01:06 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
I think the ServerName needs to be absolute - you can then use wildcards in the ServerAlias
 
Old 06-18-2004, 01: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, 02: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, 02: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



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 Virtual host eckertc1 Linux - Software 6 03-22-2005 09:58 PM
Virtual host and apache Samspeed Linux - General 8 08-06-2003 07:41 AM
apache virtual host navinc Linux - Software 10 05-22-2003 12:16 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 03:29 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