Search code examples
linuxubuntutomcatubuntu-16.04tomcat8

Install Apache Tomcat 8 on Ubuntu 16.04


I used curl to download the link

curl -O http://apache.mirrors.ionfish.org/tomcat/tomcat-8/v8.5.5/bin/apache-tomcat-8.5.5.tar.gz

Then I extract the archive to it with these commands:

sudo tar xzvf apache-tomcat-8*tar.gz -C /opt/tomcat --strip-components=1

but I got an error:

root@localhost:/tmp# curl -O http://apache.mirrors.ionfish.org/tomcat/tomcat-8/v8.5.5/bin/apache-tomcat-8.5.5.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   327  100   327    0     0   1193      0 --:--:-- --:--:-- --:--:--  1193
root@localhost:/tmp# sudo mkdir /opt/tomcat
root@localhost:/tmp# sudo tar xzvf apache-tomcat-8*tar.gz -C /opt/tomcat --strip-components=1

gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now

Solution

  • Your tomcat download link is not valid.

    Using the following link to curl the latest release

    http://www-us.apache.org/dist/tomcat/tomcat-8/v8.5.27/bin/apache-tomcat-8.5.27.tar.gz

    Or if you wanna to use v8.5.5, here is the working url

    https://archive.apache.org/dist/tomcat/tomcat-8/v8.5.5/bin/apache-tomcat-8.5.5.tar.gz