You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Joakim Back <jo...@hbg.bonet.se> on 2002/02/08 05:51:16 UTC

Virtual Hosts

Hello!

I'm having problems with virtual hosts and even though I've read much docs and talked to friends about it.. I can't solve it.
Background is this; I have one domain, lets call it www.domain1.com , and I want www.domain1.com and domain1.com to point towards /home/domain1/public_html/.
Also, I want all users to have their on subdomain, user.domain1.com, at /home/user/public_html/.
Third thing is that for backwards compability, I want www.domain2.mine.nu to work, as it was my "domain" for a long time and I've used it at many places.

I've tried many setups, but I can't seem to make it all work. Here's an example:

NameVirtualHost 194.236.236.151
NameVirtualHost 192.168.0.7

<VirtualHost 194.236.236.151 192.168.0.7>
    DocumentRoot /home/domain2/public_html/
    ServerName www.domain2.mine.nu
</VirtualHost>

<VirtualHost 194.236.236.151 192.168.0.7>
    ServerName www.%-3+.domain1.com
    ServerAlias *.%-3+.domain1.com
    VirtualDocumentRoot /home/%-3+/public_html/
</VirtualHost>

<VirtualHost _default_>
    DocumentRoot /home/satansrike/public_html/
</VirtualHost>

problem here is obviously that the first Vhost catches all the requests, which it isn't supposed to.
If I place the 2nd VHost on top, that one catches all requests (user.domain1.com works, but not www.domain1.com or domain1.com)

How do I solve this? Help is much appreciated.
UseCanonicalName is off, and works. mod_vhost_alias is running.

Best regards, Joakim Back


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


Re: Virtual Hosts

Posted by Scott Miller <sr...@interbel.net>.
nevermind - just re-read your post.

scott

----- Original Message -----
From: "Joakim Back" <jo...@hbg.bonet.se>
To: <us...@httpd.apache.org>
Sent: Thursday, February 07, 2002 9:51 PM
Subject: Virtual Hosts


Hello!

I'm having problems with virtual hosts and even though I've read much docs
and talked to friends about it.. I can't solve it.
Background is this; I have one domain, lets call it www.domain1.com , and I
want www.domain1.com and domain1.com to point towards
/home/domain1/public_html/.
Also, I want all users to have their on subdomain, user.domain1.com, at
/home/user/public_html/.
Third thing is that for backwards compability, I want www.domain2.mine.nu to
work, as it was my "domain" for a long time and I've used it at many places.

I've tried many setups, but I can't seem to make it all work. Here's an
example:

NameVirtualHost 194.236.236.151
NameVirtualHost 192.168.0.7

<VirtualHost 194.236.236.151 192.168.0.7>
    DocumentRoot /home/domain2/public_html/
    ServerName www.domain2.mine.nu
</VirtualHost>

<VirtualHost 194.236.236.151 192.168.0.7>
    ServerName www.%-3+.domain1.com
    ServerAlias *.%-3+.domain1.com
    VirtualDocumentRoot /home/%-3+/public_html/
</VirtualHost>

<VirtualHost _default_>
    DocumentRoot /home/satansrike/public_html/
</VirtualHost>

problem here is obviously that the first Vhost catches all the requests,
which it isn't supposed to.
If I place the 2nd VHost on top, that one catches all requests
(user.domain1.com works, but not www.domain1.com or domain1.com)

How do I solve this? Help is much appreciated.
UseCanonicalName is off, and works. mod_vhost_alias is running.

Best regards, Joakim Back


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


Re: Virtual Hosts

Posted by Scott Miller <sr...@interbel.net>.
check out my posting in:

Subject: Re: help with IP

Scott Miller


----- Original Message -----
From: "Joakim Back" <jo...@hbg.bonet.se>
To: <us...@httpd.apache.org>
Sent: Thursday, February 07, 2002 9:51 PM
Subject: Virtual Hosts


Hello!

I'm having problems with virtual hosts and even though I've read much docs
and talked to friends about it.. I can't solve it.
Background is this; I have one domain, lets call it www.domain1.com , and I
want www.domain1.com and domain1.com to point towards
/home/domain1/public_html/.
Also, I want all users to have their on subdomain, user.domain1.com, at
/home/user/public_html/.
Third thing is that for backwards compability, I want www.domain2.mine.nu to
work, as it was my "domain" for a long time and I've used it at many places.

I've tried many setups, but I can't seem to make it all work. Here's an
example:

NameVirtualHost 194.236.236.151
NameVirtualHost 192.168.0.7

<VirtualHost 194.236.236.151 192.168.0.7>
    DocumentRoot /home/domain2/public_html/
    ServerName www.domain2.mine.nu
</VirtualHost>

<VirtualHost 194.236.236.151 192.168.0.7>
    ServerName www.%-3+.domain1.com
    ServerAlias *.%-3+.domain1.com
    VirtualDocumentRoot /home/%-3+/public_html/
</VirtualHost>

<VirtualHost _default_>
    DocumentRoot /home/satansrike/public_html/
</VirtualHost>

problem here is obviously that the first Vhost catches all the requests,
which it isn't supposed to.
If I place the 2nd VHost on top, that one catches all requests
(user.domain1.com works, but not www.domain1.com or domain1.com)

How do I solve this? Help is much appreciated.
UseCanonicalName is off, and works. mod_vhost_alias is running.

Best regards, Joakim Back


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


Re: ReII: Virtual Hosts

Posted by Raquel Rice <ra...@thericehouse.net>.
On Fri, 8 Feb 2002 17:36:17 +0100
Joakim Back "Joakim Back" <jo...@hbg.bonet.se> wrote:

> Ok, I've gone back to my old settings which works fine:
> 
> NameVirtualHost 194.236.236.151
> NameVirtualHost 192.168.0.7
> 
> <VirtualHost 194.236.236.151 192.168.0.7>
>     DocumentRoot /home/domain1/public_html/
>     ServerName www.domain1.com
>     ServerAlias domain1.com
> </VirtualHost>
> 
> <VirtualHost 194.236.236.151 192.168.0.7>
>     DocumentRoot /home/back/public_html/
>     ServerName back.domain1.com
>     ServerAlias *.back.domain1.com
> </VirtualHost>
> 
> <VirtualHost 194.236.236.151 192.168.0.7>
>     DocumentRoot /home/back/public_html/
>     ServerName www.domain2.mine.nu
>     ServerAlias domain2.mine.nu
> </VirtualHost>
> 
> How do I add the feature to let all users have their own subdomain
> without messing my old stuff up?
> (the middle VirtualHost is a user, and could/should be replaced by
> the new Vhost)
> 
> I've spent a few hours trying to day, with no luck :[
> 
> Best Regards, Joakim Back

Would it work to do this?
 
<VirtualHost 194.236.236.151 192.168.0.7>
    DocumentRoot /home/back/*/public_html/
    ServerName back.domain1.com
    ServerAlias *.back.domain1.com
</VirtualHost>

Or would "UserDir" work better?

-- 
Raquel
============================================================
You don't get to choose how you're going to die.  Or when.  You can
only decide how you're going to live.  Now.
  --Joan Baez

                              
                              

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


Re3: Virtual Hosts : Possible?

Posted by Joakim Back <jo...@hbg.bonet.se>.
I've talked to a few people about my issue, and the oppinion is divided.. some claim that what I want to do is not possible (add so all users have their own subdomain @ domain1) while others say "It should work.." but they cannot say how.

To repeat myself briefly, UseCanonicalName is off, and works. mod_vhost_alias is running.

I tried adding the following 

<VirtualHost 194.236.236.151 192.168.0.7>
    ServerName www.%-3+.domain1.com
    ServerAlias *.%-3+.domain1.com
    VirtualDocumentRoot /home/%-3+/public_html/
</VirtualHost>

to my current setup:

NameVirtualHost 194.236.236.151
NameVirtualHost 192.168.0.7

<VirtualHost 194.236.236.151 192.168.0.7>
    DocumentRoot /home/satansrike/public_html/
    ServerName www.satansrike.com
    ServerAlias satansrike.com
</VirtualHost>

<VirtualHost 194.236.236.151 192.168.0.7>
    DocumentRoot /home/back/public_html/
    ServerName back.satansrike.com
</VirtualHost>

<VirtualHost 194.236.236.151 192.168.0.7>
    DocumentRoot /home/back/public_html/
    ServerName www.back.mine.nu
    ServerAlias back.mine.nu
</VirtualHost>

With no luck. Please help me out if you can
Best regards, Joakim Back

----- Original Message ----- 
From: "Joakim Back" <jo...@hbg.bonet.se>
To: <us...@httpd.apache.org>
Sent: Friday, February 08, 2002 5:36 PM
Subject: ReII: Virtual Hosts


Ok, I've gone back to my old settings which works fine:

NameVirtualHost 194.236.236.151
NameVirtualHost 192.168.0.7

<VirtualHost 194.236.236.151 192.168.0.7>
    DocumentRoot /home/domain1/public_html/
    ServerName www.domain1.com
    ServerAlias domain1.com
</VirtualHost>

<VirtualHost 194.236.236.151 192.168.0.7>
    DocumentRoot /home/back/public_html/
    ServerName back.domain1.com
    ServerAlias *.back.domain1.com
</VirtualHost>

<VirtualHost 194.236.236.151 192.168.0.7>
    DocumentRoot /home/back/public_html/
    ServerName www.domain2.mine.nu
    ServerAlias domain2.mine.nu
</VirtualHost>

How do I add the feature to let all users have their own subdomain without messing my old stuff up?
(the middle VirtualHost is a user, and could/should be replaced by the new Vhost)

I've spent a few hours trying to day, with no luck :[

Best Regards, Joakim Back

----- Original Message ----- 
From: "Joakim Back" <jo...@hbg.bonet.se>
To: <us...@httpd.apache.org>
Sent: Friday, February 08, 2002 5:51 AM
Subject: Virtual Hosts


Hello!

I'm having problems with virtual hosts and even though I've read much docs and talked to friends about it.. I can't solve it.
Background is this; I have one domain, lets call it www.domain1.com , and I want www.domain1.com and domain1.com to point towards /home/domain1/public_html/.
Also, I want all users to have their on subdomain, user.domain1.com, at /home/user/public_html/.
Third thing is that for backwards compability, I want www.domain2.mine.nu to work, as it was my "domain" for a long time and I've used it at many places.

I've tried many setups, but I can't seem to make it all work. Here's an example:

NameVirtualHost 194.236.236.151
NameVirtualHost 192.168.0.7

<VirtualHost 194.236.236.151 192.168.0.7>
    DocumentRoot /home/domain2/public_html/
    ServerName www.domain2.mine.nu
</VirtualHost>

<VirtualHost 194.236.236.151 192.168.0.7>
    ServerName www.%-3+.domain1.com
    ServerAlias *.%-3+.domain1.com
    VirtualDocumentRoot /home/%-3+/public_html/
</VirtualHost>

<VirtualHost _default_>
    DocumentRoot /home/satansrike/public_html/
</VirtualHost>

problem here is obviously that the first Vhost catches all the requests, which it isn't supposed to.
If I place the 2nd VHost on top, that one catches all requests (user.domain1.com works, but not www.domain1.com or domain1.com)

How do I solve this? Help is much appreciated.
UseCanonicalName is off, and works. mod_vhost_alias is running.

Best regards, Joakim Back


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


ReII: Virtual Hosts

Posted by Joakim Back <jo...@hbg.bonet.se>.
Ok, I've gone back to my old settings which works fine:

NameVirtualHost 194.236.236.151
NameVirtualHost 192.168.0.7

<VirtualHost 194.236.236.151 192.168.0.7>
    DocumentRoot /home/domain1/public_html/
    ServerName www.domain1.com
    ServerAlias domain1.com
</VirtualHost>

<VirtualHost 194.236.236.151 192.168.0.7>
    DocumentRoot /home/back/public_html/
    ServerName back.domain1.com
    ServerAlias *.back.domain1.com
</VirtualHost>

<VirtualHost 194.236.236.151 192.168.0.7>
    DocumentRoot /home/back/public_html/
    ServerName www.domain2.mine.nu
    ServerAlias domain2.mine.nu
</VirtualHost>

How do I add the feature to let all users have their own subdomain without messing my old stuff up?
(the middle VirtualHost is a user, and could/should be replaced by the new Vhost)

I've spent a few hours trying to day, with no luck :[

Best Regards, Joakim Back

----- Original Message ----- 
From: "Joakim Back" <jo...@hbg.bonet.se>
To: <us...@httpd.apache.org>
Sent: Friday, February 08, 2002 5:51 AM
Subject: Virtual Hosts


Hello!

I'm having problems with virtual hosts and even though I've read much docs and talked to friends about it.. I can't solve it.
Background is this; I have one domain, lets call it www.domain1.com , and I want www.domain1.com and domain1.com to point towards /home/domain1/public_html/.
Also, I want all users to have their on subdomain, user.domain1.com, at /home/user/public_html/.
Third thing is that for backwards compability, I want www.domain2.mine.nu to work, as it was my "domain" for a long time and I've used it at many places.

I've tried many setups, but I can't seem to make it all work. Here's an example:

NameVirtualHost 194.236.236.151
NameVirtualHost 192.168.0.7

<VirtualHost 194.236.236.151 192.168.0.7>
    DocumentRoot /home/domain2/public_html/
    ServerName www.domain2.mine.nu
</VirtualHost>

<VirtualHost 194.236.236.151 192.168.0.7>
    ServerName www.%-3+.domain1.com
    ServerAlias *.%-3+.domain1.com
    VirtualDocumentRoot /home/%-3+/public_html/
</VirtualHost>

<VirtualHost _default_>
    DocumentRoot /home/satansrike/public_html/
</VirtualHost>

problem here is obviously that the first Vhost catches all the requests, which it isn't supposed to.
If I place the 2nd VHost on top, that one catches all requests (user.domain1.com works, but not www.domain1.com or domain1.com)

How do I solve this? Help is much appreciated.
UseCanonicalName is off, and works. mod_vhost_alias is running.

Best regards, Joakim Back


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