Updated 3/13/2003 for OSX 10.2.4 + Security Update Weird... I installed the security update several days ago, and no the CGI stuff seems to be working just fine again. Go figure!
Updated 2/28/2003 for OSX 10.2.4 Okay, well unfortunately 10.2.4 broke CGI for me (and for some others as well). At first I thought it was just because Apple has replaced httpd.conf, but reconfiguring this doesn't help. Now, anytime I try to access a CGI script, it just spits back the bare code at me. That's no fun! Somebody help! Email me at mike(at)msykes.com!
Updated 10/22/2002 for OSX 10.2 (Jaguar)
Updated 1/5/2004 for OSX 10.3 (Panther)
By default it doesn't seem as if CGI is enabled by OSX's built-in Apache server. (then again neither is Apache, but this is easily enabled by the "Sharing" panel of "System Preferences". Here I will tell you how to enable CGI for all of your web directories.
/etc/httpd/httpd.conf (you should make a backup first). You will need to do this as root, and I prefer using
pico from the command line. (sudo should also work)
pico) for "ExecCGI". Just underneath the first occurence in the document you will see the following
line:Options Indexes FollowSymLinks MultiViews
Options Indexes FollowSymLinks ExecCGI MultiViewsAddHandler". Just underneath the first occurence you will find the line:# AddHandler cgi-script .cgiAddHandler cgi-script .cgi/etc/httpd/users/yourusername.conf (again, make a backup)
Options Indexes MultiViews
Options Indexes ExecCGI MultiViewssudo apachectl restart (thanks to Troy Koelling for pointing this out)
/etc/httpd/users/yourusername.conf files don't actually exist to begin with in Jaguar. If you brought over your
old one from 10.1 it should still work, but those of us who did clean installs don't have this luxury. Taking cues from the
/etc/httpd/httpd.conf file I created my own:
<Directory /Users/yourusername/Sites>
AllowOverride FileInfo AuthConfig Limit
Options ExecCGI MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
<Limit GET POST OPTIONS PROPFIND>
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS PROPFIND>
Order deny,allow
Deny from all
</LimitExcept>
</Directory>
yourusername with your user name!
That's it! Note, that this was only tested on OSX 10.1.2, on a Powerbook G3 333MHz, Powerbook G4 400MHz, and Powerbook G4 550MHz. It shouldn't screw anything up, but do it all at your own risk. Update: Now running on OSX 10.2.1 on a Powerbook G4 800MHz
Copyright 2002 Michael Sykes