Red HatThis forum is for the discussion of Red Hat Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I just recently changed my server over from Windows 2000 to Redhat Linux 9. Now what I did was mount my old C drive in /mnt/windows and just used all the same stuff. I then copied the cgi-bin files to /var/www/cgi-bin. The problem now is that is keeps giving me that error "Premature end of script headers". Now, I tried the whole "#!/usr/bin/perl -w" thing, and it seemed to work, but in reality, the scripts did not actually worked, they simply stopped giving me errors. Does anyone have any idea what the problem might be? I don't have anything special going on with Apache, its basically just like it was when I installed it.
Hopefully someone can help me, I have been trying to fix this thing forever :-/
^bump^
I recently just installed RH9 on a different computer and am having the exact same problem. I messed with all KINDS of permissions and nothing will help. I ran the script from the command line, just for shits and giggles, and there are no errors there.
Someone please help me, is there some kind of daemon I need to be running, or some kind of program that I am forgetting to run? Is there something I need to add to my apache config file besides ExecCGI or Addhandler .cgi and .pl? ANY suggestions that ANYONE has would be GREATLY helpful.
try copying the perl scripts under the /cgi-bin directory of your website. Or make changes in httpd.conf file to poing cgi-bin to the directory where your files are stored. In some cased apache has problems with file permissions too. So try copying the files into a ext2 / ext3 partition and pointing the cgi-bin to that directory. This should work.
The Apache FAQ covers the "premature end of script headers" topic in detail. Various defects can be the cause, not limited to: Windows-specific line delimiters (run 'dos2unix' on the files), improper file permissions and ownership (read Apache's error and suexec log file).
I eventually ended up searching as many sites as possible and eventually figured out that it was all that windows control code bullshit. Sheesh, I'm not even running windows on the box, but its still managing to screw things up.
That dos2unix thing converts files to Unix type right? That would be most helpful, I really dont want to open all my CGI scripts with NEdit and save them as unix. x_x
Lines in DOS/Windows text files end with CR/LF (carriage return + line feed) ASCII control characters, while Unix/Linux lines end with just LF. MacOS text files end with just CR. Few applications are aware of that. The others fails upon reading in lines and stripping off the line delimiters.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.