How to install apache tomcat in linux!
SLVIKI
10:01 PM
0
Hello viewers, in this blog post I'll guide you through the installation process of apache tomcat in linux os. currently I'm using ubuntu 14.04 as my operating system.
Before installing the apache tomcat you need to install java which I'm not going to explain in this post. But to check your current version of java and the path use the following codes in ubuntu terminal.
echo $JAVA_HOME
this code will show your current java version
echo $PATH
this will show your current java installation path.
Installing apache tomcat step by step
1. download apache tomcat into the Downloads folder. (use the following link to download the latest version)
http://mirrors.gigenet.com/apache/tomcat/tomcat-8/v8.0.21/bin/apache-tomcat-8.0.21.zip
or to download latest version follow these steps.
go to tomcat.apache.org --> then click on the latest version under download --> then download the zip file under the binary distribution and under the core field.
2. After downloading go to the downloads folder and unzip the apache zip file
cd Downloads/
unzip apache-tomcat-8.0.21.zip
3. After unzip is done go to the usr folder and make a new directory inside that folder called "apache".
cd /usr/
sudo mkdir apache
(give your password if needed)
4. Then go to the home folder and then back to the Downloads folder and then copy the unziped apache file to the apache folder that we created before.
cd
cd Downloads/
sudo mv apache-tomcat-8.0.21 /usr/apache/
5. Then go to the apache folder and check if the files copied successfully.
cd /usr/apache/
ls
6. then open up the profile document
sudo gedit /etc/profile
7. Copy the following codes to that document as shown bellow.
export APACHE_HOME=/usr/apache/apache-tomcat-8.0.21
export PATH=${PATH}:${APACHE_HOME}/bin
then save the document and close it and use the following code to apply the changes
source /etc/profile
8. Check if it is done correctly by using the following codes
echo $APACHE_HOME
echo $PATH
9. Then use the following codes accordingly
cd /usr/apache/apache-tomcat-8.0.21/bin/
sudo chmod +x *
10. Then start the server by using this code
./startup.sh
and you can end the server by this code.
./shutdown.sh
after starting the server go to your browser and then type
localhost:8080
or
127.0.0.1:8080
you should get a page like this if you installed it correctly.
Manage app account configuring apache tomcat step by step
1. cd /usr/apache/apache-tomcat-8.0.21/conf/
2. sudo gedit tomcat-users.xml
3. copy and paste the code as shown bellow
<role rolename="manager-gui"/>
<user username="tomcat" password="tomcat" roles="manager-gui"/>
then save and exit.
4. cd /usr/apache/apache-tomcat-8.0.21/bin/
5. ./shutdown.sh
6. bash startup.sh
7. at the browser go to the address localhost:8080
8. then click on manage app and then give the username and password as tomcat.
enjoy!
if you have any questions feel free to ask!
No comments