Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Use AppleScripts to generate web pages' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Use AppleScripts to generate web pages
Authored by: inchhigh on Dec 22, '03 11:20:23AM
you run the webserver as it's own user/group so that you can control what can be accessed from the webserver. Thus if there is a security problem with the webserver, or a badly designed script, you can limit the possible damage. In most cases if someone were to exploit a hole in apache (unlikely in current versions) or a hole in a badly designed script (much more likely) they may be able to execute code with the privileges of the user the webserver is running as. So if the webserver is running as you, all of your files would be available with both read AND write access.

If you are going to use this technique for running applescripts, I would recommend going a little farther and figuring out why the scripts won't run when the user/group is www. I'm guessing perhaps the scripts don't have execute permissions for www, and they do for the user that created them, thus when you change the user to yourself, they run. A much better idea would be to create a new group (webgroup) and add yourself and www to it, then assign the group ownership of the scripts to that new group, and make sure that the group permissions allow executing.

chgrp webgroup scriptname
chmod g+rx scriptname

or if you don't want to go about creating a new group, just set the group to www

chgrp www scriptname
chmod g+rx scriptname

I have not tested this with applescripts, but this is the general rule with all other scripts running under apache.

[ Reply to This | # ]