[Instantrails-users] typo installation, httpd configuration

David Morton mortonda at dgrmm.net
Tue Dec 13 19:10:39 EST 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I have updated the wiki to show how to install typo.  Ineffect, it's really
quite simple, hardly any changes are needed; just the usual vhost and .htaccess
modifications.  All of the routing problems were only visible on Apache2, and
theming issues are with the themes, not typo.

On that note, the default VirtualHost entry that comes with Instant Rails needs
updating, it's way to complicated.

<VirtualHost *>
    ServerName www.mycookbook.com
    # handle all requests through SCGI
    # CHANGE #1: change to /scgi-bin/
    SCGIMount /scgi-bin/ 127.0.0.1:9999
    DocumentRoot ${path}/rails_apps/cookbook/public
    <Directory ${path}/rails_apps/cookbook/public>
        Options +FollowSymLinks
        Order allow,deny
        allow from all
    </Directory>
    AddDefaultCharset utf-8
    ErrorDocument 500 /500.html
    ErrorDocument 404 /404.html
#CHANGE #2: remove everything below
#    # matches locations with a dot following at least one more characters,
#    # that is, things like   *.html, *.css, *.js, which should be delivered
#    # directly from the filesystem. Also matches the following
#    # subdirectories: images, javascript(s), stylesheets
#    <LocationMatch ^/(images|javascript|javascripts|stylesheets|[^/]+\.[^/]+$)>
#        # don't handle those with SCGI
#        SCGIHandler Off
#    </LocationMatch>
#    <LocationMatch "^/$">
#        # don't handle just / with SCGI
#        SCGIHandler Off
#   </LocationMatch>
</VirtualHost>

Or, as one unit, here's what it should be:

<VirtualHost *>
    ServerName www.mycookbook.com
    # Set up SCGI handler
    SCGIMount /scgi-bin/ 127.0.0.1:9999
    DocumentRoot ${path}/rails_apps/cookbook/public
    <Directory ${path}/rails_apps/cookbook/public>
        Options +FollowSymLinks
        Order allow,deny
        allow from all
    </Directory>
    AddDefaultCharset utf-8
    ErrorDocument 500 /500.html
    ErrorDocument 404 /404.html
</VirtualHost>

Also, I see this:

# First, we configure the "default" to be a very restrictive set of
# permissions.
#
<Directory />
    Options FollowSymLinks Indexes
    AllowOverride All
</Directory>

That's not very secure.  It would be more secure to move the "AllowOverride All"
into each Vhost; so any vhost created won't allow .htaccess unless explicitly
allowed.


Finally:  the default .htaccess should have:

RewriteRule ^(.*)$ /scgi-bin/%{REQUEST_URI} [QSA,L]


- --
David Morton
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

iD8DBQFDn2L/SIxC85HZHLMRAnhzAKCOeRBt4ChIkh+ai4BrkwCYm7cRBACdFGj/
h6K3RVefCMuT4QPRfBu6KgY=
=C1RG
-----END PGP SIGNATURE-----


More information about the Instantrails-users mailing list