You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by pi...@goldfisch.at on 2002/11/09 00:40:25 UTC

[users@httpd] mix mod_vhost_alias and virtual hosts

In my apache2 I want to mix explicit VirtualHosts with mass-hosting
using the vhost-module.

Most domains are standard configs and I want to use the
VirtualDocumentRoot - Directive to satisfy them.

But some domains need more complex configs so I want to satisfy using
a <VirtualHost>-environment for each of them.

Problem now:

I've two domains defined in a <VirtualHost>-Environment. One works
fine, the other fails to work. Error-logs tell me that apache searches
this domain in the vhost-folder specified with VirtualDocumentRoot.

So my question: How do this two ways of virtual hosting
interfere. Which has priority ? Is it recommeneded to combine this two
methods ?

Additional I like to know if there is an easy way to activate SSL for
all request to port 443 and of course deactivate for all requests on
port 80, so I can use https for simple vhost-domains also. (I know
that it doesnt make much sense cause the certificates will not fit,
but I'd like to know)

thnx,
peter


-- 
mag. peter pilsl
IT-Consulting
tel: +43-699-1-3574035
fax: +43-699-4-3574035
pilsl@goldfisch.at

---------------------------------------------------------------------
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] Comparable list for Tomcat?

Posted by "Paul D. Bain" <pa...@pobox.com>.
At Friday 11/8/02 07:37 PM, you wrote:
>Is there an analogous list to this one for Tomcat users?  Or can I get some
>Apache/Tomcat integration help here?
>
>Ah, what the heck, everybody's got broadband, right?  I'll just take my
>chances and ask.  If there's a better place to ask this, just point me in
>the right direction, please.

Lee --

         I strongly suggest that you ask your Tomcat and Apache integration 
questions on this second mailing list: tomcat-user@jakarta.apache.org. Or 
better yet, search the archives therefor _first_, because these questions 
have arisen (and been well answered) many times on that list.

-- Paul Bain


---------------------------------------------------------------------
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] mix mod_vhost_alias and virtual hosts

Posted by pi...@goldfisch.at.
On Sat, Nov 09, 2002 at 01:02:35PM -0500, Joshua Slive wrote:
> 
> 
> On Sat, 9 Nov 2002 pilsl@goldfisch.at wrote:
> >  The VirtualDocumentRoot-Directive seems to override any DocumentRoot
> > in any <VirtualHost>-environment. Thats why my config wasnt working.
> >
> > I specified valid DocumentRoot in <VirtualHost> but the folder derived
> > from VirtualDocumentRoot did not exist. The only <VirtualHost> it was
> > working didnt have a DocumentRoot but an "Alias /" ...
> 
> That's why you need to stick VirtualDocumentRoot INSIDE a <VirtualHost>
> that only matches the hosts you want it applied to.
>

wow ! !tnx !! I didnt realize this in your first reply. This is just great. If
anyone else runs into a similar problem : here is the relevant part of
my current config

NameVirtualHost 62.99.149.139:80
NameVirtualHost 62.99.149.139:443
 
<VirtualHost 62.99.149.139:80>
  VirtualDocumentRoot /data/apache/%0:%p
  VirtualScriptAlias /data/apache/%0:%p/cgi-bin
</VirtualHost>
 
 
<VirtualHost 62.99.149.139:443>
  VirtualDocumentRoot /data/apache/%0:%p
  VirtualScriptAlias /data/apache/%0:%p/cgi-bin
  SSLEngine On
</VirtualHost>
 
<VirtualHost 62.99.149.139:80>
DocumentRoot /data/specialfolder
ServerName www.specialdomain.com
DirectoryIndex index.new.pl
    <Files ~ "\.pl$">
        SetHandler perl-script
        PerlResponseHandler ModPerl::Registry
        Options +ExecCGI
    </Files>
</VirtualHost>


and in /data/apache/ I list all the domains that dont have explicit
<VirtualHost>-sections in the config:

www.dom1.com:80
www.dom1.com:443
....
www.domxxx.com:80


I use the %p-notation cause several domains have different pages for
https and http.

thnx, peter

-- 
mag. peter pilsl
IT-Consulting
tel: +43-699-1-3574035
fax: +43-699-4-3574035
pilsl@goldfisch.at

---------------------------------------------------------------------
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] mix mod_vhost_alias and virtual hosts

Posted by Joshua Slive <jo...@slive.ca>.

On Sat, 9 Nov 2002 pilsl@goldfisch.at wrote:
>  The VirtualDocumentRoot-Directive seems to override any DocumentRoot
> in any <VirtualHost>-environment. Thats why my config wasnt working.
>
> I specified valid DocumentRoot in <VirtualHost> but the folder derived
> from VirtualDocumentRoot did not exist. The only <VirtualHost> it was
> working didnt have a DocumentRoot but an "Alias /" ...

That's why you need to stick VirtualDocumentRoot INSIDE a <VirtualHost>
that only matches the hosts you want it applied to.

> Lets say I've 200 "standard" domains (that dont need additional
> VirtualHost-settings) . I config all the 200 domains very easily by
> using a single VirtualDocumentRoot-Directive.  Now I want to allow
> https-access to this domains too. The only way I know by far is to
> create a <VirtualHost>-for each of this domains like:
>
> <VirtualHost x.x.x.x:443>
> Servername dom1.com
> SSLEngine On
Put the VirtualDocumentRoot directive in here.
> </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


Re: [users@httpd] mix mod_vhost_alias and virtual hosts

Posted by pi...@goldfisch.at.
On Fri, Nov 08, 2002 at 08:40:59PM -0500, Joshua Slive wrote:
> 
> Sure you can combine them.  You need to scope the mod_vhost_alias
> directives inside a <VirtualHost> section and make sure that <VirtualHost>
> only matches the hosts you want it to.  Since you haven't given us any
> specific information about your configuration, it is hard to tell either
> what exactly you are trying to do, or why it isn't working.
>

thnx.
 The VirtualDocumentRoot-Directive seems to override any DocumentRoot
in any <VirtualHost>-environment. Thats why my config wasnt working.

I specified valid DocumentRoot in <VirtualHost> but the folder derived
from VirtualDocumentRoot did not exist. The only <VirtualHost> it was
working didnt have a DocumentRoot but an "Alias /" ...

> > Additional I like to know if there is an easy way to activate SSL for
> > all request to port 443 and of course deactivate for all requests on
> > port 80, so I can use https for simple vhost-domains also. (I know
> > that it doesnt make much sense cause the certificates will not fit,
> > but I'd like to know)
> 
> Yes, the standard SSL config activates SSL only on port 443.  But you will
> need to create separate <VirtualHost> sections for the SSL hosts.
>


Lets say I've 200 "standard" domains (that dont need additional
VirtualHost-settings) . I config all the 200 domains very easily by
using a single VirtualDocumentRoot-Directive.  Now I want to allow
https-access to this domains too. The only way I know by far is to
create a <VirtualHost>-for each of this domains like:

<VirtualHost x.x.x.x:443>
Servername dom1.com
SSLEngine On
</VirtualHost>

<VirtualHost x.x.x.x:443>
Servername dom2.com
SSLEngine On
</VirtualHost>

...

<VirtualHost x.x.x.x:443>
Servername dom200.com
SSLEngine On
</VirtualHost>

and (assuming I use VirtualDocumentRoot %0:$p) the following vhost-folder

dom1.com:80
dom1.com:443 -symlink->dom1.com.80

....

dom200.com:80
dom200.com:443 -symlink->dom200.com.80


I hope there is an easier way to enable SSLEngine for the 443-hosts
automatically.

thnx a lot,
peter


-- 
mag. peter pilsl
IT-Consulting
tel: +43-699-1-3574035
fax: +43-699-4-3574035
pilsl@goldfisch.at

---------------------------------------------------------------------
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


Configuring multiple domains and web applications

Posted by Lee Grey <le...@mindspring.com>.
I have three different web applications I want to run on Tomcat.  Each needs
to run under its own domain, let's call them http://www.a.com,
http://www.b.com, and http://www.c.com.  I have a couple of Linux boxes to
configure in any way that makes sense.  At the moment, I only have
http://www.a.com running, and it runs on Apache and Tomcat in the same box.

Now, I'm ready to deploy http://www.b.com, which is a different application
entirely.  And I'm not sure how to go about this.  For example, do I need to
run a separate instance of Tomcat for this second application, or can I run
this web app on a different port under the same instance of Tomcat?  Or can
it even run on the same port, just with a different directory mapping?  And
how do I point http://www.b.com to the right Tomcat application from Apache?
I've already done this once with http://www.a.com, but I don't seem to have
enough information to extrapolate it for multiple Tomcat applications.

This is essentially the kind of issue a servlet-friendly web hosting service
would face.  How do I set up my servers to handle multiple applications and
domains?  In my case, I can trust all the apps, since they are all under my
control, but the overall objective is still the same.  One other factor is
that I'd like the ability to utilize multiple Linux boxes to spread the
load.  I don't necessarily have to do load-balancing.  Each box could be
dedicated for a particular domain and Tomcat application, if that is simpler
and easier.  But there's got to be an Apache server in front, distributing
the traffic to the appropriate Tomcat server.

I guess one thing that would be helpful would be sample Apache httpd.conf
and Tomcat server.xml files that allow for more than one Tomcat application.
Does anyone have such examples they'd be willing to share?

Any pointers, any answers, anything would be greatly appreciated!  BTW, I'm
currently running Red Hat 7.2, Apache 1.3, and Tomcat 4.

Thanks,
Lee Grey
Grey Matter
http://www.URLinOne.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


[users@httpd] Comparable list for Tomcat?

Posted by Lee Grey <le...@mindspring.com>.
Is there an analogous list to this one for Tomcat users?  Or can I get some
Apache/Tomcat integration help here?

Ah, what the heck, everybody's got broadband, right?  I'll just take my
chances and ask.  If there's a better place to ask this, just point me in
the right direction, please.

I have three different web applications I want to run on Tomcat.  Each needs
to run under its own domain, let's call them http://www.a.com,
http://www.b.com, and http://www.c.com.  I have a couple of Linux boxes to
configure in any way that makes sense.  At the moment, I only have
http://www.a.com running, and it runs on Apache and Tomcat in the same box.

Now, I'm ready to deploy http://www.b.com, which is a different application
entirely.  And I'm not sure how to go about this.  For example, do I need to
run a separate instance of Tomcat for this second application, or can I run
this web app on a different port under the same instance of Tomcat?  Or can
it even run on the same port, just with a different directory mapping?  And
how do I point http://www.b.com to the right Tomcat application from Apache?
I've already done this once with http://www.a.com, but I don't seem to have
enough information to extrapolate it for multiple Tomcat applications.

This is essentially the kind of issue a servlet-friendly web hosting service
would face.  How do I set up my servers to handle multiple applications and
domains?  In my case, I can trust all the apps, since they are all under my
control, but the overall objective is still the same.  One other factor is
that I'd like the ability to utilize multiple Linux boxes to spread the
load.  I don't necessarily have to do load-balancing.  Each box could be
dedicated for a particular domain and Tomcat application, if that is simpler
and easier.  But there's got to be an Apache server in front, distributing
the traffic to the appropriate Tomcat server.

I guess one thing that would be helpful would be sample Apache httpd.conf
and Tomcat server.xml files that allow for more than one Tomcat application.
Does anyone have such examples they'd be willing to share?

Any pointers, any answers, anything would be greatly appreciated!  BTW, I'm
currently running Red Hat 7.2, Apache 1.3, and Tomcat 4.

Thanks,
Lee Grey
Grey Matter
http://www.URLinOne.com


---------------------------------------------------------------------
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] mix mod_vhost_alias and virtual hosts

Posted by Joshua Slive <jo...@slive.ca>.
On Sat, 9 Nov 2002 pilsl@goldfisch.at wrote:

> In my apache2 I want to mix explicit VirtualHosts with mass-hosting
> using the vhost-module.
>
> Most domains are standard configs and I want to use the
> VirtualDocumentRoot - Directive to satisfy them.
>
> But some domains need more complex configs so I want to satisfy using
> a <VirtualHost>-environment for each of them.
>
> Problem now:
>
> I've two domains defined in a <VirtualHost>-Environment. One works
> fine, the other fails to work. Error-logs tell me that apache searches
> this domain in the vhost-folder specified with VirtualDocumentRoot.
>
> So my question: How do this two ways of virtual hosting
> interfere. Which has priority ? Is it recommeneded to combine this two
> methods ?

Sure you can combine them.  You need to scope the mod_vhost_alias
directives inside a <VirtualHost> section and make sure that <VirtualHost>
only matches the hosts you want it to.  Since you haven't given us any
specific information about your configuration, it is hard to tell either
what exactly you are trying to do, or why it isn't working.

> Additional I like to know if there is an easy way to activate SSL for
> all request to port 443 and of course deactivate for all requests on
> port 80, so I can use https for simple vhost-domains also. (I know
> that it doesnt make much sense cause the certificates will not fit,
> but I'd like to know)

Yes, the standard SSL config activates SSL only on port 443.  But you will
need to create separate <VirtualHost> sections for the SSL hosts.

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