apache suexec "command not in docroot"

suEXEC has its own docroot which is totally independent of whatever you configure in your Apache config. You can see what suEXEC's docroot is by calling:

suexec -V

You may need to be root for that. In my case the docroot was /var/www. You'll have to put your scripts there. There is no way to change this save recompiling suEXEC. Don't try to use symbolic links to keep your scripts outside of /var/www (or whatever your suEXEC is configured to).

Edit: as mentioned by @insaner in the comments the command is probably suexec or as I have seen on at least one server suexec2. suEXEC is just what the Apache documentation calls the module/feature.


There is a config in /etc/apache2/suexec/www-data with below first 2 lines if you are using apache2-suexec-custom package.

/var/www
public_html/cgi-bin

You need to replace those lines with your setup. There SHOULD be 2 lines. Giving only one line will through error.

I used something like below,

home
cgi-bin