Quick question regards enabling CGI

fotobroker

Registered
I have searched this forum (and others) read the Apache documentation and yet I am still struggling with the following problem.

I have just migrated to OSX.1 from OS9.1 and I am also new to UNIX but am I having fun and enjoying it. I've installed and compiled things like ImageMagick and PerlMagick, MySQL and a myriad of other perl modules (with a lot of thanks to some great forums).

It's not all good news though, I can't seem to get cgi scripts to run from a users directory. For instance, http://localhost/~user/ takes me to a users web page but if I then create a cgi-bin in the Sites folder of the ~user directory and call it using http://localhost/~user/cgi-bin/script.cgi I get an error 403 (no permission). I have uncommented the httpd.conf file etc.. but still no joy.

Can any one of you 'gurus' offer any suggestions about where I'm going wrong.
 
I should have looked deeper than I had in the Apache documentation.

ScriptAliasMatch is the answer

ScriptAliasMatch ^/~([^/]*)/cgi-bin/(.*) /Users/$1/cgi-bin/$2

Put this line in your httpd.conf file and you can then allow your users to create a folder in their [user] folder below the Sites folder.

So htttp://localhost/~user/cgi-bin/script.cgi will look in /Users/user/cgi-bin folder for a script called script.cgi

Hope this will help others.. or if there is better way to do this I'd be happy to hear about it.
 
Back
Top