- Required: java
- Install Apache
sudo apt-get install apache2
- This will install in /etc/apache2
- Download & install mod_jk
sudo apt-get install libapache2-mod-jk
- Download tomcat https://tomcat.apache.org/download-80.cgi
- Extract it and create folders server
- Change port in file server.xml to avoid duplicate pore
<Server port="9005" shutdown="SHUTDOWN">
<Connector port="9009" protocol="AJP/1.3" redirectPort="9443"/>
- Edit file /etc/libapache2-mod-jk/workers.properties to
worker.list=loadbalancer,status worker.server1.port=8009 worker.server1.host=localhost worker.server1.type=ajp13 worker.server2.port=9009 worker.server2.host=localhost worker.server2.type=ajp13 worker.server1.lbfactor=1 worker.server2.lbfactor=1 worker.loadbalancer.type=lb worker.loadbalancer.balance_workers=server1,server2 worker.status.type=status
- Add the following to the Apache configurations located in /etc/apache2/sites-enabled/000-default.conf
JkMount /status status JkMount /* loadbalancer
- Build & deploy project
- Run servers tomcat
- Access: http://localhost/loadbalance
- Then access http://localhost/status to follow handle