Apache Tomcat is an open source software implementation of the Java Servlet, JavaServer Pages, Java Expression Language and Java WebSocket technologies.
Apache Tomcated is powered many large sites and applications world wide, including but not limited to walmart.com, Alfresco, CiteSeerX. We can see a list of sites and applications PoweredBy page on Apache Tomcat wiki.
Updating Base System
This tutorial assumes that we have clean install of Ubuntu 15.10 Server. Before we install Apache Tomcat 8 and its prerequisites let's update our base system.
$ sudo apt-get update
$ sudo apt-get upgrade
Installing JDK 8
Now, let's install Java Development Kit 8. We will use the Oracle JDK instead of OpenJDK version of JDK 8.
Add the webupd8team ppa repository :
$ sudo add-apt-repository ppa:webupd8team/java
Press [ENTER] to continue or ctrl-c to cancel adding it
We need to press enter to continue adding the webupd8team PPA repository. The output is truncated above to show you only the most important part.
Let apt-get download and read the metadata of the new repository that we just added:
$ sudo apt-get update
Install JDK 8.
$ sudo apt-get -y install oracle-java8-installer
The -y option above will make you agree automatically with packages to be installed including dependencies. If you want to check what packages will be installed you can remove the -y option above.
## Install Tomcat 8 Web Admin
Tomcat 8 has a web based application to manage its own service and application running on top of it. It's not installed by default. We will install the ```tomcat8-admin``` package first before configuring a user for Tomcat 8 Web Admin. We can run the command below to install tomcat8 admin:
$ sudo apt-get -y install tomcat8-admin
## Install Tomcat 8 Documentation and Examples
If this is not a production machine, we can also install Tomcat 8 Documentation and an example package. We can use the commmand below to install documentation and example packages:
However, if this is a production machine, it's recommended to only install ```tomcat8``` and ```tomcat8-admin``` packages.
## Configure Admin User on Apache Tomcat 8
The Tomcat 8 web manager admin does not ship with default username and password. We have to add a username and put the user to the correct role.
There are four roles available that we can use. The available roles are:
* manager-gui — Access to the HTML interface.
* manager-status — Access to the "Server Status" page only.
* manager-script — Access to the tools-friendly plain text interface that is described in this document, and to the "Server Status" page.
* manager-jmx — Access to JMX proxy interface and to the "Server Status" page.
In this tutorial we will add the ```hostpresto``` user, and add this user to the ```manager-gui``` role.
Open ```/etc/tomcat8/tomcat-users.xml``` using a text editor. We will need open the text editor using the ```sudo``` command.
Find `````` at the end of the file, above this line, add the line :
Don't forget to change the password ```verysecretchangeme``` above.
Restart the tomcat8 service so the configuration changes are applied :
$ sudo service tomcat8 restart Now point your browser tohttp://:8080/manager/html```. It will show you a login prompt. We can login to the Tomcat Web Application Manager that we created above.
After logging in we can manage tomcat using the Tomcat Web Application Manager. On the top of the page we can see a list of applications deployed on this tomcat 8 server.
On the bottom, we can deploy a new application from this web manager by uploading a .war file.
We can also see the status of the server by clicking the Server Status link or open http://:8080/manager/status in your browser.
In this tutorial we learned how-to install Tomcat 8 on Ubuntu 15.10. We also installed Tomcat web application manager and configured the administrator level user with role manager-gui role.
Now you can start deploying your own applications on Tomcat 8. Have Fun!
Truth be told, it’s difficult for a web application that doesn’t have some kind of identification, even if you don’t see it as a security measure in and of itself. The Internet is a kind of lawless land, and even on free services like Google’s, authentication ensures that abuses will...
Although data persistence is almost always a fundamental element of applications, Node.js has no native integration with databases. Everything is delegated to third-party libraries to be included manually, in addition to the standard APIs. Although MongoDB and other non-relational databases are the most common choice with Node because if you...