Skip to content

Instantly share code, notes, and snippets.

@alexislucena
Last active March 19, 2019 17:52
Show Gist options
  • Save alexislucena/89a046dc747123faf4496fb946c1fe79 to your computer and use it in GitHub Desktop.
Save alexislucena/89a046dc747123faf4496fb946c1fe79 to your computer and use it in GitHub Desktop.
Tomcat 8 basic installation on Ubuntu 16.04 with Java installed

Login as root

$ sudo su

Install updates

$ apt-get update && apt-get upgrade

Install Tomcat from the Ubuntu repository

$ apt-get install tomcat8

Install the tomcat8-docs and tomcat8-admin

$ apt-get install tomcat8-docs tomcat8-examples tomcat8-admin

Start, stop or restart Tomcat

$ sudo systemctl start tomcat8
$ sudo systemctl stop tomcat8
$ sudo systemctl restart tomcat8

Set tomcat manager user

$ sudo nano /var/lib/tomcat8/conf/tomcat-users.xml

Insert following lines

<role rolename="manager-gui"/>
<user username="tomcat" password="tomcat" roles="manager-gui"/>

Restart tomcat

$ sudo systemctl restart tomcat8

Source https://www.linode.com/docs/websites/frameworks/apache-tomcat-on-ubuntu-16-04

How to fix following error:

Job for tomcat8.service failed because the control process exited with error code. See "systemctl status tomcat8.service" and "journalctl -xe" for details. invoke-rc.d: initscript tomcat8, action "start" failed.

$ sudo nano /etc/default/tomcat8

Set JAVA_HOME

JAVA_HOME=/usr/lib/jvm/java-8-oracle

How to how to completely remove tomcat from Ubuntu:

$ sudo apt-get purge tomcat8 tomcat8-docs tomcat8-examples tomcat8-admin
@combine13
Copy link

You saved my day, Mister! Thank you!

@cptully
Copy link

cptully commented Jul 19, 2018

This is the third set of tomcat install instructions I've followed and the only one that worked!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment