Serving files from a WAFileLibrary behind Apache

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Serving files from a WAFileLibrary behind Apache

Thelliez
I implemented James instructions at
http://programminggems.wordpress.com/2008/09/12/slice-4/ to have
GLASS+Seaside30 behind Apache on CentOS.  It worked.

Well, almost... The files under my WAFileLibrary subclass are not
served correctly.  They have a url like:
'/files/myWAFileLibrary/myCSS.css'.  They should be
'/myApp//files/myWAFileLibrary/myCSS.css'.

I do not anything wrong with James ProxyPass and ProxyPassReverse
code.  Is there something I need to do on the FileLibrary side?


Thanks,
Thierry
Reply | Threaded
Open this post in threaded view
|

Re: Serving files from a WAFileLibrary behind Apache

James Foster-8
Hi Thierry,

I haven't tried to serve static files from Seaside through Apache since the recommended practice is to let Apache serve static files. Would that work for you? If not, then you might be able to set up the Apache config to proxy or rewrite from /files to /myApp/files (and this is really beyond my area of expertise). Perhaps the following addition to the config file might be a starting point:

        ProxyPass /files balancer://filestrio
        ProxyPassReverse /files balancer://filestrio
        <Proxy balancer://filestrio>
            Order allow,deny
            Allow from all
            BalancerMember http://localhost:8081/myApp/files
            BalancerMember http://localhost:8082/myApp/files
            BalancerMember http://localhost:8083/myApp/files
        </Proxy>

Notice that I simply copied the existing proxy rewrite and replaced 'seaside' with 'files' and 'gemtrio' with 'filestrio' and added 'files' to the BalancerMember.

James

On Oct 23, 2010, at 9:09 AM, Thierry Thelliez wrote:

> I implemented James instructions at
> http://programminggems.wordpress.com/2008/09/12/slice-4/ to have
> GLASS+Seaside30 behind Apache on CentOS.  It worked.
>
> Well, almost... The files under my WAFileLibrary subclass are not
> served correctly.  They have a url like:
> '/files/myWAFileLibrary/myCSS.css'.  They should be
> '/myApp//files/myWAFileLibrary/myCSS.css'.
>
> I do not anything wrong with James ProxyPass and ProxyPassReverse
> code.  Is there something I need to do on the FileLibrary side?
>
>
> Thanks,
> Thierry

Reply | Threaded
Open this post in threaded view
|

Re: Serving files from a WAFileLibrary behind Apache

Diogenes Moreira
Hi, In Fact the better way is server the static, such a static file.

in other word, you must save the static file in you file system..(seaside provide this functionality in a button in the config application).

and then apache serve the file without colaboration 

something like that:

       ProxyPass /files/seaside  !
       AliasMatch /seaside/files/*  /path/to/root/application
       <Proxy balancer://filestrio>
           Order allow,deny
           Allow from all
           BalancerMember http://localhost:8081/myApp
           BalancerMember http://localhost:8082/myApp
           BalancerMember http://localhost:8083/myApp
       </Proxy>

am i clear..??

Best Regards.

On Mon, Oct 25, 2010 at 2:21 PM, James Foster <[hidden email]> wrote:
Hi Thierry,

I haven't tried to serve static files from Seaside through Apache since the recommended practice is to let Apache serve static files. Would that work for you? If not, then you might be able to set up the Apache config to proxy or rewrite from /files to /myApp/files (and this is really beyond my area of expertise). Perhaps the following addition to the config file might be a starting point:

       ProxyPass /files balancer://filestrio
       ProxyPassReverse /files balancer://filestrio
       <Proxy balancer://filestrio>
           Order allow,deny
           Allow from all
           BalancerMember http://localhost:8081/myApp/files
           BalancerMember http://localhost:8082/myApp/files
           BalancerMember http://localhost:8083/myApp/files
       </Proxy>

Notice that I simply copied the existing proxy rewrite and replaced 'seaside' with 'files' and 'gemtrio' with 'filestrio' and added 'files' to the BalancerMember.

James

On Oct 23, 2010, at 9:09 AM, Thierry Thelliez wrote:

> I implemented James instructions at
> http://programminggems.wordpress.com/2008/09/12/slice-4/ to have
> GLASS+Seaside30 behind Apache on CentOS.  It worked.
>
> Well, almost... The files under my WAFileLibrary subclass are not
> served correctly.  They have a url like:
> '/files/myWAFileLibrary/myCSS.css'.  They should be
> '/myApp//files/myWAFileLibrary/myCSS.css'.
>
> I do not anything wrong with James ProxyPass and ProxyPassReverse
> code.  Is there something I need to do on the FileLibrary side?
>
>
> Thanks,
> Thierry


Reply | Threaded
Open this post in threaded view
|

Re: Serving files from a WAFileLibrary behind Apache

NorbertHartl
In reply to this post by Thelliez

On 23.10.2010, at 18:09, Thierry Thelliez wrote:

> I implemented James instructions at
> http://programminggems.wordpress.com/2008/09/12/slice-4/ to have
> GLASS+Seaside30 behind Apache on CentOS.  It worked.
>
> Well, almost... The files under my WAFileLibrary subclass are not
> served correctly.  They have a url like:
> '/files/myWAFileLibrary/myCSS.css'.  They should be
> '/myApp//files/myWAFileLibrary/myCSS.css'.
>
> I do not anything wrong with James ProxyPass and ProxyPassReverse
> code.  Is there something I need to do on the FileLibrary side?
>
Can you elaborate a little more on what you are trying to achieve? It sounds that you suspect the file library not to work correct. In the default installation the file libraries are served by a seaside application that is mounted on /files. That means you have one file library for all applications. You can configure the libraries being served in the configuration of the file library application. If you really need to have the file libraries below (path wise) your application this needs a little bit of tweaking but I don't have experience with this. I'm fine with one file library. My setup for all my applications is from a webserver perspective

/static -> serves static files not contacting seaside
/files -> is redirected to the /files application
/  -> the default is redirected to my own application mounted on /myapp

In my app I configure the server path to be /.

Hope this helps,

Norbert

Reply | Threaded
Open this post in threaded view
|

Re: Serving files from a WAFileLibrary behind Apache

Thelliez
In reply to this post by Diogenes Moreira
Thanks all.

The files will be eventually be moved from the File Library to static files.

But just by curiosity, there is a difference in URL path that I do not
understand:

On a system running Seaside 2.8 and Hyper, URLs for css files are
something like:  /seaside/files/WAStandardFiles/myCss.css

On a system running Seaside 3.0 and FastCGI, I see
/files/MyFileLibrary/myCss.css


Is that expected?

(BTW, is there some documentation about the difference between Seaside
2.8 and 3.0?)
Thanks,
Thierry
Reply | Threaded
Open this post in threaded view
|

Re: Serving files from a WAFileLibrary behind Apache

Philippe Marschall
2010/10/29 Thierry Thelliez <[hidden email]>:

> Thanks all.
>
> The files will be eventually be moved from the File Library to static files.
>
> But just by curiosity, there is a difference in URL path that I do not
> understand:
>
> On a system running Seaside 2.8 and Hyper, URLs for css files are
> something like:  /seaside/files/WAStandardFiles/myCss.css
>
> On a system running Seaside 3.0 and FastCGI, I see
> /files/MyFileLibrary/myCss.css
>
>
> Is that expected?

Yes, we removed the /seaside from the path.

> (BTW, is there some documentation about the difference between Seaside
> 2.8 and 3.0?)

http://www.seaside.st/community/development/seaside30

Cheers
Philippe