Download Jboss 7 from [jboss donwnload site] (http://www.jboss.org/jbossas/downloads)
Extract jboss in the proper place for example /usr/share
$ cd /usr/share
# tar xvf /home/xxxxx/Downloads/jboss-as-7.0.2.Final.tar.gz
Download the libs, [actually mod_cluster 1.1.3] (http://www.jboss.org/mod_cluster/downloads/1-1-3) Extract the libs
$ cd /home/xxxx/Downloads
$ mkdir ./mod_cluster_libs
$ cd ./mod_cluster_libs
$ tar xvf ./mod_cluster-1.1.3.Final-linux2-XXXX-so.tar.gz
$ rm ./
Copy libs (not all, mod_proxy_ajp.so, mod_proxy_http.so and mod_proxy.so NO) to apache modules dir (i.e /usr/lib/apache2/modules/)
# cp ./mod_advertise.so ./mod_manager.so ./mod_proxy_cluster.so ./mod_slotmem.so /usr/lib/apache2/modules/
Configure jboss Standalone mode to enable mod_cluster. Edit the standalone.xml
file in $JBOSS_HOME/standalone/configuration/standalone.xml
and add this two lines in their sections
Extension
<extension module="org.jboss.as.modcluster"/>
Subsystem
<subsystem xmlns="urn:jboss:domain:modcluster:1.0" />
Create two files in mods-available (/etc/apache2/mods-available
)
mod_cluster.load
LoadModule proxy_module /usr/lib/apache2/modules/mod_proxy.so
LoadModule proxy_http_module /usr/lib/apache2/modules/mod_proxy_http.so
LoadModule proxy_ajp_module /usr/lib/apache2/modules/mod_proxy_ajp.so
LoadModule slotmem_module /usr/lib/apache2/modules/mod_slotmem.so
LoadModule manager_module /usr/lib/apache2/modules/mod_manager.so
LoadModule proxy_cluster_module /usr/lib/apache2/modules/mod_proxy_cluster.so
LoadModule advertise_module /usr/lib/apache2/modules/mod_advertise.so
mod_cluster.conf
CreateBalancers 1
<IfModule manager_module>
Listen 127.0.0.1:6666
ManagerBalancerName mycluster
<VirtualHost 127.0.0.1:6666>
KeepAliveTimeout 300
MaxKeepAliveRequests 0
AdvertiseFrequency 5
ServerAdvertise On
<Location />
Order deny,allow
Allow from 127.0.0
</Location>
</VirtualHost>
</IfModule>
And enable the module
# a2enmod mod_cluster
Create a file (virtual host) for jboss in sites-available (/etc/apache2/sites-available
)
jboss
NameVirtualHost *:80
<VirtualHost *:80>
#ServerAdmin info@domain.de
ServerName jboss.mdiss.info
ServerAlias jboss.mdiss.info
ProxyPass / balancer://mycluster stickysession=JSESSIONID|jsessionid nofailover=On
ProxyPassReverse / balancer://mycluster
ProxyPreserveHost On
<Location />
Order deny,allow
Allow from All
</Location>
<Location /mod_cluster-manager>
SetHandler mod_cluster-manager
Order deny,allow
#Deny from all
Allow from 127.0.0
</Location>
</VirtualHost>
There is a problem with mod_cluster (in ubuntu?), needs the log directory in /etc/apache2
We can do two things, create the dir or create a symbloic link to /var/log/apache2
Creating the dir
# mkdir /etc/apache2/logs
Creating the symbolic link
#ln -s /var/log/apache2 /etc/apache2/logs
We download Jenkins from the [site] (http://mirrors.jenkins-ci.org/war/latest/jenkins.war) and we deploy the war.
Connect to the jboss admin console
# $JBOSS_HOME/bin/jboss-admin.sh
$ connect
$ deploy /home/xxxx/Downloads/jenkins.war
$ exit
Thanks for this good howto for mod_cluster. Unfortantly i don't get forwarded (when i access my servers url on port 80) to my jboss server (port 8080). Is there something else needed to get forwarded to jboss?