Install Apache Tomcat di linux ubuntu

Dapet tugas kuliah bikin program JSP, mau buka windows males :D, terlanjur cinta sama linux.
Coba2 caranya install akhirnya ketemu juga :D
Pertama install sun-java dulu :

# apt-get install sun-java6-jdk


Kemudian download file apache tomcatnya

# wget http://apache.the.net.id/tomcat/tomcat-6/v6.0.16/bin/apache-tomcat-6.0.16.tar.gz

Extrak file apache tomcat
# tar -zxvf apache-tomcat-6.0.16.tar.gz

Pindahkan file hasil extrak ke direktory /usr/local/tomcat
#mv apache-tomcat-6.0.14 /usr/local/tomcat

edit file ~/.bashrc
#nano ~/.bashrc

isikan dengan kode berikut ini
export JAVA_HOME=/usr/lib/jvm/java-6-sun

kemudian buat file /etc/init.d/tomcat
#touch /etc/init.d/tomcat

edit file /etc/init.d/tomcat
#nano /etc/init.d/tomcat

isikan dengan kode berikut ini, copy paste aja :D
# Tomcat auto-start
#
# description: Auto-starts tomcat
# processname: tomcat
# pidfile: /var/run/tomcat.pid

export JAVA_HOME=/usr/lib/jvm/java-6-sun

case $1 in
start)
sh /usr/local/tomcat/bin/startup.sh
;;
stop)
sh /usr/local/tomcat/bin/shutdown.sh
;;
restart)
sh /usr/local/tomcat/bin/shutdown.sh
sh /usr/local/tomcat/bin/startup.sh
;;
esac
exit 0

Rubah permition file /etc/init.d/tomcat agar bisa di eksekusi

# chmod 755 /etc/init.d/tomcat

Buat shortcut file startupnya

# ln -s /etc/init.d/tomcat /etc/rc1.d/K99tomcat
# ln -s /etc/init.d/tomcat /etc/rc2.d/S99tomcat

untuk menjalanjan gunakan perintah ini

# /etc/init.d/tomcat


setelah itu buka browser "http://localhost:8080"
Beres dah :D
good luck

Comments :

0 comments to “Install Apache Tomcat di linux ubuntu”