You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Andre Rodrigues <ac...@yahoo.com.br> on 2009/10/05 15:19:00 UTC

[users@httpd] Direct access to nodes via single virtualhost

Hi,

I have an Apache that redirects via JkMount to two tomcat instances.

They are accessed through different virtualhosts:

<VirtualHost *:80>

ServerName appnode1

JkMount /app node1

</VirtualHost>

<VirtualHost *:80>

ServerName appnode2

JkMount /app node2

</VirtualHost>

I would like to make single virtualhost and access the two nodes, is it possible? 

Thanks,
André



      

---------------------------------------------------------------------
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] Direct access to nodes via single virtualhost

Posted by André Warnier <aw...@ice-sa.com>.
Andre Rodrigues wrote:
...
Have a look at
http://tomcat.apache.org/connectors-doc/reference/apache.html
at the very end, the section :
Using SetHandler and Environment Variables

By using a judicious combination of RewriteCond and RewriteRule, 
<Location>, SetEnv, SetEnvIf etc.., you can do just about anything you 
want, and very fine-tuned.


---------------------------------------------------------------------
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] Direct access to nodes via single virtualhost

Posted by Andre Rodrigues <ac...@yahoo.com.br>.
Folks,

 
I´m trying to make this:

<virtualhost *:443>

ServerName portal 

# Redirects to load balancer
JkMount /app dmb

# Test if wants to reach node1
RewriteCond %{REQUEST_URI}  ^/node1/app
RewriteRule ^/?(.*) /app

JkMount /app node1

</virtualhost>

I´ve setup a rewrite log and it matches the cond. 

172.29.26.184 - - [05/Oct/2009:11:16:50 --0300] [portal/sid#800d3468][rid#802a7a50/initial] (2) init rewrite engine with requested uri /node1/app
172.29.26.184 - - [05/Oct/2009:11:16:50 --0300] [portal/sid#800d3468][rid#802a7a50/initial] (3) applying pattern '^/?(.*)' to uri '/node1/app'
172.29.26.184 - - [05/Oct/2009:11:16:50 --0300] [portal/sid#800d3468][rid#802a7a50/initial] (4) RewriteCond: input='/node1/app' pattern='^/node1/app' => matched

But it returns Apache error 403 forbiden.

Any ideas?


Thanks,
André



----- Original Message ----
From: Krist van Besien <kr...@gmail.com>
To: users@httpd.apache.org
Sent: Monday, October 5, 2009 10:25:57 AM
Subject: Re: [users@httpd] Direct access to nodes via single virtualhost

On Mon, Oct 5, 2009 at 3:19 PM, Andre Rodrigues
<ac...@yahoo.com.br> wrote:

> I would like to make single virtualhost and access the two nodes, is it possible?

One way you could do this is to use plain http between your apache and
your tomcat (in stead of mod JK). That has two advantages:
1) Your configuration becomes a lot simpler.
2) You can do all kinds of nifty things with Rewrite Rules...

Krist

-- 
krist.vanbesien@gmail.com
krist@vanbesien.org
Bremgarten b. Bern, Switzerland
--
A: It reverses the normal flow of conversation.
Q: What's wrong with top-posting?
A: Top-posting.
Q: What's the biggest scourge on plain text email discussions?

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

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.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] Direct access to nodes via single virtualhost

Posted by Andre Rodrigues <ac...@yahoo.com.br>.
I´m stuck with it.

Can you help me?

 Thanks,
André



----- Original Message ----
From: André Warnier <aw...@ice-sa.com>
To: users@httpd.apache.org
Sent: Monday, October 5, 2009 11:31:48 AM
Subject: Re: [users@httpd] Direct access to nodes via single virtualhost

Krist van Besien wrote:
> On Mon, Oct 5, 2009 at 3:19 PM, Andre Rodrigues
> <ac...@yahoo.com.br> wrote:
> 
>> I would like to make single virtualhost and access the two nodes, is it possible?
> 
> One way you could do this is to use plain http between your apache and
> your tomcat (in stead of mod JK). That has two advantages:
> 1) Your configuration becomes a lot simpler.
> 2) You can do all kinds of nifty things with Rewrite Rules...
> 
1) I can't really see why
2) you can do with mod_jk as well as without.

And, there are some things you can do with mod_jk, and not with mod_proxy_http, such as authenticating a user in Apache httpd and passing this authentication to Tomcat, and like load-balancing and probably many others.
Basic thing : let's not be too quick here.



---------------------------------------------------------------------
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] Direct access to nodes via single virtualhost

Posted by André Warnier <aw...@ice-sa.com>.
Krist van Besien wrote:
> On Mon, Oct 5, 2009 at 3:19 PM, Andre Rodrigues
> <ac...@yahoo.com.br> wrote:
> 
>> I would like to make single virtualhost and access the two nodes, is it possible?
> 
> One way you could do this is to use plain http between your apache and
> your tomcat (in stead of mod JK). That has two advantages:
> 1) Your configuration becomes a lot simpler.
> 2) You can do all kinds of nifty things with Rewrite Rules...
> 
1) I can't really see why
2) you can do with mod_jk as well as without.

And, there are some things you can do with mod_jk, and not with 
mod_proxy_http, such as authenticating a user in Apache httpd and 
passing this authentication to Tomcat, and like load-balancing and 
probably many others.
Basic thing : let's not be too quick here.



---------------------------------------------------------------------
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] Direct access to nodes via single virtualhost

Posted by Krist van Besien <kr...@gmail.com>.
On Mon, Oct 5, 2009 at 3:19 PM, Andre Rodrigues
<ac...@yahoo.com.br> wrote:

> I would like to make single virtualhost and access the two nodes, is it possible?

One way you could do this is to use plain http between your apache and
your tomcat (in stead of mod JK). That has two advantages:
1) Your configuration becomes a lot simpler.
2) You can do all kinds of nifty things with Rewrite Rules...

Krist

-- 
krist.vanbesien@gmail.com
krist@vanbesien.org
Bremgarten b. Bern, Switzerland
--
A: It reverses the normal flow of conversation.
Q: What's wrong with top-posting?
A: Top-posting.
Q: What's the biggest scourge on plain text email discussions?

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