writing files on HD vs overwriting files on Apache CGI

Richard MacLemale rmaclema at pasco.k12.fl.us
Thu Feb 20 12:37:01 EST 2003


How the script is executed is something to consider.

When you run Apache and you call a cgi script, that script is run AS a user,
usually the user "www."  So if you want to be able to write a file to a
directory that the "www" user does not have write privileges in, you're
outta luck.

However, it is possible to have a metacard script execute using the
permissions of the person who OWNS the script itself.  So if admin owned the
script, you could set the permissions like:
chmod 755 mymetacardscript.mt

And then set it to run as if "admin" was running it like this:

chmod a+s my metacardscript.mt

The same thing works if root owns the file, by the way.  However I think
running cgi scripts AS root is something that old-time UNIX veterans would
cough up a lung over.  :)  Better to have a designated user name own the
script and make sure that user has permissions to do whatever you want.


-- 
:)
Richard MacLemale
Network Administrator
J. W. Mitchell High School




More information about the metacard mailing list