I'm trying to put in a Tomcat server on our unix machine (access remotely) which will be used for test projects.
I used Tomcat 5.0.25
(as our production is using the same version).
For now i don't want to run it through Apache and instead just want to access tomcat directly.
So i've deployed Tomcat and configured server.xml (see below) but when i start it i am not able to see the tomcat 5 welcome page using this URL: global.int.com:9082
<?xml version='1.0' encoding='utf-8'?>
<Server port="9007" shutdown="SHUTDOWN">
<Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"
debug="0"/>
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"
debug="0"/>
<!-- Global JNDI resources -->
<GlobalNamingResources>
<!-- Test entry for demonstration purposes -->
<Environment name="simpleValue" type="java.lang.Integer" value="30"/>
<!-- Editable user database that can also be used by
UserDatabaseRealm to authenticate users -->
<Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved">
</Resource>
<ResourceParams name="UserDatabase">
<parameter>
<name>factory</name>
<value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
</parameter>
<parameter>
<name>pathname</name>
<value>conf/tomcat-users.xml</value>
</parameter>
</ResourceParams>
</GlobalNamingResources>
<Service name="Catalina">
<Connector port="9082" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="9020" protocol="AJP/1.3" redirectPort="9444" />
<!-- An Engine represents the entry point (within Catalina) that processes
every request. The Engine implementation for Tomcat stand alone
analyzes the HTTP headers included with the request, and passes them
on to the appropriate Host (virtual host).
Documentation at /docs/config/engine.html -->
<!-- You should set jvmRoute to support load-balancing via AJP ie :
<Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">
-->
<Engine name="Catalina" defaultHost="localhost">
<!-- This Realm uses the UserDatabase configured in the global JNDI
resources under the key "UserDatabase". Any edits
that are performed against this UserDatabase are immediately
available for use by the Realm. -->
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
<!-- Define the default virtual host
Note: XML Schema validation will not work with Xerces 2.2.
-->
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
</Host>
</Engine>
</Service>
</Server>
I can see Tomcat is running as Catalina.out says:
Jan 27, 2012 8:21:56 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-9082
Jan 27, 2012 8:21:56 PM org.apache.jk.common.ChannelSocket init
INFO: JK2: ajp13 listening on /0.0.0.0:9020
Jan 27, 2012 8:21:56 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=1/14 config=/home/tomcat/tomcat5_fcl_uat/conf/jk2.properties
Jan 27, 2012 8:21:56 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 2173 ms
And Command lsof -i TCP
Shows:
java 29923 tomcat 5u IPv6 373023 TCP *:9082 (LISTEN)
I can't figure out why i can't see the tomcat page. I have another Tomcat server running on port 9081 and we can access it just fine by using url global.int.com:9081
and the above server.xml is a carbon copy of that except the port numbers are changed. Can anyone please give me a hint on where things are falling apart. Thanks
UPDATE2:
Result of wget -S
from Remote Desktop:
--2012-01-30 17:35:42-- http://global.int.com:9082/
Resolving global.int.com... 10.215.222.78
Connecting to global.int.com|10.215.222.78|:9082... failed: No route
to host.
Below is the result of wget -S
on LocalHost machine:
[tomcat@global logs]$ wget -S http://global.int.com:9082/
--16:17:03-- http://global.int.com:9082/
Resolving global.int.com:9082... 10.213.210.78
Connecting to global.int.com:9082|10.213.210.78|:9082... connected.
HTTP request sent, awaiting response...
HTTP/1.1 200 OK
Content-Type: text/html;charset=ISO-8859-1
Date: Sat, 28 Jan 2012 05:17:03 GMT
Server: Apache-Coyote/1.1
Connection: close
Length: unspecified [text/html]
Saving to: `index.html'
[ <=> ] 9,312 --.-K/s in 0s
16:17:03 (297 MB/s) - `index.html' saved [9312]
[tomcat@global logs]$
UPDATE 3: Result of iptables -L -v -n
:
106 5920 ACCEPT tcp -- * * 10.0.0.0/8 0.0.0.0/0 tcp dpt:8080
6 312 ACCEPT tcp -- * * 10.0.0.0/8 0.0.0.0/0 tcp dpt:8180
0 0 ACCEPT tcp -- * * 10.0.0.0/8 0.0.0.0/0 tcp dpt:9080
19 988 ACCEPT tcp -- * * 10.0.0.0/8 0.0.0.0/0 tcp dpt:9081
Correct me if I am wrong - but result of above shows the reason why I cannot access tomcat given I've assigned port 9082 to tomcat and that port does not exist in the above list.
All port numbers used in server.xml
are unique (I've double checked). Any suggestions on why I can't get to see the Tomcat main page and how to fix it?