[Seaside] SULibrary and File Serving

Cédrick Béler cbeler at enit.fr
Mon Oct 8 17:12:28 UTC 2007

> NameVirtualHost
> <VirtualHost>
> RewriteEngine     on
> ProxyRequests     off
> DocumentRoot      /var/www
> ProxyPass         /seaside/go  http://localhost:9090/seaside/go
> ProxyPassReverse  /seaside/go  http://localhost:9090/seaside/go
> RewriteRule       ^/$  http://localhost:9090/seaside/go/$1 [P,L]
> </VirtualHost>
> It doesn't matter how the Seaside image itself, ie, WAKom, is configured for
> file serving.)
> First, despite what Lukas said, you *do* need the ProxyPass and
> ProxyPassReverse directives in Apache. 
not me ...

see joined file ;) I think it's based on Ramon's conf file...

> When I used the rewrite rule by
> itself, I ran into the same problem I experienced before with the Seaside
> 2.8 beta dev image, ie, the initial home page rendered correctly and with
> the correct IP address prefix, but navigating to subsequent pages got me the
> "localhost:9090" prefix.
maybe ProxyPreserveHost On
> Second, the #setFocus on text input field problem I alluded to earlier is a
> direct consequence of the file serving problem, which is the primary focus
> of this message thread.
> Third, the whole issue boils down to where, *exactly*, is Seaside looking
> for the library files. Various blog posts were not entirely accurate, and
> therefore misleading. My final clue to the mystery came from Seaside
> config's "file" configuration. This led me to surmise that perhaps the
> proper Seaside URL for locating its internal library files was
> /seaside/files/SULibrary/scriptaculous.js, for example.
> Now the next question was, to what filesystem folder should this URL be
> based? Since Apache is configured to serve files only from /var/www, it made
> sense that the Seaside URL should be here. So I moved all the files I
> extracted from Seaside (WAStandardFiles and SULibrary) to:
> /var/www/seaside/files/WAStandardFiles
> /var/www/seaside/files/SULibrary
> Fourth, in order for the file serving to work properly, the ProxyPass
> directives must be coded correctly. This means that, for example,
> ProxyPass         /seaside/go  http://localhost:9090/seaside/go
> ...is correct, but
> ProxyPass         /go  http://localhost:9090/seaside/go
> ...is incorrect. "/seaside/go" must match with "localhost:9090/seaside/go".
> This is where I went wrong in my original httpd.conf file.
> One final comment: My approach to problem-solving is to distill everything
> to the simplest basis. While there are several instances of Apache
> configuration in various Seaside blogs, they tend to be fairly complicated
> and therefore it is difficult to understand how or why they work.
yes we need to add a clear faq on this....
> This post simplifies to, and focuses on, the absolute minimum basics. From
> here, you can get as fancy as you like. It is not good to start off with a
> complicated httpd.conf configuration.

-------------- next part --------------
NameVirtualHost *:80

<VirtualHost *:80>
    ServerName localhost
    DocumentRoot /var/www/seaside/
    RewriteEngine On
    ProxyRequests Off
    ProxyPreserveHost On
    UseCanonicalName Off
    # http compression
    DeflateCompressionLevel 5
    SetOutputFilter DEFLATE
    AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/javascript text/css
    BrowserMatch ^Mozilla/4 gzip-only-text/html
    BrowserMatch ^Mozilla/4.0[678] no-gzip
    BrowserMatch bMSIE !no-gzip !gzip-only-text/html

    #proxy to seaside if file not found
    RewriteRule ^/(.*)$ http://localhost:8080/$1 [P,L]

    # Logfiles
    ErrorLog  /var/log/apache2/seaside.error.log
    CustomLog /var/log/apache2/seaside.access.log combined

<Proxy *>
    Order allow,deny
    Allow from all

<Directory proxy:*>
    Order allow,deny
    Allow from all

ProxyVia Block

#<Directory "/var/www/seaside/">
#        Options Indexes MultiViews
#        AllowOverride None
#        Order allow,deny
#        Allow from all
#    </Directory>

More information about the seaside mailing list