-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I’m attempting to set up typo using the SCGI runner. As near as I can
tell,
here’s what happens, please tell me if I’m wrong:
The instructions for scgi and rails:
seem to indicate to set the scgi base to /scgi-bin/:
SCGIMount /scgi-bin/ 127.0.0.1:9999
and not
SCGIMount / 127.0.0.1:9999
as I would have done on first thought. Thinking about it, I conclude
that if
the scgi engine is on / and not /scgi-bin/, then a conditional rewrite
rule
isn’t needed/can’t be made, and thus page caching cannot work; apache
won’t
bypass running SCGI, which is how caching works.
By placing the scgi engine on /scgi-bin/, we use a conditional rewrite
to run
scgi if a cached file is not found:
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /scgi-bin/$1 [QSA,L]
This introduces an ugly sgci-bin into our url, so the workaround is to
double up
on the routes:
map.connect ‘:controller/:action/:id’
map.connect ‘scgi-bin/:controller/:action/:id’
which makes rails recognize the scgi-bin part of the path, and still
write
pretty urls too. However, this is kinda repetitive when one uses a
bunch of
routes, as typo does.
So, in the end, I think I can get typo running in one of two ways:
1: mount scgi on /, leave routing alone, don’t use a rewriting rule.
Everything
works, except no page caching can be done, because there’s no way to
avoid scgi.
2: mount scgi on /scgi-bin and all taht, and add all the route commands
to
rewrite the scgi-bin out of the request. Now routing will work.
In the end, we have a problem that in order to use SCGI, we either
violate DRY
or we can’t cache pages.
David M.
Maia Mailguard - http://www.maiamailguard.com
Morton Software Design and Consulting - http://www.dgrmm.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFDe1HASIxC85HZHLMRAqnMAJ9VYHnuPhp3/j1oG/1C9pYPTzHajQCdEGhI
3YmE/KhsB+cFLdQ6CaY2UiI=
=Q1DE
-----END PGP SIGNATURE-----