Mailing List Archive

Cherokee, CGI and Bash script, 500 error
Hi folks. I'm new to Cherokee, running it on a Linksys NSLU2 "slug".

I'm trying to get a shell script to run via CGI from Cherokee, but I'm
getting a "500 Internal Server Error". Could anyone help me troubleshoot?

-------------------------------
My Bash script is:

#!/bin/sh
echo "Content-type: text/html\n\n"
echo "<html><head><title>First CGI page!</title></head>"
echo "<body>
Hello World
</body></html>"
'-------------------------------

Web root is: /opt/share/www/cherokee
Cgi-bin is: /opt/share/cherokee/cgi-bin

--
View this message in context: http://cherokee-web-server-general.1049476.n5.nabble.com/Cherokee-CGI-and-Bash-script-500-error-tp5011553p5011553.html
Sent from the Cherokee Web Server - General mailing list archive at Nabble.com.
_______________________________________________
Cherokee mailing list
Cherokee@lists.octality.com
http://lists.octality.com/listinfo/cherokee
Re: Cherokee, CGI and Bash script, 500 error [ In reply to ]
Anything in the error log? Are you sure the script is executable for
everyone (chmod a+x whatever.sh)

On Tue, Nov 22, 2011 at 7:15 AM, JK <mail@jonathankerr.co.uk> wrote:

> Hi folks. I'm new to Cherokee, running it on a Linksys NSLU2 "slug".
>
> I'm trying to get a shell script to run via CGI from Cherokee, but I'm
> getting a "500 Internal Server Error". Could anyone help me troubleshoot?
>
> -------------------------------
> My Bash script is:
>
> #!/bin/sh
> echo "Content-type: text/html\n\n"
> echo "<html><head><title>First CGI page!</title></head>"
> echo "<body>
> Hello World
> </body></html>"
> '-------------------------------
>
> Web root is: /opt/share/www/cherokee
> Cgi-bin is: /opt/share/cherokee/cgi-bin
>
> --
> View this message in context:
> http://cherokee-web-server-general.1049476.n5.nabble.com/Cherokee-CGI-and-Bash-script-500-error-tp5011553p5011553.html
> Sent from the Cherokee Web Server - General mailing list archive at
> Nabble.com.
> _______________________________________________
> Cherokee mailing list
> Cherokee@lists.octality.com
> http://lists.octality.com/listinfo/cherokee
>
Re: Cherokee, CGI and Bash script, 500 error [ In reply to ]
I modified the script to 755 permissions (there were some errors in the log
before I made it executable) but they're not appearing any more...

This is what I got before changing the permissions...

[20/11/2011 21:38:31.664] (error) handler_cgi.c:640 - Could not execute
'/opt/share/cherokee/cgi-bin/': Permission denied | The issue seems to
be
related to your system.

The only logs I can see are cherokee.access and cherokee.error.... Can I set
verbose logging anywhere?

Thanks again.

--
View this message in context: http://cherokee-web-server-general.1049476.n5.nabble.com/Cherokee-CGI-and-Bash-script-500-error-tp5011553p5014581.html
Sent from the Cherokee Web Server - General mailing list archive at Nabble.com.
_______________________________________________
Cherokee mailing list
Cherokee@lists.octality.com
http://lists.octality.com/listinfo/cherokee
Re: Cherokee, CGI and Bash script, 500 error [ In reply to ]
Found the solution... not sure why it's needed for Bash in particular.

Instead of...


> echo "Content-type: text/html"
> echo ""
>
I used...


> echo "Content-type: text/html\n\n"
>


--
View this message in context: http://cherokee-web-server-general.1049476.n5.nabble.com/Cherokee-CGI-and-Bash-script-500-error-tp5011553p5017522.html
Sent from the Cherokee Web Server - General mailing list archive at Nabble.com.
_______________________________________________
Cherokee mailing list
Cherokee@lists.octality.com
http://lists.octality.com/listinfo/cherokee
Re: Cherokee, CGI and Bash script, 500 error [ In reply to ]
Sorry!! Other way round...

using this solved it:


> echo "Content-type: text/html"
> echo " "
>



--
View this message in context: http://cherokee-web-server-general.1049476.n5.nabble.com/Cherokee-CGI-and-Bash-script-500-error-tp5011553p5017525.html
Sent from the Cherokee Web Server - General mailing list archive at Nabble.com.
_______________________________________________
Cherokee mailing list
Cherokee@lists.octality.com
http://lists.octality.com/listinfo/cherokee