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 |
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.
|
[Tue Jun 08 16:59:17 2004] [error] [client 192.168.1.100] Premature end of
script headers: hello_cgi.pl |
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?
|
#!/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 |
make sure the file permission is setup correctly
|
All times are GMT -5. The time now is 03:43 PM. |