Instalasi Tomcat 7 (Linux Ubuntu 10.10)

Untuk proses instalasi Tomcat 7 pada Ubuntu sebelumnya liat postingan saya untuk install JDK (Ubuntu 10). Hal ini diharuskan karena tomcat butuh jdk untuk prosesnya. Berikut adalah langkah-langkahnya :

  1. Download tomcat 7
  2. Ekstrak hasil download : tar xvzf apache-tomcat-7.0.8.tar.gz
  3. Pindahkan ke direktory /usr/share/tomcat7 : sudo mv apache-tomcat-7.0.8/ /usr/share/tomcat7
  4. Edit file catalina.sh : sudo gedit /usr/share/tomcat7/bin/catalina.sh
  5. Tambahkan pada baris pertama di file catalina.sh : JAVA_HOME=”/usr/local/jdk1.6.0_31″
    JRE_HOME=”/usr/local/jdk1.6.0_31/jre”
  6. Konfigurasi user tomcat : sudo gedit /usr/share/tomcat7/conf/tomcat-users.xml
  7. <?xml version='1.0' encoding='utf-8'?><tomcat-users>

    <role rolename="manager-gui"/>
    <role rolename="manager-script"/>
    <role rolename="manager"/>
    <role rolename="admin-gui"/>
    <role rolename="admin-script"/>
    <role rolename="admin"/> <user username="admin" password="admin" roles="manager-gui,admin-gui,manager,admin,manager-script,admin-script"/>
    </tomcat-users>

  8. Start server  : sudo /usr/share/tomcat7/bin/startup.sh
  9. Stop server : sudo /usr/share/tomcat7/bin/shutdown.sh
  10. Running dari browser : http://localhost:8080/
  11. Masuk ke tomcat manager http://localhost:8080/manager
  12. Selesai.

Tambahan :

Untuk Start tomcat pada ubuntu bisa pake perintah : sudo /usr/share/tomcat7/bin/startup.sh

Untuk Stop tomcat pada ubuntu bisa pake perintah : sudo /usr/share/tomcat7/bin/shutdown.sh

 

Setting automatic starting :

1.sudo gedit /etc/init.d/tomcat7

2. Tambahkan baris perintah dibawah ini :

# Tomcat auto-start
#
# description: Auto-starts tomcat
# processname: tomcat
# pidfile: /var/run/tomcat.pid

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

3.Ubah permission file yang tadi diedit : sudo chmod 755 /etc/init.d/tomcat7

4.Tambahkan link pada folder startup di linux :

sudo ln -s /etc/init.d/tomcat7 /etc/rc1.d/K99tomcat
sudo ln -s /etc/init.d/tomcat7 /etc/rc2.d/S99tomcat

5. sudo /etc/init.d/tomcat7 restart

 

Tomcat sudah siap digunakan….

 

Happy coding 🙂

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: