You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Joe Rice <ri...@water-melon.net> on 2003/04/11 22:08:31 UTC

[users@httpd] Q: subdomains and DocumentRoot question


Hi,
   I have a situation where i would like to change the
the DocumentRoot of all mail.* for all the virtual domains to
point to the same place.
I've managed by doing the following:


NameVirtualHost *
UseCanonicalName Off

<VirtualHost mail.host1.com>
    DocumentRoot /var/www/html/squirrelmail
</VirtualHost>

<VirtualHost *>
    ServerAlias *.host1.com
    ServerName host1.com
    DocumentRoot /www/host1.com
</VirtualHost>


Is there a way to do this with out doubling the size if my httpd.conf?
I've tried with mod_rewrite but didn't have any luck.

Any help would be appreciated.

Thanks,
joe

---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Q: subdomains and DocumentRoot question

Posted by Joe Rice <ri...@water-melon.net>.
Joshua Slive(joshua@slive.ca)@Fri, Apr 11, 2003 at 04:15:31PM -0400:
> 
> On Fri, 11 Apr 2003, Joe Rice wrote:
> 
> > the DocumentRoot of all mail.* for all the virtual domains to
> > point to the same place.
> 
> What do you mean by "doubling the size if my httpd.conf?"


instead of one <VirtualHost> directive for each domain, i now have to have two.
one for the mail and one for the main DocumentRoot of the vhost.  I just tried what 
you suggested below and it works perfect.  it accomplished both of my objectives; 
minimal config
and keeps the domain (i had played with redirect).

Thanks!

joe


> 
> Have you tried this:
> 
> >
> > NameVirtualHost *
> 
> > <VirtualHost *>
>       ServerName mail.host1.com
>       ServerAlias mail.*
> >     DocumentRoot /var/www/html/squirrelmail
> > </VirtualHost>
> >
> > <VirtualHost *>
> >     ServerAlias *.host1.com
> >     ServerName host1.com
> >     DocumentRoot /www/host1.com
> > </VirtualHost>
> 
> Joshua.
> 
> ---------------------------------------------------------------------
> 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@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 

---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Q: subdomains and DocumentRoot question

Posted by Joshua Slive <jo...@slive.ca>.
On Fri, 11 Apr 2003, Joe Rice wrote:

> the DocumentRoot of all mail.* for all the virtual domains to
> point to the same place.

What do you mean by "doubling the size if my httpd.conf?"

Have you tried this:

>
> NameVirtualHost *

> <VirtualHost *>
      ServerName mail.host1.com
      ServerAlias mail.*
>     DocumentRoot /var/www/html/squirrelmail
> </VirtualHost>
>
> <VirtualHost *>
>     ServerAlias *.host1.com
>     ServerName host1.com
>     DocumentRoot /www/host1.com
> </VirtualHost>

Joshua.

---------------------------------------------------------------------
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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org