If you’re in the process of setting up a new server, and you want users to have the ability to execute scripts in their home directory:

http://myserver.com/~myname

You will often run into problems with suexec. suexec is an apache security construct to stop users from executing scripts outside of a known path.

I was recieving the following error in my suexec.log file:

[2008-05-02 15:45:40]: command not in
         docroot (/path/to/my/script/here/)

If your server isn’t connected to the internet, or you have strict control over who has accounts on it, it’s quite safe (in my opinion) to remove the suexec restriction and subsequently resolve the errors caused by it. To do this, remove the suexec options in conf(s) files : httpd.conf and/or extra/httpd-vhosts.conf.

For example, in Apache 2 – in all sections, comment or remove the “SuexecUserGroup xxx yyy” line.

This will remove the suexec controls, which will prompt apache to drop the security checks associated with it and allow your script to execute.

Alternatively you can re-configure Apache at compilation time without the “–enable-suexec” option.