0

I am new to Apache. I have 2 jboss (Jboss as 7.1.1) and apache httpd server. I am using mod_cluster for load balancing. I wish to hide the jboss url from user and wish to show the user clean urls.

for e.g.

www.mydomain.com will be having my static website.
subdomain.mydomain.com should go to mydomain.com:8080/myapp
subdomain.mydomain.com/mypage.xhtml should go to mydomain.com:8080/myapp/mypage.xhtml
sumdomain.mydomain.com/myservice should go to mydomain.com:8080/myapp/service.xhtml?name=myservice

I have tried many things with no success. Can some one tell me if it is possible or not. And if possible what are the things I should do.

Thanks a lot in advance.

Regards.

mandar
  • 35
  • 1
  • 12

2 Answers2

0

The reason you cannot do what you want is because you are trying to solve two very different problem at once. Separate them and solve them individually.

Load balancer: I usually use Proxy for load balancer. For example

<Proxy balancer://mycluster>
BalancerMember http://wn1.seco.com
BalancerMember http://wn2.seco.com
</Proxy>
ProxyPass /test balancer://mycluster

Redirect and Forwarding: use mode_rewrite to redirect specific URLs to a different ones.

RewriteEngine  on
RewriteRule    "^/foo\.html$"  "/bar.html" [PT]
Arjang
  • 731
  • 1
  • 10
  • 19
  • Thanks @user2984552 for the prompt reply. Can I achieve what I want to achieve with Proxy instead of mod cluster. – mandar Aug 24 '15 at 04:11
  • Yes you can. Read more about what using apache for load balancer and how to use apache to redirect specific url pathern. And there is a difference between Redirect and Forwarding. Make sure you know which one you need. – Arjang Aug 24 '15 at 12:40
0

You can use mod_cluster and still stay in control of ProxyPass directives. E.g. CreateBalancers 1 and then you could create the Proxies yourself ProxyPassMatch ^/static/ ! ProxyPass / balancer://qacluster stickysession=JSESSIONID|jsessionid nofailover=on ProxyPassReverse / balancer://qacluster ProxyPreserveHost on. See the relevant docs for mod_cluster 1.3.1.Final.