On 1/30/2018 12:27, Bengt Törnqvist wrote:
> 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:
>
> #!/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.
>
> I kindly ask for assistance and advises.
>
You've got a lot of problems with that. First the name of your script
is test.script but it looks like you are trying to run test.cgi. Your
code for your script is bad too. Try using a text editor to create your
cgi script in /usr/lib/cgi-bin. It should be owned by www-data and have
755 permissions. Then try running it to make sure it
works, ./test.cgi. It should print out:
Content-type: text/html
This is start of test.cgi
This is end of test.cgi
If it doesn't it isn't going to work.
--
Knute Johnson
--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)
|