11/1/13 How To Install Apache Tomcat on Ubuntu 12.04 | DigitalOcean https://www.digitalocean.com/community/articles/how-to-install-apache-tomcat-on-ubuntu-12-04 1/15 Pricing Features Customers Help & Community Sign Up Login Help & Community Articles & Tutorials Questions Chat Blog Try this tutorial on an SSD cloud server. Your email Create a password Get Started! Includes 512MB RAM, 20GB SSD Disk, and 1TB Transfer for $5/mo! Learn more . Related Articles Ubuntu How To Create a SSL Certificate on Apache for Ubuntu 12.04 How To Install Git on Ubuntu 12.04 How To Set Up Apache Virtual Hosts on Ubuntu 12.04 LTS How To Install Linux, Apache, MySQL, PHP (LAMP) stack on Ubuntu How To Install Ruby on Rails on Ubuntu 12.04 LTS (Precise Pangolin) with RVM Apache How To Create a SSL Certificate on Apache for Ubuntu 12.04 How To Install Linux, Apache, MySQL, PHP (LAMP) stack On CentOS 6 How To Install Linux, Apache, MySQL, PHP (LAMP) stack On CentOS 6 How To Set Up Apache Virtual Hosts on Ubuntu 12.04 LTS How To Install Linux, Apache, MySQL, PHP (LAMP) stack on Ubuntu Miscellaneous How To Install and Use Memcache on Ubuntu 12.04 How To Launch Your Site on a New Ubuntu 12.04 Server with LAMP, SFTP, and DNS How To Set Up a Minecraft Server on Linux How To Install Apache Tomcat on Ubuntu 12.04 How To Install Git on Ubuntu 12.04 How To Install Apache Tomcat on Ubuntu 12.04
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
11/1/13 How To Install Apache Tomcat on Ubuntu 12.04 | DigitalOcean
Includes 512MB RAM, 20GB SSD Disk, and 1TB Transfer for $5/mo! Learn more.
Related Articles
Ubuntu
How To Create a SSL Certificate on Apache for Ubuntu 12.04
How To Install Git on Ubuntu 12.04How To Set Up Apache Virtual Hosts on Ubuntu 12.04 LTSHow To Install Linux, Apache, MySQL, PHP (LAMP) stack on UbuntuHow To Install Ruby on Rails on Ubuntu 12.04 LTS (Precise Pangolin) with RVM
Apache
How To Create a SSL Certificate on Apache for Ubuntu 12.04How To Install Linux, Apache, MySQL, PHP (LAMP) stack On CentOS 6
How To Install Linux, Apache, MySQL, PHP (LAMP) stack On CentOS 6
How To Set Up Apache Virtual Hosts on Ubuntu 12.04 LTSHow To Install Linux, Apache, MySQL, PHP (LAMP) stack on Ubuntu
Miscellaneous
How To Install and Use Memcache on Ubuntu 12.04
How To Launch Your Site on a New Ubuntu 12.04 Server with LAMP, SFTP, and DNSHow To Set Up a Minecraft Server on Linux
Apache tomcat is a Java based application server released by the Apache Software Foundation. It is a web server and a servletcontainer for Java web applications.
Setup
Tomcat installation on a virtual private server is relatively easy. Its single required dependency is Java and this tutorial will include a
step on how to install that platform.
You do need to have a user with sudo privileges for this tutorial.
Step One—Install Tomcat
The most recent version of Tomcat is 7, and it can be easily downloaded through apt-get or from the Apache Tomcat site.
You can download it through apt-get by typing:
sudo apt-get install tomcat7
To download tomcat from their site, copy the link for the tar.gz package under the “Core” section and begin the download. You
will get a link that originates from one of Apache’s many mirrors, making the command look mostly like this (although coming from
In order to start Tomcat, we need to add it as an environment variable in the /.bashrc file.
sudo nano ~/.bashrc
You can add this information to the end of the file:
export JAVA_HOME=/usr/lib/jvm/default-java
export CATALINA_HOME=~/path/to/tomcat
Save and exit out of .bashrc. You can make the changes effective by restarting the bashrc file.
. ~/.bashrc
Step Four—RESULTS
Tomcat is now installed and configured on our virtual servers. However, it is not yet activated. The final step is to activate Tomcatby running its startup script:
$CATALINA_HOME/bin/startup.sh
Once that runs, Tomcat is up and ready on port 8080.
You can visually verify that Tomcat is working by accessing your server page at your_IP_address:8080.
It should look like this
By Etel Sverdlov
Try this tutorial on an SSD cloud server.
Your email Create a password Get Started!
Includes 512MB RAM, 20GB SSD Disk, and 1TB Transfer for $5/mo! Learn more.
Comments
maiconfz
Thanks!!! IT WORKS!!!
Obs.: You can access the server at [droplet-ip]:8080/ .It's not at localhost:8080/
However, trying :8080 I got "It worked" for tomcat - so something is coming up. So creating and fixing the
sudo mkdir /usr/share/tomcat6/logs
sudo chown user:user /usr/share/tomcat6/logs
Allowed me to
cat /usr/share/tomcat6/logs/catalina.out
and a few other directories needed creating and populating which got me into more issues.
Then :8080 didn't even respond.
Seems to me that the basic configuration doesn't pull in a working demo - and I'm going back to thinking about it.
I do have a working/production tomcat6 environment on another virtual machine (that some one else setup), and got a version upand going on a local Ubuntu 11.x some time ago - so going to figure out what I did in those environments.
11/1/13 How To Install Apache Tomcat on Ubuntu 12.04 | DigitalOcean
Now you can install your common libraries in the lib/ subdirectory and deploy your webapps in the webapps/ subdirectory. No
webapps are deployed by default.
Now you need to shutdown tomcat and start my-instance
my-instance/bin/shutdown.sh
my-instance/bin/startup.sh
>>>
HOWEVER, I haven't figured out to do production - get it into the startup $CATALINA_BASE.
This is supposed to be easy through the "manager" package - but it hasn't worked for me. Maybe because I don't have the right
directory IDs for tomcat6.
Posted March 20th, 2013 00:46
neilh20
Oops - in the previous post - I'm using tomcat6 because of a legacy app working in it - so every thing should reference tomcat6,
and my guess is tomcat7 works the same.
Posted March 20th, 2013 00:47
manpreetsidhu88m
Its good........... But where is script to start Apache automatically at Boot time?
Posted June 12th, 2013 06:11
Kamal Nasser
@manpreetsidhu88m do /etc/init.d/tomcat and /etc/init.d/apache2 exist?
Posted June 12th, 2013 08:34
2011chandan
I have installed tomcat7. I followed the exact process described here for installation. I have given the path in bash asCATALINA_HOME=/usr/share/tomcat7. But when I'm trying to activate it using CATALINA_HOME/bin/startup.sh, it throws
No such file or directory found.
11/1/13 How To Install Apache Tomcat on Ubuntu 12.04 | DigitalOcean
I dont get a page like from a picture. I get "It works If you're seeing this page via a web browser, it means you've setup Tomcat
successfully. Congratulations!.." but how do I get the page from the picture?
Posted July 25th, 2013 08:23
Kamal Nasser
@bezvezemail: This article is a bit old so Tomcat might have changed their default page.
Posted July 25th, 2013 12:00
sandeepbhandari1
Could you pls. also share what if we are unable to start tomcat due to some problem and still want to know the version of tomcatby being offline. I have searched a lot for this but not able to find a way. The other tutorial also proved of some help but still
looking for answer.
Posted July 29th, 2013 07:09
Kamal Nasser
@sandeepbhandari1: "apt-cache show tomcat7" should show you the package's version.