Thursday, July 9, 2009

using Tomcat in Ubuntu 9.04

I'm debugging my University's result processing software. The total software is written in JSP. I had to install Tomcat6 for this.Then I installed the package libapache2-mod-jk.
I gave the command in the terminal to confirm if the jk module is installed properly.
sudo ls /etc/apache2/mods-enabled/
The output was the following:
alias.conf autoindex.conf jk.load php5.conf
alias.load autoindex.load log_sql.load php5.load
auth_basic.load cgi.load log_sql_mysql.load setenvif.conf
authn_file.load deflate.conf log_sql_ssl.load setenvif.load
authz_default.load deflate.load mime.conf status.conf
authz_groupfile.load dir.conf mime.load status.load
authz_host.load dir.load negotiation.conf
authz_user.load env.load negotiation.load

We can see that jk.load is showed and we assume everything reqired to configure the server is okay.
Then I opened root window by pressing Alt+F2 with gksu nautilus command.I opened /etc/libapache2-mod-jk/workers.properties file and used these lines...

workers.tomcat_home=/usr/share/tomcat6
workers.java_home=/usr/lib/jvm/java-6-openjdk

Then I opened /usr/share/doc/libapache2-mod-jk/httpd_example_apache2.conf
copied the contents and paste it to the ending of /etc/apache2/apache2.conf
Then opened /etc/rc.local and added these two lines:

export JDK_HOME=/usr/lib/jvm/java-6-openjdk
export JAVA_HOME=/usr/lib/jvm/java-6-openjdk


Then I restarted apache2 and tomcat

sudo /etc/init.d/apache2 restart
sudo /usr/share/tomcat6/bin/./shutdown.sh
sudo /usr/share/tomcat6/bin/./startup.sh


Hosting place is /var/lib/tomcat6/webapps/ROOT/

No comments: