Bengt Törnqvist writes:
> With an earlier Raspian version I have succeeded in execution of cgi
> scripts. Now it seems to me that the process to enable cgi execution
> has been modified.
>
>
> My test script, presently "open" for all users "-rwxrwxrwx 1 root
> root...", in the /usr/lib/cgi-bin/ folder is:
Very bad choice of permissions, it should be 755 root:root. Ignore the
person who says it should owned by www-data, that is not a secure
configuration.
> #!/bin/bash
> echo -e "Content-type: text/html\n\n"
> echo ""
>
> echo "This is start of test.cgi"
>
> echo "#!/bin/bash" >test1.script
> echo "echo \"This is test1.script\"" >>test1.script
> chmod 755 test1.script
> /usr/lib/cgi-bin/test1.script
>
> echo "This is end of test.cgi"
> echo ""
>
> The result in a browser screen becomes:
>
> This is start of test.cgi
> This is end of test.cgi
>
>
> The /var/log/apache2/error.log shows:
>
> .../usr/lib/cgi-bin/test.cgi: line 10: /usr/lib/cgi-bin/test1.script:
> No such file or directory: /usr/lib/cgi-bin/test.cgi, referer...
>
> Obviously some configuration to allow the cgi script to execute and
> write is missing. I can however not find out where and how.
Your script is running, what is happening is that it’s failing to run
the script it creates as part of its operation. But you shouldn’t try to
debug that, because it’s a ridiculous thing to do.
--
https://www.greenend.org.uk/rjk/
--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)
|