LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices



Reply
 
Search this Thread
Old 06-08-2004, 05:29 PM   #1
hward
LQ Newbie
 
Registered: Jun 2004
Posts: 3

Rep: Reputation: 0
apache and cgi


Hi, very new to linux here. I have a fresh install of Fedora Core 1 and I went into service and started Apache. I get the startup Apache page showing that it is working.

My question is if I put a .cgi file in the cgi-bin I can't it to do anything.
What exactly do i need to do. I have tried following online tutorials that I have found and created the test.pl files that suggest and put them in and still nothing.


Like I said I just reinstallled everything so its fresh and all I have done so far is start apache. Could someone help walk me through what I need to do.

Thanks
Heath
 
Old 06-08-2004, 05:50 PM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,159

Rep: Reputation: 328Reputation: 328Reputation: 328Reputation: 328
What gets displayed in your browser when you try to run the CGI script? Look at your Apache error log (I think by default it's in /var/log/httpd/error_log) and see what it says. Make sure that the user the Apache server runs under has read and execute permissions on the CGI script, too. This is probably the problem if you forgot to chmod +x your script.
 
Old 06-08-2004, 06:04 PM   #3
hward
LQ Newbie
 
Registered: Jun 2004
Posts: 3

Original Poster
Rep: Reputation: 0
[Tue Jun 08 16:59:17 2004] [error] [client 192.168.1.100] Premature end of
script headers: hello_cgi.pl
 
Old 06-08-2004, 08:34 PM   #4
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,159

Rep: Reputation: 328Reputation: 328Reputation: 328Reputation: 328
Oftentime this means that there's a problem with the script itself -- did you remember to print out the "Content-type: text/html\r\n" header?
 
Old 06-08-2004, 08:49 PM   #5
hward
LQ Newbie
 
Registered: Jun 2004
Posts: 3

Original Poster
Rep: Reputation: 0
#!/usr/bin/perl


print "Content-type: text/html\n\n";

print <<"EOF";
<HTML>

<HEAD>
<TITLE>Hello, world!</TITLE>
</HEAD>

<BODY>
<H1>Hello, world!</H1>
</BODY>

</HTML>
EOF
 
Old 06-09-2004, 04:53 AM   #6
Demonbane
Guru
 
Registered: Aug 2003
Location: Sydney, Australia
Distribution: Gentoo
Posts: 1,796

Rep: Reputation: 47
make sure the file permission is setup correctly
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
CGI and Apache Sevoma Linux - Software 7 02-06-2005 06:55 PM
about Apache and CGI kpachopoulos General 1 11-17-2004 05:23 PM
apache v2.0.44 + cgi ; securing cgi-support in apache markus1982 Linux - General 0 01-20-2003 02:03 PM
apache-cgi j-ray Linux - Software 1 12-12-2002 04:31 PM
About cgi , pl. in apache.... raymond Linux - General 1 11-11-2002 10:22 AM


All times are GMT -5. The time now is 03:17 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration