You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lenya.apache.org by dr...@sdf-eu.org on 2006/12/28 16:04:11 UTC

Reverse proxying object element links

Hi,

Our object elements have data attributes of the form 
data="foo001/foo001.jpg". foo001.jpg physically lives at 
http://nn.nn.nn.nn:8888/default/live/things/widgets/foo001/foo001.jpg, 
but the image is not being found.

What rules in httpd.conf for mod_rewrite and / or proxy elements in 
publication.xconf would we need to fix this?

Cheers,

James

--

drseuk@sdf-eu.org
SDF-EU Public Access UNIX System - http://sdf-eu.org

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


Re: Reverse proxying object element links

Posted by Jürgen Ragaller <ra...@null-oder-eins.ch>.
Am 04.01.2007 um 11:58 schrieb drseuk@sdf-eu.org:

> Hi,
>
> Rewinding a bit, we have two possible deployment scenarios:
>
> 1. Hosting lenya on an internal server at http://ii.ii.ii.ii:8888  
> with Apache on http://ii.ii.ii.ii:80 (i.e., on the same machine).  
> Our router is configured to forward all requests from outside  
> (i.e., http://ee.ee.ee.ee/) to this machine. We'd like the requests  
> http://ee.ee.ee.ee or http://ee.ee.ee.ee/ to point to the live home  
> page and e.g., http://ee.ee.ee.ee/about.html etc. to go to the  
> appropriate page. Additionally, corresponding internal requests to  
> e.g., http://ii.ii.ii.ii/about.html should also go to the  
> appropriate live page (We don't have an internal DNS server  
> currently). I'm hoping that once this setup is working, changing  
> our domain name www.foo.com to point to http://ee.ee.ee.ee will  
> work as expected.
>
> (Internal) requests to http://ii.ii.ii.ii/admin and external  
> requests to http://ee.ee.ee.ee/admin or http://www.foo.com/admin  
> should go to the login page. Whilst authoring, urls will therefore  
> be prefixed by admin. Obviously this needs to work seamlessly when  
> flicking between live and authoring mode even though the admin (or  
> whatever we call it) prefix will only appear in authoring mode.
>
> 2. Buying external hosting
>
> This would entail the same setup except that there would be no need  
> to directly access the server via. http://ii.ii.ii.ii/ Obviously we  
> also wouldn't need an internal DNS server either.
>
> (If anyone wants to recommend this week's friendly low-cost lenya  
> hosting company, please do!) We'd need a hosting provider who can  
> host a separate lenya instance as we've made changes outside the  
> default publication directory.

Hi James,

Just commenting on a single aspect here:

I went through the evaluation process of a shared hosting provider -  
no luck at all - none of the ones I found had mod_proxy installed  
(mod_rewrite is available in many shared hosting packages). So I  
finally decided to go for a dedicated server - if someone on the list  
knows of a shared hosting solution suitable for lenya I'd be very  
interested to know about that solution.

Jürgen

> Providers, feel free to get in touch to discuss. Ideally any  
> hosting provider would be able to help us with getting it all  
> installed.
>
> To get back to the original question:
>
> Our publication.xconf looks like:
>
>   <proxy area="live" ssl="true" url="https://ii.ii.ii.ii/ssl"/>
>   <proxy area="live" ssl="false" url="http://ii.ii.ii.ii"/>
>   <proxy area="authoring" ssl="true" url="https://ii.ii.ii.ii:8888/ 
> default/authoring"/>
>   <proxy area="authoring" ssl="false" url="http://ii.ii.ii.ii:8888/ 
> default/authoring"/>
>
> Our httpd.conf looks like: As you can see we're out of our depth  
> here and the following is probably mostly incorrect. We're not  
> confident what SERVER_NAME should be (e.g., http://ii.ii.ii.ii/,  
> http://ee.ee.ee.ee/ or http://www.foo.com) for the scenarios  
> described or whether we need combinations of all three to rewrite  
> all requests correctly.
>
> #ProxyRequests Off
> RewriteEngine On
> RewriteLog       "/var/log/httpd-websitelive.log"
> RewriteLogLevel  1
>
> RewriteRule       ^/authoring$ http://%{SERVER_NAME}:8888/default/ 
> authoring/index.html [P]
> RewriteRule       ^(/default/authoring/*.)$ http://%{SERVER_NAME}: 
> 8888$1 [P]
> RewriteRule       ^(/default/live/.*\.html)$ http://%{SERVER_NAME}: 
> 8888$1 [P]
> RewriteRule       ^/(.*\.html)$ http://%{SERVER_NAME}:8888/default/ 
> live/$1 [P]
> RewriteRule       ^/css/(.*\.css)$ http://%{SERVER_NAME}:8888/ 
> default/live/css/$1 [P]
> RewriteRule       ^/default/live/css/(.*\.css)$ http://% 
> {SERVER_NAME}:8888/default/live/css/$1 [P]
> RewriteRule       ^/default/live/images/(.*)$ http://%{SERVER_NAME}: 
> 8888/default/live/images/$1 [P]
> RewriteRule       images/(.*)$ http://%{SERVER_NAME}:8888/default/ 
> live/images/$1 [P]
> #RewriteRule       ^/$ http://%{SERVER_NAME}:8888/default/live/ 
> index.html [P]
> #RewriteRule       ^/(.*\.html)$ http://%{SERVER_NAME}:8888/default/ 
> live/$1 [P]
> #RewriteRule      ^/[^(lenya)](.*) /lenya$0  [R]
> #RewriteRule      ^/static/?(.*)  $0 [L]
> #RewriteRule      ^/(.*)\.php  $0 [L]
>
> # Not carefully tested yet -> login should use https
> #RewriteCond      %{QUERY_STRING} lenya\.usecase=login(.*)
> #RewriteRule      ^/lenya/(.*)/live/(.*)$   https://cms.live.ch/$1/ 
> $2 [R,L]
>
> #RewriteRule      ^/lenya/[^/]+/live/(.*)$ /lenya/$1 [R,L]
>
> #RewriteRule      ^/(.*\.css$) http://%{SERVER_NAME}:8888/$1  [L]
> #RewriteRule      ^/(.*/authoring/.*) http://%{SERVER_NAME}:8888/ 
> $1  [L]
> #RewriteRule      ^/lenya/(.*) http://%{SERVER_NAME}:8888/live/$1  [P]
>
> #ProxyPassReverse  / http://%{SERVER_NAME}:8888/
>
> Regards,
>
> James
>
> On Fri, 29 Dec 2006, Michael Wechner wrote:
>
>> Date: Fri, 29 Dec 2006 09:49:09 +0100
>> From: Michael Wechner <mi...@wyona.com>
>> Reply-To: user@lenya.apache.org
>> To: user@lenya.apache.org
>> Subject: Re: Reverse proxying object element links
>> drseuk@sdf-eu.org wrote:
>>
>>> Hi,
>>> Our object elements have data attributes of the form data="foo001/ 
>>> foo001.jpg". foo001.jpg physically lives at http://nn.nn.nn.nn: 
>>> 8888/default/live/things/widgets/foo001/foo001.jpg, but the image  
>>> is not being found.
>>> What rules in httpd.conf for mod_rewrite and / or proxy elements  
>>> in publication.xconf would we need to fix this?
>>
>>
>> what mapping do you currently have? Something like
>>
>> ProxyPass           /  http://nn.nn.nn.nn:8888/default/live/things/
>> ProxyPassReverse    /  http://nn.nn.nn.nn:8888/default/live/things/
>>
>> ?
>>
>> Michi
>>
>>
>>> Cheers,
>>> James
>>> -- 
>>> drseuk@sdf-eu.org
>>> SDF-EU Public Access UNIX System - http://sdf-eu.org
>>> -------------------------------------------------------------------- 
>>> -
>>> To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
>>> For additional commands, e-mail: user-help@lenya.apache.org
>>
>>
>> -- 
>> Michael Wechner
>> Wyona      -   Open Source Content Management   -    Apache Lenya
>> http://www.wyona.com                      http://lenya.apache.org
>> michael.wechner@wyona.com                        michi@apache.org
>> +41 44 272 91 61
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
>> For additional commands, e-mail: user-help@lenya.apache.org
>>
>
> --
>
> drseuk@sdf-eu.org
> SDF-EU Public Access UNIX System - http://sdf-eu.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
> For additional commands, e-mail: user-help@lenya.apache.org
>







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


Re: Reverse proxying object element links

Posted by dr...@sdf-eu.org.
Hi,

Rewinding a bit, we have two possible deployment scenarios:

1. Hosting lenya on an internal server at http://ii.ii.ii.ii:8888 with 
Apache on http://ii.ii.ii.ii:80 (i.e., on the same machine). Our router is 
configured to forward all requests from outside (i.e., 
http://ee.ee.ee.ee/) to this machine. We'd like the requests 
http://ee.ee.ee.ee or http://ee.ee.ee.ee/ to point to the live home page 
and e.g., http://ee.ee.ee.ee/about.html etc. to go to the appropriate 
page. Additionally, corresponding internal requests to e.g., 
http://ii.ii.ii.ii/about.html should also go to the appropriate live page 
(We don't have an internal DNS server currently). I'm hoping that once 
this setup is working, changing our domain name www.foo.com to point 
to http://ee.ee.ee.ee will work as expected.

(Internal) requests to http://ii.ii.ii.ii/admin and external 
requests to http://ee.ee.ee.ee/admin or http://www.foo.com/admin should go 
to the login page. Whilst authoring, urls will therefore be prefixed by 
admin. Obviously this needs to work seamlessly when flicking between live 
and authoring mode even though the admin (or whatever we call it) prefix 
will only appear in authoring mode.

2. Buying external hosting

This would entail the same setup except that there would be no need to 
directly access the server via. http://ii.ii.ii.ii/ Obviously we also 
wouldn't need an internal DNS server either.

(If anyone wants to recommend this week's friendly low-cost lenya hosting 
company, please do!) We'd need a hosting provider who can host a separate 
lenya instance as we've made changes outside the default publication 
directory. Providers, feel free to get in touch to discuss. Ideally any 
hosting provider would be able to help us with getting it all installed.

To get back to the original question:

Our publication.xconf looks like:

   <proxy area="live" ssl="true" url="https://ii.ii.ii.ii/ssl"/>
   <proxy area="live" ssl="false" url="http://ii.ii.ii.ii"/>
   <proxy area="authoring" ssl="true" 
url="https://ii.ii.ii.ii:8888/default/authoring"/>
   <proxy area="authoring" ssl="false" 
url="http://ii.ii.ii.ii:8888/default/authoring"/>

Our httpd.conf looks like: As you can see we're out of our depth here and 
the following is probably mostly incorrect. We're not confident what 
SERVER_NAME should be (e.g., http://ii.ii.ii.ii/, http://ee.ee.ee.ee/ or 
http://www.foo.com) for the scenarios described or whether we need 
combinations of all three to rewrite all requests correctly.

#ProxyRequests Off
RewriteEngine On
RewriteLog       "/var/log/httpd-websitelive.log"
RewriteLogLevel  1

RewriteRule       ^/authoring$ 
http://%{SERVER_NAME}:8888/default/authoring/index.html [P]
RewriteRule       ^(/default/authoring/*.)$ http://%{SERVER_NAME}:8888$1 
[P]
RewriteRule       ^(/default/live/.*\.html)$ http://%{SERVER_NAME}:8888$1 
[P]
RewriteRule       ^/(.*\.html)$ http://%{SERVER_NAME}:8888/default/live/$1 
[P]
RewriteRule       ^/css/(.*\.css)$ 
http://%{SERVER_NAME}:8888/default/live/css/$1 [P]
RewriteRule       ^/default/live/css/(.*\.css)$ 
http://%{SERVER_NAME}:8888/default/live/css/$1 [P]
RewriteRule       ^/default/live/images/(.*)$ 
http://%{SERVER_NAME}:8888/default/live/images/$1 [P]
RewriteRule       images/(.*)$ 
http://%{SERVER_NAME}:8888/default/live/images/$1 [P]
#RewriteRule       ^/$ http://%{SERVER_NAME}:8888/default/live/index.html 
[P]
#RewriteRule       ^/(.*\.html)$ 
http://%{SERVER_NAME}:8888/default/live/$1 [P]
#RewriteRule      ^/[^(lenya)](.*) /lenya$0  [R]
#RewriteRule      ^/static/?(.*)  $0 [L]
#RewriteRule      ^/(.*)\.php  $0 [L]

# Not carefully tested yet -> login should use https
#RewriteCond      %{QUERY_STRING} lenya\.usecase=login(.*)
#RewriteRule      ^/lenya/(.*)/live/(.*)$   https://cms.live.ch/$1/$2 
[R,L]

#RewriteRule      ^/lenya/[^/]+/live/(.*)$ /lenya/$1 [R,L]

#RewriteRule      ^/(.*\.css$) http://%{SERVER_NAME}:8888/$1  [L]
#RewriteRule      ^/(.*/authoring/.*) http://%{SERVER_NAME}:8888/$1  [L]
#RewriteRule      ^/lenya/(.*) http://%{SERVER_NAME}:8888/live/$1  [P]

#ProxyPassReverse  / http://%{SERVER_NAME}:8888/

Regards,

James

On Fri, 29 Dec 2006, Michael Wechner wrote:

> Date: Fri, 29 Dec 2006 09:49:09 +0100
> From: Michael Wechner <mi...@wyona.com>
> Reply-To: user@lenya.apache.org
> To: user@lenya.apache.org
> Subject: Re: Reverse proxying object element links
> 
> drseuk@sdf-eu.org wrote:
>
>> Hi,
>> 
>> Our object elements have data attributes of the form 
>> data="foo001/foo001.jpg". foo001.jpg physically lives at 
>> http://nn.nn.nn.nn:8888/default/live/things/widgets/foo001/foo001.jpg, but 
>> the image is not being found.
>> 
>> What rules in httpd.conf for mod_rewrite and / or proxy elements in 
>> publication.xconf would we need to fix this?
>
>
> what mapping do you currently have? Something like
>
> ProxyPass           /  http://nn.nn.nn.nn:8888/default/live/things/
> ProxyPassReverse    /  http://nn.nn.nn.nn:8888/default/live/things/
>
> ?
>
> Michi
>
>
>> 
>> Cheers,
>> 
>> James
>> 
>> -- 
>> 
>> drseuk@sdf-eu.org
>> SDF-EU Public Access UNIX System - http://sdf-eu.org
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
>> For additional commands, e-mail: user-help@lenya.apache.org
>> 
>> 
>
>
> -- 
> Michael Wechner
> Wyona      -   Open Source Content Management   -    Apache Lenya
> http://www.wyona.com                      http://lenya.apache.org
> michael.wechner@wyona.com                        michi@apache.org
> +41 44 272 91 61
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
> For additional commands, e-mail: user-help@lenya.apache.org
>

--

drseuk@sdf-eu.org
SDF-EU Public Access UNIX System - http://sdf-eu.org

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


Re: Reverse proxying object element links

Posted by Michael Wechner <mi...@wyona.com>.
drseuk@sdf-eu.org wrote:

> Hi,
>
> Our object elements have data attributes of the form 
> data="foo001/foo001.jpg". foo001.jpg physically lives at 
> http://nn.nn.nn.nn:8888/default/live/things/widgets/foo001/foo001.jpg, 
> but the image is not being found.
>
> What rules in httpd.conf for mod_rewrite and / or proxy elements in 
> publication.xconf would we need to fix this?


what mapping do you currently have? Something like

ProxyPass           /  http://nn.nn.nn.nn:8888/default/live/things/
ProxyPassReverse    /  http://nn.nn.nn.nn:8888/default/live/things/

?

Michi


>
> Cheers,
>
> James
>
> -- 
>
> drseuk@sdf-eu.org
> SDF-EU Public Access UNIX System - http://sdf-eu.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
> For additional commands, e-mail: user-help@lenya.apache.org
>
>


-- 
Michael Wechner
Wyona      -   Open Source Content Management   -    Apache Lenya
http://www.wyona.com                      http://lenya.apache.org
michael.wechner@wyona.com                        michi@apache.org
+41 44 272 91 61


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