Link to home
Start Free TrialLog in
Avatar of Bigflicks
Bigflicks

asked on

document root on a backend server. like JBOSS

Hi
i have 2 server
1.apache2.0
2.jboss 4.0.2

access flow
apache <---> jkmodule <----> jbosss

so like other i have jkmodule
virtual hosting is on apache server

VirtualHost *:80>
ServerAdmin admin@aaa.com
DocumentRoot /usr/website_root/
DirectoryIndex index.jsp
ServerName aaa.xxx.com
RedirectPermanent /index.html http://aaa.xxx.com/xxx/faces/jsp/index.jsp

i also i have redirection to the backend server from the index server which works fine.

but when i do this the browser shows me the url

http://aaa.xxx.com/xxx/faces/jsp/index.jsp   on just hitting http://aaa.xxx.com

here /xxx/faces/jsp/index.jsp are on backend server (that is JBOSS)

can i in the apache virtual host change.. the documentroot and documentindex point to the backend sever like this

documentroot "/xxx/faces/jsp"
documentindex index.jsp

doing this the home page would not get redirect to a long url but like
http://aaa.xxx.com/xxx/faces/jsp/index.jsp

but would be http://aaa.xxx.com/

regards
Pramod Shetty




Avatar of ahoffmann
ahoffmann
Flag of Germany image

RedirectPermanent is a 30x redirect send to the browser, but if I understand your quiestion you want your apache to be a tranparent proxy, then you need to use mod_proxy.
Avatar of Bigflicks
Bigflicks

ASKER

hi ahoffmann
if you can give me an example it would be really helpful
like what directive i use and how can i do it.
thanks in advance
# using mod_proxy, something like

ProxyPass / http://backend.tld/xxx/faces/jsp/index.jsp
ProxyPassReverse / http://backend.tld/xxx/faces/jsp/index.jsp
i am very new to apache
so what ur saying here is
VirtualHost *:80>
ServerAdmin admin@aaa.com
DocumentRoot /usr/website_root/
DirectoryIndex index.jsp
ServerName aaa.xxx.com
RedirectPermanent /index.html http://aaa.xxx.com/xxx/faces/jsp/index.jsp
ProxyPass / http://backend.tld/xxx/faces/jsp/index.jsp
ProxyPassReverse / http://backend.tld/xxx/faces/jsp/index.jsp
</vurtualhsot>
Can i directly add the lines to virtualhost.
one more think to let you know
aaa.xxx.com domain is on apache server
backend server is access via ip and port number like htpp://10.9.9.9:8080/xxx/.....
so do i have to add
proxypass / http://aaa.xxx.com/xxx/faces/jsp/index.jsp
or proxypass / http://10.9.9.9:8080/xxx/faces/jsp/index.jsp

 
RedirectPermanent is not what you want, you need to remove it

> Can i directly add the lines to virtualhost.
yes (but mod_proxy needs to be loaded)

> so do i have to add
you need to use the FQDN or IP of your backend server as accessable by the apache web server
if do not what to use mod_proxy can i just do it using mod_rewrite
 
you can use the P flag for RewriteRule, but that passes the request to mod_proxy which then needs to be enabled, obviously
but why do ineed to pass it to proxy server ...when mod_rewrite do the same what proxy would do..
i can directly pass to the backend server with the [P] flag which works same as the proxy as per my understanding..
 
ASKER CERTIFIED SOLUTION
Avatar of ahoffmann
ahoffmann
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The issue was resolved using mod_rewrite rule. and [P ] flasgs