File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes Apache 1.3 / Tomcat 4.0 Configuration Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Apache 1.3 / Tomcat 4.0 Configuration Problem" Watch "Apache 1.3 / Tomcat 4.0 Configuration Problem" New topic
Author

Apache 1.3 / Tomcat 4.0 Configuration Problem

Chris Patton
Greenhorn

Joined: Jun 12, 2000
Posts: 7
I guess i should have mentioned in the title that i'm trying to use mod_jk.
For the last few weeks I've been wrestling with trying to get tomcat and apache working together. I'm trying to set it up to where I have one Tomcat and one Apache running with virtual hosts. Right now i'm only testing with two sites.
When I load my primary site (the "default" one in apache), everything works prefectly. However, the secondary site can run web applications, and serve static html, but gives me "resource unavailable" when i try to load any *.jsp that is in the second site, but not in a web application.
Here are sippets from my configuration files.
server.xml:
<Server port="8005" shutdown="SHUTDOWN" debug="0">
<Listener className="org.apache.ajp.tomcat4.config.ApacheConfig" />
<Service name="Tomcat-Standalone">
<!-- Define a non-SSL HTTP/1.1 Connector on port 8080 -->
<Connector className="org.apache.catalina.connector.http.HttpConnector"
port="8080" minProcessors="5" maxProcessors="75"
enableLookups="true" redirectPort="8443"
acceptCount="10" debug="0" connectionTimeout="60000"/>
<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector className="org.apache.ajp.tomcat4.Ajp13Connector"
port="8009" minProcessors="5" maxProcessors="75"
acceptCount="10" debug="0"/>
<Engine name="Standalone" defaultHost="localhost" debug="0">
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="catalina_log." suffix=".txt"
timestamp="true"/>
<Realm className="org.apache.catalina.realm.MemoryRealm" />
<Host name="www.host1.com" debug="0" appBase="webapps" unpackWARs="true">
<Listener className="org.apache.ajp.tomcat4.config.ApacheConfig" append="true" />
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="localhost_access_log." suffix=".txt" pattern="common"/>
<Logger className="org.apache.catalina.logger.FileLogger" directory="logs" prefix="localhost_log." suffix=".txt" timestamp="true"/>
<Context path="" docBase="/webs/site1" debug="0" />
<Context path="/app1" docBase="app1" debug="0" reloadable="true" />
<Context path="/app2" docBase="app2" debug="0" reloadable="true" />
</Host>
<Host name="www.host2.com" debug="0" appBase="webapps" unpackWARs="true">
<Listener className="org.apache.ajp.tomcat4.config.ApacheConfig" append="true" />
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="localhost_access_log." suffix=".txt" pattern="common" />
<Logger className="org.apache.catalina.logger.FileLogger" directory="logs" prefix="localhost_log." suffix=".txt" timestamp="true" />
<Context path="" docBase="/webs/site2" debug="0" />
<Context path="/app1" docBase="app1" debug="0" reloadable="true" />
</Host>
</Engine>
</Service>
</Listener>
</Server>
and this is httpd.conf:
NameVirtualHost *
<IfModule !mod_jk.c>
LoadModule jk_module libexec/mod_jk.so
</IfModule>
JkMount /webfuse/adbuilder/* ajp13
JkMount /webfuse/*.jsp ajp13
JkMount /*.jsp ajp13
JkMount /servlet/* ajp13

JkWorkersFile "/opt/tomcat/conf/jk/workers.properties"
JkLogFile "/opt/tomcat/logs/mod_jk.log"
JkLogLevel emerg
# host1.com Virtual Host.
#
<VirtualHost *>
ServerName www.host1.com
DocumentRoot /webs/site1
<Directory "/webs/site1">
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
JkMount /*.jsp ajp13
JkMount /servlet/* ajp13
JkMount /app1 ajp13
JkMount /app1/* ajp13
JkMount /app2 ajp13
JkMount /app2/* ajp13

</VirtualHost>
# host2.com Virtual Host.
#
<VirtualHost *>
ServerName www.host2.com
DocumentRoot /webs/site2
<Directory "/webs/site2">
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
JkMount /*.jsp ajp13
JkMount /servlet/* ajp13
JkMount /app1 ajp13
JkMount /app1/* ajp13
</VirtualHost>

i know that the server.xml file is the "tomcat-standalone" section, but i started changing that and it turned into the connected part.
any help is greatly appreciated.
-chris
Chris Patton
Greenhorn

Joined: Jun 12, 2000
Posts: 7
nevermind. i figured it out. there was a malformed web.xml file in the default context of the secondary site. the log files weren't specific enough for me to see it at first glance. oh well. just remember that if you get a resource unavailable error... it's probably a problem with your web.xml.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Apache 1.3 / Tomcat 4.0 Configuration Problem