Install Tomcat 8 on ubuntu 15.04 Server
Sponsored Link
Apache Tomcat includes tools for configuration and management, but can also be configured by editing XML configuration files
Install Tomcat 8 on ubuntu 15.04 Server
From the terminal and run the following command
sudo apt-get install tomcat8 tomcat8-docs tomcat8-admin tomcat8-examples
Answer yes at the prompt to install tomcat. This will install Tomcat and its dependencies, such as Java, and it will also create the tomcat8 user. It also starts Tomcat with its default settings.
the default splash page by going to your domain or IP address followed by :8080 in a web browser:
http://your_ip_address:8080
You will see a splash page that says "It works!", in addition to other information.
Tomcat Web Management Interface
To enable admin web based features you need to do the following,Edit /etc/tomcat8/tomcat-users.xml file
sudo vi /etc/tomcat8/tomcat-users.xml
Add the following lines
<role rolename="manager"/>
<role rolename="admin"/>
<user name="admin" password="secret_password" roles="manager,admin"/>
Save and exit the file
You should be able to see your manage page here http://your_ip_goes_here:8080/manager/html.Log in with the name and password you just set in /etc/tomcat8/tomcat-users.xml
In /var/lib/tomcat8 directory you should see these directories conf, logs, webapps, work.Webapps is where your servlets will go ( or at least a xml file that points to them)
As a test download this war file http://simple.souther.us/SimpleServlet.war and then use the tomcat management page and select war file to deploy ( in teh deploy section) to upload this file to your server.Optionally just wget http://simple.souther.us/SimpleServlet.war directly to the webapps folder tomcat should recognize the war file and expand it with everything you need.
Now browse to http://serverip:8080/SimpleServlet/
Change tomcat server to run on port 80
If you want to Change tomcat server to run on port 80 follow this procedure
You need to edit the /etc/tomcat8/server.xml file
sudo vi /etc/tomcat8/server.xml
Now replace the part that says Connector port=”8080″ with Connector port=”80″
Save and exit the file
Restart tomcat server with the following command
sudo /etc/init.d/tomcat8 restart