cPanelKenneth

cPanel Development
Staff member
Apr 7, 2006
4,607
80
458
cPanel Access Level
Root Administrator
Try restarting both Apache and Tomcat, it may be the various processes involve (jsvc, mod_jk and httpd) are "out of sync." If that doesn't resolve your issue, please open a support ticket at https://tickets.cpanel.net/submit/ and we'll be happy to sort out what is causing the issue.
 

twhiting9275

Well-Known Member
Sep 26, 2002
560
28
178
cPanel Access Level
Root Administrator
Twitter
Thanks. I tried this, but with the same result. still says timed out.:(
Check the firewall
Better yet: Find a REAL language, not tomcat/java. Java kills servers. Every single server I've ever put tomcat on (or seen it on) has been incredibly loaded down, and the reason for this? Tomcat.

Unfortunately, tomcat/java is not a realistic expectation on a shared server.
 

mtindor

Well-Known Member
Sep 14, 2004
1,458
113
193
inside a catfish
cPanel Access Level
Root Administrator
Thanks. I tried this, but with the same result. still says timed out.:(
From a shell prompt (if you dont know what this is, find a different business!):

type this in, and then hit enter: telnet localhost 8080

1. If it goes to the next line and doesn't return you to the prompt but just sits there, type in:

GET / HTTP/1.0 (then hit enter twice)

You should see it spew a page.

2. If it says something like telnet: Unable to connect to remote host: Connection refused, then Tomcat is not running


So, what happens when you do this?

Mike
 
Last edited:

cPanelKenneth

cPanel Development
Staff member
Apr 7, 2006
4,607
80
458
cPanel Access Level
Root Administrator
From a shell prompt (if you dont know what this is, find a different business!):

type this in, and then hit enter: telnet localhost 80

1. If it goes to the next line and doesn't return you to the prompt but just sits there, type in:

GET / HTTP/1.0 (then hit enter twice)

You should see it spew a page.

2. If it says something like telnet: Unable to connect to remote host: Connection refused, then Tomcat is not running


So, what happens when you do this?

Mike
If he is running Apache, then Apache is bound to port 80 and the telnet check won't result in anything worthwhile. A netstat will produce easier to read results:

Code:
[email protected] [/home34y69da/tramel]# netstat -ln | grep 8080
tcp        0      0 :::8080                     :::*                        LISTEN      
[email protected] [/home34y69da/tramel]# ps ax | grep jsvc
22939 ?        Ss     0:00 jsvc.exec -user tomcat -cp ./bootstrap.jar -Djava.endorsed.dirs=../common/endorsed -debug -outfile ../logs/catalina.out -errfile ../logs/catalina.err -verbose org.apache.catalina.startup.Bootstrap -security 
22940 ?        Sl     0:06 jsvc.exec -user tomcat -cp ./bootstrap.jar -Djava.endorsed.dirs=../common/endorsed -debug -outfile ../logs/catalina.out -errfile ../logs/catalina.err -verbose org.apache.catalina.startup.Bootstrap -security 
22983 pts/0    S+     0:00 grep jsvc
[email protected] [/home34y69da/tramel]# netstat -ln | grep 800
tcp        0      0 :::8009                     :::*                        LISTEN
The process listening on port 8009 is mod_jk

Code:
[email protected] [/home34y69da/tramel]# telnet localhost 8080
Trying 127.0.0.1...
Connected to localhost (127.0.0.1).
Escape character is '^]'.
GET /
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <title>Apache Tomcat/5.5.25</title>
    <style type="text/css">
I snipped the output of telnet as it was too long.
 

mtindor

Well-Known Member
Sep 14, 2004
1,458
113
193
inside a catfish
cPanel Access Level
Root Administrator
Thanks for correcting me. I meant to say port 8080. Will correct.

I was more concerned about whether he could connect to 8080 via localhost, AND to see if it would deliver the page when he did a 'GET / HTTP/1.0' or if it would hang at that point.

Mike
 

meeven

Well-Known Member
May 8, 2007
132
2
168
Thanks, everyone, for your assistance. Sorry for the delayed reply- I am having to deal with the medical emergency of a relative.

mtindor, I tried the telnet command and it worked, but the GET command with HTTP kept showing a 'command not found' error until I just typed in GET /

That brought up the Tomcat page. Here it is:

Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
GET /
<!doctype html public "-//w3c//dtd html 4.0 transitional//en" "http://www.w3.org/TR/REC-html40/strict.dtd">

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Apache Tomcat/5.5.9</title>
</head>

<body>

<!-- Header -->
<table width="100%">
<tr>
<td align="left" width="130"><a href="http://jakarta.apache.org/tomcat/index.html"><img src="tomcat.gif" height="92" width="130" border="0" alt="The Mighty Tomcat - MEOW!"></td>
<td align="left" valign="top">
<table>
<tr><td align="left" valign="top"><b>Apache Tomcat/5.5.9</b></td></tr>
</table>
</td>
<td align="right"><a href="http://jakarta.apache.org/"><img src="jakarta-banner.gif" height="48" width="505" border="0" alt="The Jakarta Project"></a></td>
</tr>
</table>

<br>

<table>
<tr>

<!-- Table of Contents -->
<td valign="top">
<table width="100%" border="1" cellspacing="0" cellpadding="3" bordercolor="#000000">
<tr>
<td bgcolor="#D2A41C" bordercolor="#000000" align="left" nowrap>
<font face="Verdana" size="+1"><i>Administration</i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font>
</td>
</tr>
<tr>
<td bgcolor="#FFDC75" bordercolor="#000000" nowrap>
<a href="manager/status">Status</a><br>
<a href="admin">Tomcat Administration</a><br>
<a href="manager/html">Tomcat Manager</a><br>
&nbsp;
</td>
</tr>
</table>
<br>
<table width="100%" border="1" cellspacing="0" cellpadding="3" bordercolor="#000000">
<tr>
<td bgcolor="#D2A41C" bordercolor="#000000" align="left" nowrap>
<font face="Verdana" size="+1"><i>Documentation</i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font>
</td>
</tr>
<tr>
<td bgcolor="#FFDC75" bordercolor="#000000" nowrap>
<a href="RELEASE-NOTES.txt">Release Notes</a><br>
<a href="tomcat-docs/changelog.html">Change Log</a><br>
<a href="tomcat-docs">Tomcat Documentation</a><br>
&nbsp;
</td>
</tr>
</table>
<br>
<table width="100%" border="1" cellspacing="0" cellpadding="3" bordercolor="#000000">
<tr>
<td bgcolor="#D2A41C" bordercolor="#000000" align="left" nowrap>
<font face="Verdana" size="+1"><i>Tomcat Online</i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font>
</td>
</tr>
<tr>
<td bgcolor="#FFDC75" bordercolor="#000000" nowrap>
<a href="http://jakarta.apache.org/tomcat/">Home Page</a><br>
<a href="http://jakarta.apache.org/tomcat/bugreport.html">Bug Database</a><br>
<a href="http://issues.apache.org/bugzilla/buglist.cgi?bug_status=UNCONFIRMED&amp;bug_status=NEW&amp;bug_status=ASSIGNED&amp;bug_status=REOPENED&amp;bug_status=RESOLVED&amp;resolution=LATER&amp;resolution=REMIND&amp;resolution=---&amp;bugidtype=include&amp;product=Tomcat+5&amp;cmdtype=doit&amp;order=Importance">Open Bugs</a><br>
<a href="http://nagoya.apache.org/eyebrowse/SummarizeList?listId=88">Users Mailing List</a><br>
<a href="http://nagoya.apache.org/eyebrowse/SummarizeList?listId=46">Developers Mailing List</a><br>
<a href="irc://irc.freenode.net/#tomcat">IRC</a><br>
&nbsp;
</td>
</tr>
</table>
<br>
<table width="100%" border="1" cellspacing="0" cellpadding="3" bordercolor="#000000">
<tr>
<td bgcolor="#D2A41C" bordercolor="#000000" align="left" nowrap>
<font face="Verdana" size="+1"><i>Examples</i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font>
</td>
</tr>
<tr>
<td bgcolor="#FFDC75" bordercolor="#000000" nowrap>
<a href="jsp-examples/">JSP Examples</a><br>
<a href="servlets-examples/">Servlet Examples</a><br>
<a href="webdav/">WebDAV capabilities</a><br>
&nbsp;
</td>
</tr>
</table>
<br>
<table width="100%" border="1" cellspacing="0" cellpadding="3" bordercolor="#000000">
<tr>
<td bgcolor="#D2A41C" bordercolor="#000000" align="left" nowrap>
<font face="Verdana" size="+1"><i>Miscellaneous</i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font>
</td>
</tr>
<tr>
<td bgcolor="#FFDC75" bordercolor="#000000" nowrap>
<a href="http://java.sun.com/products/jsp">Sun's Java Server Pages Site</a><br>
<a href="http://java.sun.com/products/servlet">Sun's Servlet Site</a><br>
&nbsp;
</td>
</tr>
</table>
</td>

<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>

<!-- Body -->
<td align="left" valign="top">
<p><center><b>If you're seeing this page via a web browser, it means you've setup Tomcat successfully. Congratulations!</b></center></p>

<p>As you may have guessed by now, this is the default Tomcat home page. It can be found on the local filesystem at:
<blockquote>
<p class="code">$CATALINA_HOME/webapps/ROOT/index.jsp</p>
</blockquote>
</p>

<p>where "$CATALINA_HOME" is the root of the Tomcat installation directory. If you're seeing this page, and you don't think you should be, then either you're either a user who has arrived at new installation of Tomcat, or you're an administrator who hasn't got his/her setup quite right. Providing the latter is the case, please refer to the <a href="tomcat-docs">Tomcat Documentation</a> for more detailed setup and administration information than is found in the INSTALL file.</p>

<p><b>NOTE:</b> This page is precompiled. If you change it, this page will not change since
it was compiled into a servlet at build time.
(See <tt>$CATALINA_HOME/webapps/ROOT/WEB-INF/web.xml</tt> as to how it was mapped.)
</p>

<p><b>NOTE: For security reasons, using the administration webapp
is restricted to users with role "admin". The manager webapp
is restricted to users with role "manager".</b>
Users are defined in <code>$CATALINA_HOME/conf/tomcat-users.xml</code>.</p>

<p>Included with this release are a host of sample Servlets and JSPs (with associated source code), extensive documentation (including the Servlet 2.4 and JSP 2.0 API JavaDoc), and an introductory guide to developing web applications.</p>

<p>Tomcat mailing lists are available at the Jakarta project web site:</p>

<ul>
<li><b><a href="mailto:[email protected]">[email protected]</a></b> for general questions related to configuring and using Tomcat</li>
<li><b><a href="mailto:[email protected]">[email protected]</a></b> for developers working on Tomcat</li>
</ul>

<p>Thanks for using Tomcat!</p>

<p align="right"><font size=-1><img src="tomcat-power.gif" width="77" height="80"></font><br>
&nbsp;
<font size=-1>Copyright &copy; 1999-2004 Apache Software Foundation</font><br>
<font size=-1>All Rights Reserved</font> <br>
&nbsp;</p>
<p align="right">&nbsp;</p>

</td>

</tr>
</table>

</body>
</html>
Connection closed by foreign host.
It still didn't work when I tried http://www.domain.com:8080/, so I tried twhiting9275's suggestion and added the port to the firewall configuration. I am now able to see a directory listing of the entire web root of the domain. I am not sure this is what I want.

It also showed a file called jsptest.jsp and when I clicked on it (http://www.domain.com:8080/jsptest.jsp), I got the following web page:

Sample Application JSP Page
This is the output of a JSP page that is part of the Hello, World application. It displays several useful values from the requestwe are currently processing.
Request Method: GET
Servlet Path: /jsptest.jsp
So, does this mean Tomcat is working?
 

cPanelKenneth

cPanel Development
Staff member
Apr 7, 2006
4,607
80
458
cPanel Access Level
Root Administrator
Thanks, everyone, for your assistance. Sorry for the delayed reply- I am having to deal with the medical emergency of a relative.

mtindor, I tried the telnet command and it worked, but the GET command with HTTP kept showing a 'command not found' error until I just typed in GET /

That brought up the Tomcat page. Here it is:



It still didn't work when I tried http://www.domain.com:8080/, so I tried twhiting9275's suggestion and added the port to the firewall configuration. I am now able to see a directory listing of the entire web root of the domain. I am not sure this is what I want.

It also showed a file called jsptest.jsp and when I clicked on it (http://www.domain.com:8080/jsptest.jsp), I got the following web page:



So, does this mean Tomcat is working?
Yes, Tomcat is working. Congratulations!
 

meeven

Well-Known Member
May 8, 2007
132
2
168
Yes, Tomcat is working. Congratulations!
Thanks a lot, then.:)

Is it okay to leave that page with directory index turned on? It's showing the entire stuff in the web root of the domain. Should I turn off indexing using cPanel's index manager?