Multiple domains with JBoss + Apache
fabio.bozzo Feb 7, 2013 6:17 PMI'm running my web applications in such environment:
- Apache2
- mod_jk
- JBoss 7.1
I have one application having "/" as context root in jboss-web.xml and the other one having "/myapp".
Apache's sites-enabled configuration is really similar for both:
<VirtualHost *:80>
ServerAdmin admin@xxx.xxx
ServerName www.myapp.it
DocumentRoot /var/www/myapp
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/myapp>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</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>
In JBoss configuration/standalone.xml I have:
<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="otherapp">
<alias name="localhost"/>
<alias name="otherapp.it"/>
</virtual-server>
<virtual-server name="myapp" enable-welcome-root="false" default-web-module="myapp">
<alias name="www.myapp.it"/>
</virtual-server>
</subsystem>
And obviously:
<socket-binding name="ajp" port="8009"/>
Finally, worker.properties:
worker.list=ajp13
worker.ajp13.type=ajp13
worker.ajp13.host=localhost
worker.ajp13.port=8009
worker.ajp13.lbfactor=50
worker.ajp13.cachesize=10
worker.ajp13.cache_timeout=600
worker.ajp13.socket_keepalive=1
worker.ajp13.socket_timeout=300
Why does "www.myapp.it" result in a 404 not found?