-
1. Re: jbossportal with apache proxy help ! (accessing portal f
bvogt Oct 31, 2007 3:08 AM (in response to je.a.le)I would recommend to use mod_rewrite in conjunction with mod_proxy, which provide more flexibility for integration of content in the namespace of the virtual host. In order to reduce maintenance effort should think about using include files like in the example below.
Do you really need to use proxy-html?
http.conf:... ServerTokens Prod ... LoadModule rewrite_module modules/mod_rewrite.so LoadModule proxy_module modules/mod_proxy.so ... RewriteEngine on RewriteCond %{REQUEST_METHOD} ^(TRACE|LOCK|UNLOCK) RewriteRule .* - [F] ... <virtualhost 127.0.0.1> ServerName s1.org ... Include conf/s1.txt </virtualhost> <virtualhost 127.0.0.1> ServerName s2.org ... Include conf/s2.txt </virtualhost>
s1.txt:RewriteRule .* - [E=DEFAULT_PORTAL:s1] RewriteRule .* - [E=DEFAULT_PAGE:p1] Include conf/common_rules.txt
s2.txt:RewriteRule .* - [E=DEFAULT_PORTAL:s2] RewriteRule .* - [E=DEFAULT_PAGE:p2] Include conf/common_rules.txt
common_rules.txt:RewriteCond %{REQUEST_URI} ^/$ RewriteRule .* http://localhost:8080/portal/portal/%{ENV:DEFAULT_PORTAL}/%{ENV:DEFAULT_PAGE} [P] RewriteCond %{REQUEST_URI} ^$ RewriteRule .* http://localhost:8080/portal/portal/%{ENV:DEFAULT_PORTAL}/%{ENV:DEFAULT_PAGE} [P] RewriteCond %{REQUEST_URI} ^/portal RewriteRule ^/(.*)$ http://localhost:8080/$1 [P]
-
2. Re: jbossportal with apache proxy help ! (accessing portal f
je.a.le Oct 31, 2007 12:30 PM (in response to je.a.le)Thanks for your reply, it helps a lot; in a matter of fact it's the direction i were just looking at.
btw it seem you have to add "RewriteEngine on" in each virtualhost directive, even if set in http.conf ; else rewrite doesn't process.
second mistake of me was to remove proxy_http (instead of http_html which is no use anymore)... so if [P] directive doesn't work, check your config !
Your code work perfectly "out of the box" ; definitively something to add in the jbossportal faq/doc
THKS -
3. Re: jbossportal with apache proxy help ! (accessing portal f
je.a.le Nov 6, 2007 6:38 AM (in response to je.a.le)last word : in your apache vhost directive, don't forget :
ProxyPreserveHost On
else, when login into the portal you will fall into localhost:8080 url...
A+