Re: Virtual Hosts in 2.2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Jay,

I think you should change '*.haderach.net' to 'www.haderach.net'
What you are trying to accomplish with the '*.haderach.net' should actually be done with something called a dns wildcard. The dns wilcard is a standard setup for most hosting companies these days I believe, otherwise you might need to have your network admin setup the wildcard entry for you. Basically it just points all sub-domains back to the root domain unless explicitly stated otherwise.

Then, you can use Apache vhost config to route traffic once it arrives at your server based on the requesting URL (as you did with the 'mail.haderach.net' vhost entry).

If you don't have access to your dns setup you can also accomplish this using mod_rewrite (assuming you have mod_rewrite). Just put an entry in a .htaccess at the docroot like so:

RewriteEngine On

RewriteCond %{HTTP_HOST} mail.haderach.net
RewriteRule ^(.*)$ /usr/local/www/squirrelmail/$1

This is just an example and would probably vary a little based on your setup.
You can read more at: http://httpd.apache.org/docs/2.0/misc/rewriteguide.html

Good Luck!



----- Original Message ----
From: Jay Chandler <chandler.lists@xxxxxxxxxxx>
To: users@xxxxxxxxxxxxxxxx
Sent: Monday, January 29, 2007 8:10:08 PM
Subject: Virtual Hosts in 2.2

Attempting to set up my virtual hosts so that www.haderach.net goes to
the normal DocumentRoot, and mail.haderach.net goes to my squirrelmail
folder.

Contents of extra/httpd-vhost.conf:

NameVirtualHost *:80

<VirtualHost *:80>
ServerName www.haderach.net
ServerAlias haderach.net *.haderach.net
DocumentRoot /usr/local/www/apache22/data
</VirtualHost>

<VirtualHost *:80>
ServerName mail.haderach.net
DocumentRoot /usr/local/www/squirrelmail
</VirtualHost>

Yet, my a request to mail.haderach.net goes to the documentroot for Apache.

Help?

--
Jay Chandler
Network Administrator, Chapman University
714.628.7249 / chandler@xxxxxxxxxxx
Today's Excuse: Secretary sent chain letter to all 5000 employees.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx




Access over 1 million songs - Yahoo! Music Unlimited.
[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux