You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@jakarta.apache.org by Jed Reynolds <J....@outcome.com> on 2000/08/16 22:28:54 UTC

Tomcat context in Apache docroot doesn't work

I'd like to be able to setup Apache and Tomcat
(both the latest stable versions) such that I can
make a Tomcat context set in the the apache's document 
root.

The best I have been able to do is just setup Tomcat
and forget about Apache. I create a document root:
	/htdocs/dev_server

And then a tomcat configuration directory:
	/usr/local/jakarta/build/tomcat_dev_server/
	( containing webroot, bin, logs, ...)
and in tomcat_dev_server/webroot I link ROOT to
/htdocs/dev_server.
	cd webroot
	ln -s /htdocs/dev_server ./ROOT

The context I build uses a the HttpConnectionHandler
on port 8081 and looks like this:

	<!-- this is the HTTP connector that does not use an apache port -->
      <Connector className="org.apache.tomcat.service.SimpleTcpConnector">
        <Parameter name="handler" 
	
value="org.apache.tomcat.service.http.HttpConnectionHandler"/>
        <Parameter name="port" value="8081"/>
      </Connector>

	<!-- this context maps the base ("") context to /htdocs/dev_outcome
-->
      <Context path="" docBase="webapps/ROOT" debug="0" reloadable="true" >
      </Context>

What I'd like to do is setup an Apache virtual server and then make it
synonymous with the Tomcat webapps/ROOT context.
	# httpd.conf, port 8080
	<VirtualServer 10.0.1.48>
	ServerName dev.server 
	DocumentRoot=/htdocs/dev_server
	ApJServMount / ajpv12://localhost:8007/
	</VirtualServer>

with this context:
	# dev_server.xml -- start with "bin/tomcat.sh start -f
dev_server.xml"
	<!-- this is the HTTP connector that does not use an apache port -->
      <Connector className="org.apache.tomcat.service.SimpleTcpConnector">
        <Parameter name="handler" 
	
value="org.apache.tomcat.service.connector.Apj12ConectionHandler"/>
        <Parameter name="port" value="8007"/>
      </Connector>

	<!-- this context maps the base ("") context to /htdocs/dev_outcome
-->
      <Context path="" docBase="webapps/ROOT" debug="0" reloadable="true" >
      </Context>

If I configure it this way, the JSP files put in /htdocs/dev_server do not
get
interpreted by Tomcat: Apache spits them back as text/html, uninterpreted.
( eg http://localhost:8080/index.jsp ).

The best I've been able to do is to create a "webapps/dev_server" context,
	<!-- this context maps the base ("") context to /htdocs/dev_outcome
-->
	<!-- assume "ln -s /htdocs/dev_server webapps/dev_server" -->
      <Context path="/dev_server" docBase="webapps/dev_server" debug="0" 
		reloadable="true" >
      </Context>
and get my JSP pages compiled by looking at
http://localhost:8080/dev_server/index.jsp.


Do you know what I mean?

thanks

Jed Reynolds