I'm trying to set lighttpd with suexec, but something goes wrong on testing: when I try to launch something via suexec, it gives me in log:
[2017-10-08 00:23:24]: invalid command (/srv/http/main/htdocs/cgi-bin/test.py)
Output of suexec -V
:
-D AP_DOC_ROOT="/srv/http"
-D AP_GID_MIN=100
-D AP_HTTPD_USER="lighttpd"
-D AP_LOG_EXEC="/var/log/lighttpd/suexec.log"
-D AP_SAFE_PATH="/usr/local/bin:/usr/bin:/bin"
-D AP_UID_MIN=100
-D AP_USERDIR_SUFFIX="public_html"
Wrapper which I use to launch programs:
#!/bin/bash
filename="$1"
user="$(/usr/bin/stat -c "%U" "$filename")
group="$(/usr/bin/stat -c "%G" "$filename")
cd "$(dirname "$filename")"
/usr/local/bin/suexec "$user" "$group" "$filename"
Permissions are alright, no rogue write bits set. Trying from both userdirs (/home/$USER/public_html
) and from docroot.