Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

apache/tomcat config issue 1

Status
Not open for further replies.

bpete

IS-IT--Management
Jun 10, 2003
2
US
Environment:
Apache/1.3.31 (Unix) mod_jk2/2.0.4
Tomcat 4.1.18
JDK 1.4.2_04-b05
Solaris 9

Problem:
Cannot get in-house java apps to load and display in browser. Can get to display and /server-status so it appears apache is OK. When I start Tomcat, I can get to show the default web page and can run the JSP examples from there.
NOT able to get to work!

Can anyone help please? Let me know what other info is needed.

httpd.conf:
<IfModule mod_jk2.so>
JkWorkersFile conf/workers2.properties
JkLogFile logs/mod_jk2.log
JkLogLevel debug
JkMount /struts/* ajp13
JkMount /*.do ajp13
JkMount /*.jsp ajp13
</IfModule>

server.xml:
<Connector className="org.apache.ajp.tomcat4.Ajp13Connector"
port="8009" minProcessors="5" maxProcessors="75"
acceptCount="10" debug="0"/>

context in server.xml:
<Host name="acm-beta2.tpwd.state.tx.us"
debug="0"
appBase="/ unpackWARs="false"
autoDeploy="false">

<Alias>acm-beta2</Alias>

<Valve className="org.apache.catalina.valves.AccessLogValve"
directory="logs"
prefix="acm-beta_access_log."
suffix=".txt"
pattern="common"
resolveHosts="false"/>
<Logger className="org.apache.catalina.logger.FileLogger"
directory="logs"
prefix="acm-beta_log."
suffix=".txt"
timestamp="true"/>

<Context path=""
docBase=""
debug="0"
reloadable="true">
</Context>

</Host>

Error message from apache log file:
File does not exist: /
 
If you havent set your port to 80 then you will be unlikly to see a web browser will by defauly look for port 80 if not defined on command line (or via proxy). How are you deploying your example application if its as a .WAR file then you need to change teh config.xml to unpackWARs=true.

It would be a good time to go through the documntation on Apache website.

Laurie.
 
Laurie,
Thanks for the reply! I have referenced so many sites to get the "correct" config on this and have found an equal number of answers on how to do it! It's been quite frustrating.

Anyway, a couple of points I've discovered - which made the connector work - are as follows:
- shm file has to be specified in both tomcat & apache's /conf dir: jk2.properties for tomcat and workers2.properties for apache.
- uri's had to be defined and associated with ports in workers2.properties (apache/conf) AND those same ports have to defined in server.xml as connectors.
- discovered also tomcat should be started before apache to give the connectors time to initialize. Otherwise your apache log files will fill up with connection errors.

I'm highlighting these points here in the hope it will help someone else out there who's been pulling their hair out as much as I was!

Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top