 |
 |
Important: CGIs not working. Reinstalling apache?
|
 |
|
 |
|
Mac Elite
Join Date: Oct 2000
Status:
Offline
|
|
OK here's the deal, I really need to get .cgi files working again. I was messing around with .htaccess files and some slight editing in the httpd.conf file. But I completely have a clean WebServer folder (backed it up and deleted it, created new folders) and resotred my httpd.conf... and CGI files still do not work. I don't know what more to do. By CGI files not working I mean, when I go to the CGI file I have hosted, I get an "Internal Server Error". My logs reports "Premature end of script headers". Even on scripts that used to work. So the scripts themselves are fine. Proper permissions and everything.
Now, figuring I would just reinstall Apache. I headed over to apache.com and downloaded Apache 2.0.39. Did everything... and then got an error about some parameters thing. Reading the ReadMe.platforms or whatever file, it notes exactly the error I was getting, and links to a guys site who has updated tools that are patched to work, but that site no longer works.
I'd rather try and modify my current apache installation rather than figure out how to install a new version... But whatever you guys can help me with... Thanks 
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Mar 2001
Location: Provo, UT
Status:
Offline
|
|
Just to check the obvious, are the permissions right in the cgi directory? Also, did you check to make sure the cgi path listed is right. (I assume it is right since you restored a backup - but just in case)
I had a similar problem a few months back and it ended up being a subtle permissions problem. Unfortunately it was one of those things I caused and fixed between the hours of 2 in the morning and 5 in the morning after drinking far too much diet Coke. So I can't really be sure of what I did nor how I fixed it. <grin>
|
|
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Apr 2001
Location: Cary, NC
Status:
Offline
|
|
Are these perl cgi scripts?
If so, using Terminal or an xterm, or whatever, cd over to the directory and run
perl -wc script.cgi
see what it tells you.
And I assume you've removed all the .htaccess files?
Lastly, perhaps.. can't remember, does php come enabled?
If so, try the simple test.php
Code:
<?
print phpinfo();
?>
Cheers,
Mike
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Dec 2001
Location: Atlanta, GA, USA
Status:
Offline
|
|
Premature end of header means your CGI has an error. You're probably missing a newline at the end of your script headers. For example, this simple CGI script will work:
Code:
#!/bin/sh
cat << EOF
Content-type:text/html
<html> Hello!</html>
EOF
But this one will not:
Code:
#!/bin/sh
cat << EOF
Content-type:text/html
<html> Hello!</html>
EOF
I'd try something simple (like the first example above) and see if it works. If not, get that working first. Make sure you have a ScriptAlias set up in your httpd.conf. If that works, and your other one does not, go from there with some print/echo statements and see where the problem occurs.
|
|
Mac Pro 2x 2.66 GHz Dual core, Apple TV 160GB, two Windows XP PCs
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|