Closed RanniSch closed 1 year ago
(index in location is set) http://localhost:8000/cgi-bin/ downloads the python script (on DockerLinux does not segfault anymore): on Docker Linux now is good
Config:
location /cgi-bin
{
allow_methods GET POST;
index first_cgi.py;
cgi_path /bin/bash /usr/bin/python3;
cgi_ext .sh .py;
}
at MaxIhme this config does not work for me: Information: cannot open your config file. Will take default Config. ERROR in Config File: parameter 'cgi_path' should only have between 0 and 1 values
UPDATE from Max: Ahh right, to prevent errors I restricted cgi_path and cgi_ext to have only one variable. You have to do: Config:
location /cgi-bin
{
allow_methods GET POST;
index first_cgi.py;
cgi_path /usr/bin/python3;
cgi_ext .py;
}
http://localhost:8000/cgi-bin/
comes 403 Forbidden - correct behaviour
Config:
location /cgi-bin
{
allow_methods GET POST;
cgi_path /bin/bash /usr/bin/python3;
cgi_ext .sh .py;
}
at MaxIhme same problem like above: Information: cannot open your config file. Will take default Config. ERROR in Config File: parameter 'cgi_path' should only have between 0 and 1 values
Update: solution as above
Config (wrong path to the python interpreter)
location /cgi-bin
{
index first_cgi.py;
allow_methods GET POST;
cgi_path /bin/bash /usr/bin/pytho;
cgi_ext .sh .py;
}
I get: "WRITING back to the socket: 9 fd: 9 error:0 WE HAVE FINISHED WRITING TO THE BROWSER Client Socket: 9 was closed successfuly File deleted successfully: tmp/tmp_file_9 Cgi destructor called! terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc make: *** [Makefile:85: e] Aborted"
->could you both test it (maybe I have a problem with my docker container) @RanniSch @LukasKava
http://localhost:8000/cgi-bin/ -> Bad alloc exception config: location /cgi-bin { allow_methods GET POST; index first_cgi.py; cgi_path /bin/bash;# /usr/bin/python3; cgi_ext .sh .py; }
@MaxIhme I used the actual default.conf file without changing anything. I opend with the browser: http://localhost:8000/cgi-bin/ it automatically goes to: http://localhost:8000/cgi-bin/script-get-2.py&w=d downloads the file and shows error code 404 in the browser.
PROBLEM I also see that the script is downloaded...
It seems like CGI works fine now.
Works fine now
Tested simple CGI with GET request and query variables. Tested with: http://localhost:8000/cgi-bin/script-get-2.py?a=b&c=d
Tested simple CGI with POST request. Tested with: http://localhost:8000/cgi-bin/script-post-2.py
solved max: for me it gives error 508 at MaxIhme can you try it again? For me it works fine. Maybe there was still the retun 508 in, to test the error code. Max: both adresses work fine via DockerLinux