You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Richard Lewis <ri...@fastmail.co.uk> on 2004/09/24 17:38:27 UTC

Apache front to Tomcat/Cocoon

Hi there,

This problem has been bugging me for days and I've tried both the 
Apache (httpd) mailing list and the Cocoon mailing list but no one 
seems to be able to solve it.

I've got two Cocoon (2.1) webapps running under Tomcat (4.1) on my 
server (Debian, j2sdk1.4-sun, Apache 2.0). My network service provided 
has given me two aliases for the machine which I want to point to the 
two webapps.

As I understand it, I can use virtual hosting and mod_proxy with Apache 
to re-direct requests which use these two aliases to the webapps 
running on port 8080.

My Apache and Tomcat set up is as follows:

apache2/mods-enabled directory:

php4.conf -> /etc/apache2/mods-available/php4.conf
php4.load -> /etc/apache2/mods-available/php4.load
proxy.conf -> ../mods-available/proxy.conf
proxy_connect.load -> ../mods-available/proxy_connect.load
proxy_http.load -> ../mods-available/proxy_http.load
proxy.load -> ../mods-available/proxy.load
userdir.conf -> /etc/apache2/mods-available/userdir.conf
userdir.load -> /etc/apache2/mods-available/userdir.load
==============================================================
apache2/sites-enabled directory:

cursus.uea.ac.uk -> ../sites-available/cursus.uea.ac.uk
studios.uea.ac.uk -> ../sites-available/studios.uea.ac.uk
==============================================================
apache2/sites-available directory:

cursus.uea.ac.uk -> /var/webapps/cursus/cursus.apache.conf
studios.uea.ac.uk -> /var/webapps/studio/studio.apache.conf
==============================================================
apache2/httpd.conf:

<Files *.apache.conf>
         Order deny,allow
         Deny from all
</Files>

NameVirtualHost *****:80
==============================================================
/var/webapps/cursus/cursus.apache.conf:

<VirtualHost ****:80>
         ServerName www.cursus.uea.ac.uk
         ServerAlias cursus.uea.ac.uk
         ServerAlias www.cursus
         ProxyRequests off
         ProxyPass / http://localhost:8081/cocoon/cursus/
         ProxyPassReverse / http://localhost:8081/cocoon/cursus/
         ProxyPass /styles http://localhost:8081/cocoon/cursus/styles
         ProxyPassReverse /styles 
http://localhost:8081/cocoon/cursus/styles
</VirtualHost>
==============================================================
/var/webapps/cursus/studios.apache.conf:

<VirtualHost ****:80>
         ServerName www.studios.uea.ac.uk
         ServerAlias studios.uea.ac.uk
         ServerAlias www.studios
         ProxyRequests Off
         ProxyPass / http://localhost:8082/cocoon/studio/
         ProxyPassReverse / http://localhost:8082/cocoon/studio/
</VirtualHost>
==============================================================
/var/webapps/tomcat/conf/server.xml: [snippet]

     <Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
                port="8081" minProcessors="5" maxProcessors="75"
                enableLookups="true"
                acceptCount="100" debug="0" connectionTimeout="20000"
                proxyName="www.cursus.uea.ac.uk" proxyPort="80"
                useURIValidationHack="false" disableUploadTimeout="true" 
/>

     <Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
                port="8082" minProcessors="5" maxProcessors="75"
                enableLookups="true"
                acceptCount="100" debug="0" connectionTimeout="20000"
                proxyName="www.studios.uea.ac.uk" proxyPort="80"
                useURIValidationHack="false" disableUploadTimeout="true" 
/>


The problem is that when the user requests the URL 
http://cursus.uea.ac.uk/ or http://www.studios.uea.ac.uk/ the server 
returns 403 'Forbidden'.
$ tail log/apache2/error.log gives:
[Fri Sep 24 16:22:17 2004] [error] [client ****] client denied by 
server configuration: proxy:http://localhost:8081/cocoon/cursus/

Accessed using the :808[012] suffix, the webapps both work fine (though 
the network firewall will stop access from outside).

If anyone could help me I would be very grateful indeed as I've been 
puzzeling over this for days and really can't think of anything else 
that might sort the problem.

Thanks in advance,
Richard


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org