Monday, April 25, 2011

Setting up Apache2 and Tomcat6 on Ubuntu 10.04

This is a short post on setting up Apache2 and Tomcat6

Install Java
apt-get -y install python-software-properties
add-apt-repository "deb http://archive.canonical.com/ lucid partner"
apt-get update
apt-get install -y sun-java6-jdk

Install tomcat6 with apache2 support
apt-get -y install tomcat6 libtcnative-1 libapache2-mod-jk

Setup worker.properties with the following values:
workers.tomcat_home=/usr/share/tomcat6
workers.java_home=/usr/lib/jvm/java-6-sun
nano /etc/libapache2-mod-jk/workers.properties

Modify /etc/apache2/mods-available/jk.load
cat >>/etc/apache2/mods-available/jk.load <<EOF
JkWorkersFile /etc/libapache2-mod-jk/workers.properties
JkLogFile /var/log/apache2/mod_jk.log
JkLogLevel error
EOF

Setup virtual host
cat >/etc/apache2/sites-available/test.henyo.com <<EOF
NameVirtualHost *
<VirtualHost *>
        ServerName test.henyo.com
        JkMount /* ajp13_worker
</VirtualHost>
EOF

Activate the site
a2ensite test.henyo.com

Setup tomcat for ajp13
nano /etc/tomcat6/server.xml

Restart tomcat and apache2
service tomcat6 restart
service apache2 restart

Install and configure UFW
apt-get install ufw
ufw allow ssh
ufw allow http
ufw enable

Install and configure Tripwire
apt-get install tripwire

I hope you found the post useful. You can subscribe via email or subscribe via a feed reader to get relevant updates from this blog. Have a nice day.

1 comment: