Friday, 15 April 2011

Problems with JBoss and ProxyPass Apache directive -



Problems with JBoss and ProxyPass Apache directive -

my jboss 7.1 (standalone.xml) configured this:

<subsystem xmlns="urn:jboss:domain:web:1.1" default-virtual-server="default-host" native="false"> <connector name="http" protocol="http/1.1" scheme="http" socket-binding="http"/> <connector name="ajp" protocol="ajp/1.3" scheme="http" socket-binding="ajp"/> <virtual-server name="default-host" enable-welcome-root="false" default-web-module="mydefaultapp"> <alias name="localhost"/> <alias name="www.mydefaultapp.it"/> </virtual-server> <virtual-server name="secondapp" enable-welcome-root="false" default-web-module="secondapp"> <alias name="www.secondapp.com"/> </virtual-server> </subsystem>

'mydefaultapp' defines "/" context-root in jboss-web.xml file , running mod_jk:

<virtualhost *:80> servername www.mydefaultapp.it documentroot /var/www/mydefaultapp <directory /> options followsymlinks allowoverride none </directory> <directory /var/www/mydefaultapp> options indexes followsymlinks multiviews allowoverride none order allow,deny allow </directory> scriptalias /cgi-bin/ /usr/lib/cgi-bin/ <directory "/usr/lib/cgi-bin"> allowoverride none options +execcgi -multiviews +symlinksifownermatch order allow,deny allow </directory> errorlog ${apache_log_dir}/error.log loglevel warn customlog ${apache_log_dir}/access.log combined setenvif request_uri "/foto/*" no-jk jkmount / ajp13 jkmount /* ajp13 </virtualhost>

now have 'secondapp' war doesn't define context-root assumes '/secondapp'. if seek deploy '/' context-root error:

install: failed process phase install of deployment "foo.war" caused by: org.jboss.msc.service.duplicateserviceexception: service jboss.web.deployment.default-host./.realm registered

if deploy '/secondapp' context-root nil works. www.secondapp.com ends in 404 not found error.

a possible solution using http proxy configuration:

<virtualhost *:80> servername www.secondapp.com proxypass / http://localhost:8080/secondapp/ proxypassreverse / http://localhost:8080/secondapp/ </virtualhost>

which seems working but... can't access jsf resources (i maintain getting login form, there's problem security)

can please suggest me right configuration having 2 domains, 2 wars jboss 7.1 + apache2 + mod_jk. remember first 1 has "/" context-root while sec 1 has "/secondapp"

finally made mod_jk! it's tag, it's confusing. blogged that: http://fabiobozzo.wordpress.com/2013/02/25/multiple-web-applications-with-jboss-and-apache/

apache jboss jboss7.x mod-proxy mod-jk

No comments:

Post a Comment