• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tomcat web app configuration error

 
maru josph
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am learning servlets and JSP using head first book. I have instole TOMCAT 5.0 and java sdk 1.4 in my system. I also set my environment JAVA_HOME and TOMCAT_HOME.
But when I try to run local host on my browser http://localhost:8080/ it produce an error �the connection was refused when attempting to connect local host: 8080�

Does any one have any suggestion to resolve this error? I appreciate in advance.

Maru
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13073
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thats the message you would get if:
1. Tomcat is not actually running on your home system. How did you start Tomcat? Why are you sure it is still running?
-OR-
2. Tomcat is running but the HTTP port was changed from the 8080 port. Check your server.xml configuration file.

Bill
 
maru josph
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you William for your response. I start TOMCAT/bin using �startup.sh� It seemed Tomcat started up in my system.I checked conf > server XML file. I have it set up <serverport = �8005� and <connected port = �8080�. Does the server port have to be 8080 in order to run my local system? If so how can we edit XML file to change port number.


Thank you
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
TOMCAT-INSTALL/conf/server.xml is the file you would edit to change the port number.

A case sensitive CTRL+F search for "<Connector..." should get you right to the relevant section.
 
maru josph
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for your response

I do have connector port set up 8080 on Tomcat but still when I run the local host it produce an error. Here is some of the set up on my Tomcat conf>server

<Server port="8005" shutdown="SHUTDOWN" debug="0">

<Connector port="8080" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false" redirectPort="8443" acceptCount="100" debug="0" connectionTimeout="20000" disableUploadTimeout="true" />

<Connector port="8080" enableLookups="false" redirectPort="8443" debug="0" protocol="AJP/1.3" />


Thank you for your time
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why are you trying to set up two connectors that bind to the same port?
I thought you wanted to run on a port other than 8080.
 
subodh gupta
Ranch Hand
Posts: 203
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am sure problem is with the port but also tomcat 5.0 runs on 1.5 so change the jdk version.
[ July 24, 2007: Message edited by: subodh gupta ]
 
maru josph
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for the suggestion, Head First Servlets & JSP book suggest tomcat 5.0 and 1.4 jdk. I think the problem is on port. Does any one have any experience Tomcat 5.0 port setting to use it local machine? I just want to see http://localhost:8080/ to display tomcat welcome page. I have change both connector port 8080 on Tomcat conf>server. But server port still on �8005�

Thank you
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't change them both to 8080.
Only one resource can bind to a port.

If you only want to see http://localhost:8080 you shouldn't change server.xml at all. That is the default port that Tomcat uses.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic