I am unable to serve or execute a cgi file, and the cause seems to be that chroot is unable to find the cgi file when the permission is set to executable.
$>ls -l /var/www/my/dir/test.cgi -rwxr-xr-x 1 root daemon 67 May 19 15:45 /var/www/my/dir/test.cgi $> chroot /var/www/ /my/dir/test.cgi chroot: /my/dir/test.cgi: No such file or directory
Why can chroot not find the file?
If I change the permissions to remove execution,
$> chmod 644 /var/www/my/dir/test.cgi, then run the same chroot command, the file is found, but permission is denied.
$> chroot /var/www/ /my/dir/test.cgi chroot: /my/dir/test.cgi: Permission denied
The system is OpenBSD 5.7. I was testing using chroot to try to mimic what the httpd webserver does, because in the log /var/log/daemon, there is a similar message from slowcgi after trying to access the file:
slowcgi execve /my/dir/index.cgi: No such file or directory
Thanks in advance.
$> chroot /var/wwwi get an error saying no shell is found. how should i set that?
print 'hello'perl script with shebang on top
ldd <command>to find required dependencies for any command, then just copy paste em into same directory structure.