cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Derek Hohls" <DHo...@csir.co.za>
Subject Re: Cocoon with Virtual Hosts (apache/tomcat)
Date Wed, 19 Jan 2005 10:32:09 GMT
Upayavira

Apparently that was tried as well .... the problem in that
case is that the :8080 is still retained in the response 
coming back from the ProxyPassReverse and so the 
site is then effectively not viewable from outside the local
network.

Any other ideas?

Derek


>>> uv@upaya.co.uk 2005/01/19 11:55:18 AM >>>
Derek Hohls wrote:

>I am working with Apache/Tomcat and Cocoon 2.1.5. 
>I am trying to have a virtual host setup, so users from
>outside the organisation can access the site.
>
>
>In the Apache httpd.conf file, the Unix admin has inserted
>(note that I have changed some actual parameters for security...)
>the following (NB: I have been told that the warp connnector
>option *cannot* be setup... we need to use a proxy rewrite)
>
><VirtualHost 0.0.0.0>
>ServerAdmin me@here.com 
>ServerName soc.myserver.com:80
>DocumentRoot /usr/local/tomcat/webapps
>
>RewriteEngine   on
># If URL has cocoon215/soc(/) we don't rewrite, therefore Last rule
>RewriteRule ^/cocoon215/soc/(.*)      /cocoon215/soc/$1 [R,L]
>RewriteRule ^/cocoon215/soc$         /cocoon215/soc [R,L]
># Else we must rewrite
>#RewriteRule ^/$        /cocoon215/soc [R,L]
>RewriteRule ^/(.*)        /cocoon215/soc/$1 [R,L]
># We reverse proxy instead of Warp connector 
>ProxyPass /cocoon215/soc http://localhost:8080/cocoon215/soc 
>ProxyPassReverse /cocoon215/soc http://localhost:8080/cocoon215/soc 
></VirtualHost>
>
>
>In my sitemap I have:
>
><map:match pattern="pageTest">
>  <map:generate src="docs/test.xml"/>
>  <map:transform src="stylesheets/doc/test-page2html.xsl">
>   <map:parameter name="use-request-parameters" value="true"/>
>   <map:parameter name="contextPath" value="{request:contextPath}"/>
>   <map:parameter name="servletPath" value="{request:servletPath}"/>
>   <map:parameter name="serverName" value="{request:serverName}"/>
>   <map:parameter name="serverPort" value="{request:serverPort}"/>   

>
>  </map:transform>    
>  <map:serialize/>      
></map:match> 
>
>
>In the stylesheet (test-page2html.xsl) I have:
>
><xsl:param name="contextPath"/>
><xsl:param name="servletPath"/>
><xsl:param name="serverName"/>
><xsl:param name="serverPort"/>
>...
><p>Context=<xsl:value-of select="$contextPath"/></p>
><p>Servlet=<xsl:value-of select="$servletPath"/></p>
><p>Server=<xsl:value-of select="$serverName"/></p>
><p>Port=<xsl:value-of select="$serverPort"/></p>
>
>
>But, whether I try 
>http://myserver.com:8080/cocoon215/soc/pageTest 
>or
>http://soc.myserver.com/cocoon215/soc/pageTest 
>
>I have the same results:
>
>Context=/cocoon215
>Servlet=/soc/pageTest
>Server=myserver.com
>Port=8080
>
>
>In order for the application to work properly, 
>what do I need to do to get to this:
>
>Context=/cocoon215
>Servlet=/soc/pageTest
>Server=soc.myserver.com
>Port=[null]
>
>Any ideas how?
>  
>
Cocoon will see the hostname as being the one supplied from Apache. You

have:

ProxyPass /cocoon215/soc http://localhost:8080/cocoon215/soc 
ProxyPassReverse /cocoon215/soc http://localhost:8080/cocoon215/soc 

So Cocoon should see localhost. You could replace this with
soc.myserver.com. If that points to an external IP address, add:
127.0.0.1  soc.myserver.com
to your /etc/hosts file.

Make sense?

Regards, Upayavira




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org 
For additional commands, e-mail: users-help@cocoon.apache.org 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message