How to install tomcat 7 on ubuntu 14.04
This article helps you to install Tomcat 7 on ubuntu 14.04 . This article contains 2 methods of installation:- Manual and Apt-get. For tomcat 7 latest version , choose manual installation. Using Apt-get method, you will get repository version .
Install tomcat 7 on ubuntu 14.04
1. Manual installation ( Latest version).2. Apt-get installation.
Manual installation
Manual installation is highly recommended as you will get latest tomcat version .Step 1 » Install JDK 7 before installing tomcat.
krizna@leela:~$ sudo apt-get install openjdk-7-jdk
Step 2 » Download latest tomcat version ( Choose latest version from here –Download Apache Tomcat )
krizna@leela:~$ wget http://archive.apache.org/dist/tomcat/tomcat-7/v7.0.54/bin/apache-tomcat-7.0.54.tar.gz
Step 3 » Extract the package and move to /usr/local/ folder.
krizna@leela:~$ tar -xvf apache-tomcat-7.0.54.tar.gz
krizna@leela:~$ sudo mv apache-tomcat-7.0.54 /usr/local/
Step 4 » Choose username and password to manage tomcat and add to the file/usr/local/apache-tomcat-7.0.54/conf/tomcat-users.xml like the below. The below code must be within < tomcat-users > …. < /tomcat-users > tags.
1
2
3
|
<role rolename="manager-gui"/>
<role rolename="admin-gui"/>
<user username="krizna" password="password" roles="manager-gui,admin-gui"/>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
#!/bin/bash
export CATALINA_HOME=/usr/local/apache-tomcat-7.0.54
PATH=/sbin:/bin:/usr/sbin:/usr/bin
start() {
sh $CATALINA_HOME/bin/startup.sh
}
stop() {
sh $CATALINA_HOME/bin/shutdown.sh
}
case $1 in
start|stop) $1;;
restart) stop; start;;
*) echo "Run as $0 <start|stop|restart>"; exit 1;;
esac
|
krizna@leela:~$ sudo chmod 755 /etc/init.d/tomcat754
Step 7 » Now start the service .
krizna@leela:~$ sudo /etc/init.d/tomcat754 start
and issue the below command to start service automatically while booting.krizna@leela:~$ sudo update-rc.d tomcat754 defaults
Step 8 » Now open http://serve-IP:8080 in your browser, you could get the tomcat page like below. you can access admin pages after authentication .
That’s it . you got latest version installed.
Apt-get installation
This method is easy, but you will get repository version .Step 1 » Install JDK 7 before installing tomcat.
krizna@leela:~$ sudo apt-get install openjdk-7-jdk
Step 2 » Now Install tomcat 7 and other packages using the below command.
krizna@leela:~$ sudo apt-get install tomcat7 tomcat7-docs tomcat7-examples tomcat7-admin
Step 3 » Choose username and password to manage tomcat and add to/etc/tomcat7/tomcat-users.xml file like the below.
1
2
3
|
<role rolename="manager-gui"/>
<role rolename="admin-gui"/>
<user username="krizna" password="password" roles="manager-gui,admin-gui"/>
|
Step 4 » Restart the service .
krizna@leela:~$ sudo /etc/init.d/tomcat7 restart
Step 5 » Now open http://serve-IP:8080 in your browser, you will get the tomcat repository version.
Okay that’s it.. now you will get repository version which is lower than released version .
All the best
Tidak ada komentar:
Posting Komentar