LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   how to solve 500 internal server error in ubuntu (http://www.linuxquestions.org/questions/programming-9/how-to-solve-500-internal-server-error-in-ubuntu-846607/)

ranvir03 11-25-2010 07:37 PM

how to solve 500 internal server error in ubuntu
 
hello friends/sir ,
i'm using ubuntu 9.10,& try to run simple script in
http://localhost/cgi-bin/myscript
but showing error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

what is possiblity about this problem?
thank you

paulsm4 11-25-2010 08:10 PM

"Server error 500" is a VERY generic error. The root cause can be almost anything.

SUGGESTIONS:
1. Try to reproduce the problem in a short, "hello world" CGI script

2. Look in your server's error log (for example, /var/log/apache2/error_log)

3. Cut/paste the complete script and the exact error message

ranvir03 11-26-2010 04:42 PM

Quote:

Originally Posted by paulsm4 (Post 4171339)
"Server error 500" is a VERY generic error. The root cause can be almost anything.

SUGGESTIONS:
1. Try to reproduce the problem in a short, "hello world" CGI script

2. Look in your server's error log (for example, /var/log/apache2/error_log)

3. Cut/paste the complete script and the exact error message

i'm creating a simple html script and copy into cgi-bin directory......
& this is error message sir,
[Sat Nov 27 16:12:38 2010] [error] [client ::1] (13)Permission denied: exec of '/usr/lib/cgi-bin/testing.html' failed

thank you

paulsm4 11-28-2010 08:25 PM

Hi -

Yup: this will result in an "Error 500" alright ;):
Quote:

[Sat Nov 27 16:12:38 2010] [error] [client ::1] (13)Permission denied: exec of '/usr/lib/cgi-bin/testing.html' failed
Soooo ....

1. Make sure you have read and execute permissions set
EXAMPLE: chmod +rx /usr/lib/cgi-bin/testing.html

2. Make sure you've got a legal CGI script or program
<= "testing.html" sounds like an HTML file ... NOT a CGI executable

3. Q: What is a "legal CGI script or program"?
A: I'm glad you asked :)

Look at some of these links:

http://www.yolinux.com/TUTORIALS/Lin...ellScript.html

http://www.bin-co.com/perl/tutorial/

http://www.cs.virginia.edu/~lab2q/lesson_1/
<= Three different CGI examples, in three different languages(shell, Perl and Python, respectively)

'Hope that helps


All times are GMT -5. The time now is 04:40 AM.