Apache UserDir cgi-bin configuration

I use blosxom as a simple blog at work. I have two bash functions that allow me to use the blog as a timelog. Whenever I change workstations, my blog breaks for a while until I get around to relearning how to setup cgi for user directory’s. This time, I’m writing it down! 🙂

First, make sure you are loading mod_userdir. Since I’m doing this on Ubuntu 10.10 and using Apache2.2, I get root and cd into /etc/apache2/mods-enabled and run:

ln -s ../mods-available/userdir.load ./
ln -s ../mods-available/userdir.conf ./

and then I change the userdir.conf to look like this:

<IfModule mod_userdir.c>
        UserDir www
        UserDir disabled root

        <Directory /home/*/www>
                AllowOverride FileInfo AuthConfig Limit Indexes
                Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
                <Limit GET POST OPTIONS>
                        Order allow,deny
                        Allow from all
                </Limit>
                <LimitExcept GET POST OPTIONS>
                        Order deny,allow
                        Deny from all
                </LimitExcept>
        </Directory>

        ScriptAliasMatch ^/~([^/]*)/cgi-bin/(.*) /home/$1/www/cgi-bin/$2
        <Directory /home/*/www/cgi-bin>
            Options +ExecCGI
            SetHandler cgi-script
            AllowOverride None
            Order allow,deny
            Allow from all
        </Directory>

</IfModule>

SUSE and RedHat related distros put the configs in different places. The general idea, though, is the same: get Apache to load the userdir module and then configure it.

Thanks very much to “mastercomputers” for her (his?) post about this at:

http://www.astahost.com/info.php/apaches-userdir-very-own-cgi-bin_t3698.html

Leave a Reply

You must be logged in to post a comment.