Mailing List Archive

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 [ In reply to ]
check out my posting in:

Subject: Re: help with IP

Scott Miller


----- Original Message -----
From: "Joakim Back" <joakim.back@hbg.bonet.se>
To: <users@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 [ In reply to ]
nevermind - just re-read your post.

scott

----- Original Message -----
From: "Joakim Back" <joakim.back@hbg.bonet.se>
To: <users@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