LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-10-2004, 02:32 PM   #1
eech55
LQ Newbie
 
Registered: Aug 2004
Posts: 23

Rep: Reputation: 15
HELP! CGI problem : HTTP 500 - Internal server error


hi all

when I tried to view my cgi test web site on the browser, it said: HTTP 500 - Internal server error





here is the story in more detail...>>




I have FreeBSD with IP of 10.0.0.1/8 and Apache2 installed on.

this is my 1st try to do some works on CGI.



here is what i did:-


1- i put my simple CGI script in /usr/local/apache/cgi-bin
2- then i run apache2
3- then i went to my workstation which is in the same LAN and i typed the following:-
Code:
http://10.0.0.1/cgi-bin/my_first_cgi.cgi
4- then this message appeared:-
Code:
HTTP 500 - Internal server error


here is my CGI code:-
Quote:
#!/usr/bin/perl -wT
print "Content-type: text/html\n\n";
print "Hello, world!\n";

NOTE: i didnt do any configuration to httpd.conf
this is my first CGI and I dont know whether if I have to configure httpd.conf or not, please tell me what should I do



waiting for answers..
 
Old 10-11-2004, 02:13 AM   #2
onnyloh
Member
 
Registered: Nov 2002
Posts: 57

Rep: Reputation: 15
have u set your script to have execute mod?

if not, set it:
chmod a+x my_first_cgi.cgi

besure your line seperator is unix type.
if not, change it with dos2unix.
 
Old 10-11-2004, 11:27 AM   #3
dizzutch
Member
 
Registered: Sep 2004
Location: Worcester, MA USA
Distribution: Debian, Gentoo, Fedora FC2
Posts: 66

Rep: Reputation: 15
try this: Content-Type:text/html;charset=iso-8859-1

and check your apache log files.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Perl-CGI 500 Error tzarcone Programming 1 07-01-2005 02:45 AM
Additionally, a 500 Internal Server Error error was encountered while trying to use a ukrainet Linux - General 10 06-24-2005 02:23 AM
CGI / Perl Internal Server Error newuser455 Linux - General 10 09-26-2004 02:50 AM
CGI Internal server error newuser455 Linux - General 2 06-10-2004 09:39 PM
dns and 500 internal server error.. Flawless Slackware 4 08-23-2003 11:08 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:23 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration