What is the fastest way to get Pier up and running for
production?
(how's that for an open-ended question!)
Yes, this is definitely an open-ended question.
Three possible answers from my side:
1. Of course you can just run your Squeak image on port 80, but then
you probably need to run it as root to be able to listen on port 80:
nohup squeak -vm-display-null pier.image &
That is probably the easiest solution to run a seaside application on
your own linux box, but certainly not the best one.
2. The setup on my own gentoo linux looks slightly more complicated.
First of all I use daemon-tools <http://cr.yp.to/daemontools.html> to
make sure the image runs all the time. The startup-script looks like:
#!/bin/sh
exec \
nice \
setuidgid apache \
squeak -vm-sound-null -vm-display-null pier.image
Inside the image I have Seaside listening on port 9002, as well as a
vnc-server to manage, update and fix the running code. Then I have
Apache 2 running that is responsible to do the virtual-hosting and
the static file serving. The configuration looks like:
<VirtualHost
www.lukas-renggli.ch:80>
DocumentRoot /home/apache/www.lukas-renggli.ch
<Directory /home/apache/www.lukas-renggli.ch>
Order deny,allow
Allow from all
</Directory>
ProxyPreserveHost On
RewriteEngine On
RewriteCond /home/apache/www.lukas-renggli.ch/%{REQUEST_FILENAME} !-f
RewriteRule ^/(.*)$
http://localhost:9002/seaside/pier/$1 [P,L]
</VirtualHost>
The first half of this file are standard-things. Then
"ProxyPreserveHost On" enables Seaside to get absolute paths
correctly. The rewrite rule maps the static file-system into the same
URL space as the one of the Squeak image. Basically it tells apache
to serve the static file if it is available, else it will proxy the
request to Seaside.
3. The third option is nothing I can talk about right now, but it
will be certainly announced during this or the next week ;-)
Cheers,
Lukas
--
Lukas Renggli
http://www.lukas-renggli.ch