I'm unable to start or stop Tomcat on Linux. As the server is new and first time we are running it , shutdown.sh throws an exception below though I have placed the log4j.properties:
/tomcat/V6.0/bin$ ./shutdown.sh
After calling setenv.sh: Using JAVA_HOME:
After calling setenv.sh: Using JRE_HOME: /usr/java/jdk1.8.0_91/jre
After cygwin: Using JAVA_HOME:
After cygwin: Using JRE_HOME: /usr/java/jdk1.8.0_91/jre
log4j:WARN No appenders could be found for logger (org.apache.tomcat.util.digester.Digester.sax).
log4j:WARN Please initialize the log4j system properly.
But when I run the startup.sh it doesnot show anything on console saying tomcat started. Only the below lines have been printed.
/tomcat/V6.0/bin$ ./startup.sh
After calling setenv.sh: Using JAVA_HOME:
After calling setenv.sh: Using JRE_HOME: /usr/java/jdk1.8.0_91/jre
After cygwin: Using JAVA_HOME:
After cygwin: Using JRE_HOME: /usr/java/jdk1.8.0_91/jre
Using localhost when I try launching the tomcat it throws 404 error Please can anyone help me on this?
I will really suggest to upgrade tomcat, if it is mandatory then someone has to take the risk of the implementation, with that said lets list how to validate tomcat properly.
.sh
scripts that are in bin
folder. For example if you are located at the bin folder of tomcat apache-tomcat-6.0.53/bin$>
then you can run chmod +x ./*.sh
JAVA_HOME
is set./startup.sh
ps -ef | grep tomcat
it will list the running process that are related to tomcat.bin
folder run the shutdown script ./shutdow.sh
ps -ef | grep tomcat
, if you don't get listed the tomcat process then it is stopped successfully otherwise you can force the shutdown, using kill - 9 <process-number>
so for example when you run ps -ef | grep tomcat
Sample output of ps-ef command
servername 4328 1 0 21:43 pts/1 00:00:07 /usr/var/jdk1.8.0_111/bin/java -Djava.util.logging.config.file=... tomcat
servername 4497 4117 0 22:07 pts/1 00:00:00 grep --color=auto tomcat
Then stop tomcat with this kill -9 4328
it is because 4328
is the process number that you get from the ps -ef
output.
How access tomcat without port number?
If you need to access your tomcat server through the browser with a default port number then configure the connector to http default port number 80. Please see the following instructions:
apache-tomcat-6.0.53/conf
folderserver.xml
fileDefault connector configuration
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
Connector configuration with port number 80
<Connector port="80" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />