Comments on How to Install and Configure Apache Tomcat 8.5 on Ubuntu 16.04

In this tutorial, I will show you how to install and configure Apache Tomcat 8.5 on Ubuntu 16.04 LTS (Yakkety Yak) and how to install and configure the prerequisite Java 8 on the Ubuntu server. Apache Tomcat is an open source Java Servlet implementation developed by the Apache Software Foundation.

16 Comment(s)

Add comment

Please register in our forum first to comment.

Comments

By: Fede Diaz

Hi! I follow this recipe step by step but Tomcat Env variables.

If you look inside catalina.sh script there is a piece like this:

if [ -r "$CATALINA_BASE/bin/setenv.sh" ]; then  . "$CATALINA_BASE/bin/setenv.sh"elif [ -r "$CATALINA_HOME/bin/setenv.sh" ]; then  . "$CATALINA_HOME/bin/setenv.sh"fi

So, I write all env vars inside that script.

Regards!!

By: din

Nice tutorial dude :)

By: Cesar Rojas

very good!!! only i have a problem with de command systemctl in the step 5, you know how configurate the systemctl ?? 

By: Riduan

Nice, Thank's it's wrok's on my raspberry pi :)

By: Ali Haidar

Wow, really great tutorial, thank you ! :)

By: lipsa

why do we have to install jdk from ubuntu ppa repository?

why not just use the command sudo apt-get update and then sudo apt-get install-xyz?

thanks :)

By: Tatenda

Im also curious what the answer to that question is

By: David

Good step by step tutorial. One suggestion: You use the command "netstat -plntu" to see if something is listening on port 8080, but I already had something running, listening on port 8080 (happened to be 'hudson') so would be good to advise others to check "netstat -plntu" *first* (before tomcat start) to make sure nothing was on already on 8080. If something was already there, then need to say to change the port in /opt/tomcat/conf/server.xml to, say, 8081.

Less serious, I was also curious why the elements with 'RemoteAddrValve' had to be commented out. Guess I'll have to study up. :)

Less serious still is that it is not clear if how secure to make 'password' -- perhaps should write password =<provide  password> or similar.

Thanks again!

By: park

Thank you very much

By: Tahir

Getting error at wget

wget http://mirror.wanxp.id/apache/tomcat/tomcat-8/v8.5.6/bin/apache-tomcat-8.5.6.tar.gz

failed: connection refused.

By: nEO

because wanxp has enough server problems on their own....try the official website https://tomcat.apache.org/ and find a proper tomcat version.

In my case tomcat 8.5.20 :::

wget http://www-eu.apache.org/dist/tomcat/tomcat-8/v8.5.20/bin/apache-tomcat-8.5.20.tar.gz

By: Martin

Hello, lots of kudos to you! My server provider was blocking 8080^^ 

If someone else is not able to access the tomcat manager page, try "wget localhost:8080" on the connected shell: this should download the tomcat info page. After seeing that tomcat is running fine, I know that the issue was server-related. 

Thanks!

By: Ryan

Hey great tutorial! I was able to get tomcat running and access it through my browser and even access the tomcat manager application. Also I've made the switch to linux recently and often forget a lot of commands so thank you for the explanations on all commands w/ the parameters.

Unfortunately my post is a bit unrelated because I can't find much information about it elsewhere on the internet. When using the ulitmate version of intelliJ (free for students at the moment and I've heard the community edition doesn't support JavaEE) and trying to add a tomcat instance, I select the tomcat directory (/opt/tomcat/). IntelliJ then tells me that 'The selected directory is not a valid Tomcat home'. I was hoping someone here might know the answer since this is the source where the instructions for the tomcat installation and configuration are from. Again sorry for the slightly unrelated post and appreciate any help!

By: Joe Sang

Thanks man!!

By: Patrick Luan

Parabéns, muito bom, depois de tanto tempo em diversos tutoriais finalmente acertei na configuração olhando este tutorial obrigado.

By: Vrunda

Very well explained step by step tutorial.

but after Step4, although Tomcat service is running on ubuntu VM, I'm unable to access the service on external browser.

I configured firewall explicitly as well. but not working. Any idea what could have gone wrong?