Hello ALUG,
Thanks for your help with getting Tomcat going as a non-privileged daemon.
The reason I was trying to do that was because it was suggested as part of a solution for this problem:
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
On Fri, Sep 24, 2004 at 04:42:08PM +0100, Richard Lewis wrote:
============================================================== /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>
Right - looks like you're not allowing Proxy requests to me... add in to the virtual hosts a block something like: <Proxy *> Order Allow,Deny Allow from all </Proxy>
Cheers,
Hi,
On 24 Sep 2004, at 16:42, Richard Lewis wrote:
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.
For shame, Richard, for shame. This is not the cocoon-users mailing list, you know ;-)
First question: any particular reason for using Tomcat? C2.1 ships with the excellent Jetty, which blows Tomcat out of the water (or rather, Tomcat usually blows itself out the water when it crashes, and Jetty just sits by and laughs).
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.
Correct.
http://wiki.apache.org/cocoon/ApacheModProxy
apache2/sites-enabled directory:
cursus.uea.ac.uk -> ../sites-available/cursus.uea.ac.uk studios.uea.ac.uk -> ../sites-available/studios.uea.ac.uk ==============================================================
Oh heck. These are on my to-do list. Oops.
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.
Dump Tomcat, run both sites through Jetty (you really -don't- want to run two Cocoon instances, look at mount-table.xml for the quickest way to mangle your Cocoon urlspace safely. Follow the wiki docs, they are very good.
A.
On 2004-09-24 17:02:56 +0100 Andrew Savory lists@andrewsavory.com wrote:
[...] excellent Jetty, which blows Tomcat out of the water [...]
Well, a jetty is usually more suited to water than a tomcat. fx:tumbleweed/