Reputation: 10822
I follow the steps largely from https://www.digitalocean.com/community/tutorials/how-to-install-apache-tomcat-8-on-ubuntu-14-04
Let me iterate the steps I took:
sudo apt-get install tomcat8
sudo groupadd tomcat
sudo useradd -s /bin/false -g tomcat -d /opt/tomcat tomcat
cd ~
wget http://apache.mirrors.ionfish.org/tomcat/tomcat-8/v8.0.24/bin/apache-tomcat-8.0.24.tar.gz
sudo mkdir /opt/tomcat
sudo tar xvf apache-tomcat-8*tar.gz -C /opt/tomcat --strip-components=1
cd /opt/tomcat
sudo chgrp -R tomcat conf
sudo chmod g+rwx conf
sudo chmod g+r conf/*
sudo chown -R tomcat work/ temp/ logs/
sudo update-alternatives --config java
and selected /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java
sudo nano /etc/init/tomcat.conf
and typed
description "Tomcat Server"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
respawn limit 10 5
setuid tomcat
setgid tomcat
env JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64/jre
env CATALINA_HOME=/opt/tomcat
# Modify these options as needed
env JAVA_OPTS="-Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom"
env CATALINA_OPTS="-Xms512M -Xmx1024M -server -XX:+UseParallelGC"
exec $CATALINA_HOME/bin/catalina.sh run
# cleanup temp directory after stop
post-stop script
rm -rf $CATALINA_HOME/temp/*
end script
sudo initctl reload-configuration
sudo initctl start tomcat
which leads to
tomcat start/running, process 14674
But when I go to http://[ip-address]:8080 nothing happens.
Please advise.
UPDATE
One comment below asked me to look at server.xml inside tomcat root folder bin.
I have reproduced the following files:
Which proves that there is no such file inside /opt/tomcat/bin
I have also appended some statements from server.xml below which is inside /opt/tomcat/conf
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
<Server port="8005" shutdown="SHUTDOWN">
Upvotes: 3
Views: 8201
Reputation: 367
I have simple solution for installing any version of apache tomcat on Ubuntu.
Simplest Way of Installing any version Apache Tomcat Installation Steps on Ubuntu.
Download any version of tomcat you wish to install from apache tomcat official website.(.tar/.zip)
Extract the tomcat tar/zip file to any folder/directory in your linux pc.
Copy the extracted folder to /opt directory directory looks like /opt/tomcat using cp command.
for e.g. sudo cp /Documents/apache-tomcat-8-0-24 /opt
This will copy my apache-tomcat-8-0-24 folder in Documents folder to /opt directory.
come back to /opt directory /opt cd /opt
you are at /opt run following command sudo chown -R username:username
for e.g. sudo chown -R akashgudadhe apache-tomcat-8-0-24
you are at /opt ls -la verify apache present or not
move to apache-tomcat-8-0-24 folder and bin directory inside it
/opt/apacheTomcatName/bin
you are now at /opt/apacheTomcatName/bin
run startup.sh file using following command you will see the message tomcat started.
for e.g. /opt/apacheTomcatName/bin/./startup.sh
This is optional step tail -f logs/catalina.out
Open any web browser and type localhost:8080 or type 127.0.0.1:8080 your tomcat installed successfully if not then mail me @ [email protected]
It will become great pleasure for me if you send me your feedback about my answer @ [email protected] ...!!!
Upvotes: 0
Reputation: 671
Instead of: http://serverip:8080 I used http://localhost:8080
That replacement worked for me.
Upvotes: 0
Reputation: 41
Just use
sudo chown -R tomcat:tomcat /opt/tomcat
This worked for me after useing the very same manual.
Upvotes: 4
Reputation: 133
I had the same problem. I installed Oracle JDK 7, HOWEVER, I still used JAVA_HOME
in tomcat.conf
that was pointing to Open JDK:
env JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64/jre
Make sure you are using the right version of Java. For me, I set it in tomcat.conf
as follows:
env JAVA_HOME=/usr/lib/jvm/java-7-oracle/jre
Then, do ps -ef | grep tomcat
after re-starting tomcat and you should get something like this if tomcat is running:
tomcat 1580 1 9 14:47 ? 00:00:03 /usr/lib/jvm/java-7-oracle/jre/bin/java -Djava.util.logging.config.file=/opt/tomcat/conf/logging.properties -Dja
ger=org.apache.juli.ClassLoaderLogManager -Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom -Xms128m -Xmx256m -XX:PermSize=128m -XX:MaxPermSize=2
ParallelGC -Djava.endorsed.dirs=/opt/tomcat/endorsed -classpath /opt/tomcat/bin/bootstrap.jar:/opt/tomcat/bin/tomcat-juli.jar -Dcatalina.base=/opt/tomcat -Dcat
t -Djava.io.tmpdir=/opt/tomcat/temp org.apache.catalina.startup.Bootstrap start
ubuntu 1607 1423 0 14:48 pts/0 00:00:00 grep --color=auto tomcat
Also, my environment
file has the following:
export JAVA_HOME="/usr/lib/jvm/java-7-oracle/jre"
export CATALINA_HOME="/opt/tomcat"
Hope this helps!
Upvotes: 0
Reputation: 41
If you want clean Ubuntu style package instead, the following should do it...
mkdir $HOME/tomcat8 && cd $HOME/tomcat8
wget http://mirrors.kernel.org/ubuntu/pool/main/e/ecj/libecj-java_3.10.1-2_all.deb
wget http://mirrors.kernel.org/ubuntu/pool/universe/t/tomcat8/libservlet3.1-java_8.0.28-1_all.deb
wget http://mirrors.kernel.org/ubuntu/pool/universe/t/tomcat8/libtomcat8-java_8.0.28-1_all.deb
wget http://mirrors.kernel.org/ubuntu/pool/universe/t/tomcat8/tomcat8-common_8.0.28-1_all.deb
wget http://mirrors.kernel.org/ubuntu/pool/universe/t/tomcat8/tomcat8_8.0.28-1_all.deb
dpkg -i *.deb
However, you're not on PPA. This isn't managed by apt anymore. You'll need to upgrade it manually whenever an update is made to the packages.
Upvotes: 1
Reputation: 1
You have to write:
cd /opt/tomcat/bin
and after:
sudo bash startup.sh
and all well!!! http://serverip:8080
NOTE: If you put the port 9090, then PLACED IN YOUR BROWSER http://serverip:9090
Upvotes: -1
Reputation: 1500
Open Server.xml
and find <Connector port="9090" protocol="HTTP/1.1"
so that is your port number .
Upvotes: -1