Rohit Mourya
Rohit Mourya

Reputation: 285

Unable to start tomcat7 in ubuntu

I installed tomcat7 but when I tried to start it. It fails to start. previously I'd installed tomcat7 and it was working fine, But when I tried to add tomcat7 server in netbeans it gave me error of some Catalina home or something. I looked for that solution and applied. Then after adding the tomcat7 server to the netbeans, it won't start. Later I install glassfish server. It also got failed. So again I uninstalled the tomcat7 and tried again to start it. But now it is not getting started.

Creating config file /etc/logrotate.d/tomcat7 with new version
 * Starting Tomcat servlet engine tomcat7                                [fail] 
invoke-rc.d: initscript tomcat7, action "start" failed.
Setting up tomcat7-admin (7.0.52-1ubuntu0.3) ...
Setting up tomcat7-docs (7.0.52-1ubuntu0.3) ...
Setting up tomcat7-examples (7.0.52-1ubuntu0.3) ...
Processing triggers for ureadahead (0.100.0-16) ...

Upvotes: 0

Views: 3672

Answers (1)

Java.beginner
Java.beginner

Reputation: 891

Try this!

Step 1: When Install tomcat 7 on Ubuntu 14.04

$ sudo apt-get install tomcat7

Step 2 If You find an error post installation which could look something similar to the code below:

Creating config file /etc/logrotate.d/tomcat7 with new version
 * no JDK or JRE found - please set JAVA_HOME
invoke-rc.d: initscript tomcat7, action "start" failed.
Setting up authbind (2.1.1) ...
Processing triggers for ureadahead (0.100.0-16) ...

To rectify the above please do the following:

$ sudo mkdir -p /home/data/backup_scripts
$ cp /etc/init.d/tomcat7 /home/data/backup_scripts/
$ sudo vim /etc/init.d/tomcat7

After you open the file i.e tomcat7, please find the following line

JDK_DIRS="/usr/lib/jvm/default-java ${OPENJDKS} /usr/lib/jvm/java-6-openjdk /usr/lib/jvm/java-6-sun /usr/lib/jvm/java-7-oracle"

Change the above line by appending the following to it: /usr/lib/jvm/java-8-oracle Thus the line would now become:

JDK_DIRS="/usr/lib/jvm/default-java ${OPENJDKS} /usr/lib/jvm/java-6-openjdk /usr/lib/jvm/java-6-sun /usr/lib/jvm/java-7-oracle /usr/lib/jvm/java-8-oracle"

Save the file and start the tomcat server. This time it should happen at ease:

$ sudo service tomcat7 start

Hope it works!!!

Upvotes: 3

Related Questions