httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nikolaus Schmitt" <n.schm...@scaet.de>
Subject Re: [users@httpd] Apache 1.3 VirtualHost in combo with rewrite
Date Thu, 02 Oct 2003 23:18:55 GMT
Hi René

some hints that may help You out:
The "default vhost" ist the literally 1st one within the apache
configuration file (configuration file hierarchy, if You use the "include"
directive). Thus, you should place the "_default_" vhost definition before
the www.foo.com block. You should change the term "_default_" to an ip
address or a resolvable hostname, indeed.

A hint to achieve (at least slightly) better performance:
Use "mod_jk" to couple Apache and Tomcat.

A hint to achieve much better performance:
Use Apache 2 and mod_jk2 to couple Apache and Tomcat and configure jk2 to
communicate using "shared memory".


Regards
Niko



----- Original Message -----
From: "René Clerc" <rene@clerc.nl>
To: <users@httpd.apache.org>
Sent: Thursday, October 02, 2003 2:08 PM
Subject: [users@httpd] Apache 1.3 VirtualHost in combo with rewrite


> Hi all,
>
> I have a problem which, AFAICT, can be solved using VirtualHosts, but
> I just haven't yet found out how ;-)
>
> We've built a Tomcat application that needs to be accessible through
> Apache (1.3).  If a user accesses, let's say, http://www.foo.com,
> Apache redirects the user to the Tomcat application (running on port
> 8080).  If a user tries to access http://www.bar.com, which resolves
> to the same IP address, the user will *not* be redirected, but served
> an error page.  In fact, I want this to happen when the user types
> anything *but* http://www.foo.com (including the direct IP address).
>
> The proxying and rewriting between Apache and Tomcat works great,
> using mod_rewrite and mod_proxy.  It's just these accessibility
> demands I recently came up with, that I can't get to work.  I've
> tried:
>
> <VirtualHost www.foo.com>
>     ServerName www.foo.com
>     ErrorDocument 500 /error500.html
>     RewriteEngine On
>     RewriteCond $1 !error
>     RewriteRule (.*) http://localhost:8080/$1 [P]
>     ProxyPassReverse / http://localhost:8080/
> </VirtualHost>
>
> <VirtualHost _default_:*>
>     DocumentRoot /var/www/html
> </VirtualHost>
>
> and probably most variations in order, changing _default_ to either the
> IP address or www.bar.com, but nothing worked:  currently, no matter
> what the user types in, (s)he's always redirected to the Tomcat
> application.
>
> Am I on the right track?  Does anybody know how to solve my problem?
>
> Thanks in advance,
>
> --
> René Clerc                      - (rene@clerc.nl) - PGP: 0x9ACE0AC7
>
> 228. If the hero claims he wishes to confess in public or to me
>      personally, I will remind him that a notarized deposition will
>      serve just as well.
>
> -"Peter Anspach's list of things to do as an Evil Overlord"
>
> ---------------------------------------------------------------------
> 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


Mime
View raw message