开发者

boa webserver, sh script

开发者 https://www.devze.com 2023-01-11 05:03 出处:网络
I have here embedded device with linux. There is a webserver boa. http://www.boa.org/ I am trying to start sh cgi script.

I have here embedded device with linux. There is a webserver boa. http://www.boa.org/

I am trying to start sh cgi script.

#!/bin/sh
echo "Content-type: text/html\n"
echo开发者_StackOverflow "Hello world !"

./script.cgi works, but in webbrowser I get

502 Bad Gateway The CGI was not CGI/1.1 compliant.

Can anyone help me?


Try adding an extra \n on your content-type line.

Also, if there is a problem with your shebang or dos-style line endings, boa will report similarly.


You have to do chmod:

chmod 777 your_cgi_file

or

chmod 755 your_cgi_file


echo -e "Content-type: text/html\r\n\r\n"
0

精彩评论

暂无评论...
验证码 换一张
取 消