[Seaside] SULibrary and File Serving

Richard Eng richard.eng at rogers.com
Mon Oct 8 16:59:15 UTC 2007

I've solved my problems!!! After *much* trial and error (and after *much*
hair-pulling), I've learned a number of important lessons. And just so none
of you go through the same hell that I did, I'm going to impart my
hard-earned knowledge to you...

(Here's the final httpd.conf I'm using:

LoadModule  proxy_module  /usr/lib/apache2/modules/mod_proxy.so
LoadModule  proxy_http_module  /usr/lib/apache2/modules/mod_proxy_http.so
LoadModule  rewrite_module  /usr/lib/apache2/modules/mod_rewrite.so


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]

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. 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.

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:


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.

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.


More information about the seaside mailing list