0

I installed the httpd.conf file. Didnt make any changes to it. I saw where you had indicated the origional content. I changed my servername to localhost. and changed all ownerships to root. Each time trying script before making any changes. I then went so far as to delete everthing except #! usr/bin/perl still errored. Now I checked the apache error logs and I get the same message premature end of script header, I also get an error, "cannot open perl script "!" No such file or directory.

0

OK, try this as well:

from a console on your *nix box, navigate to your cgi-bin directory, and manually run the .cgi script.

This is the stdout when I just did it:

kevin@mars$ cd /usr/local/www/cgi-bin
 kevin@mars$ ./hello.cgi
 Content-type: text/plain
 
 Hello World!
 kevin@mars$
0

when I run using ./hello.cgi- it says no such file or directory...if I run using " perl hello.cgi " - I get the same out put as you.

0

OK, in your httpd.conf, look for:


AddHandler cgi-script .cgi


and add .pl:


AddHandler cgi-script .cgi .pl


Restart Apache by doing (as root):

apachectl restart

then try running the commandline again. If you got the same stdout that I posted earlier, you should be able to run the .cgi in the browser.

0

ok i did that but still get error...however I noticed that if I edit the line:

#AddHandler cgi-script .cgi .pl

to reflect

AddHandler cgi-script .cgi .pl

then restart apache and try the script....WHen I go back to the conf file
the # has been added back into the AddHandler......

0

:)...Not stupid question..if It is stupid thing to do , You can count on me to do it..

I am using gedit from /etc/httpd/conf/ --- gedit httpd.conf

0

I checked it afterwards to make sure the changes to effect...

0

Let me have a look at my Apache Cookbook to see if it has anything in there regarding this issue. I completely forgot I had it, or I would've checked it before :P

0

I found the problem...I searched around and somewhere I found that someone was having the same problem, and it was coming from the fact that when he uploaded it using FTP. That it was not being uploaded as ascii.. even though he had selected that transfer mode..so i emailed the file directly to the server and then just saved to the file and presto whamo..

Now on to the next problem...any idea why that would happen? :)

Thank you so much for all your help...You really went beyond the call and I appreciate it and this forum...

I am sure I will talk to you later..I have plenty of issues a head of me..

thanks

Izick

0

No problem. I'm glad you finally got it working :) If you're going to be creating a lot of test .cgi files, it might be a good idea to actually create them on your Linux box, as opposed to transferring them later. It prevents a bunch of problems, and besides, it makes you practice you vi/emacs/pico skills while doing it :)

0

I have the same problem, I'm running Elive linux, (based on Debian), and I've installed Apache 2.

I keep getting 500 internal server error whenever I try running a script.

the path to perl is correct ( /usr/bin/perl )
file permissions are all ok
the scripts themselves are ok because they run on my windows machine and on a unix server with no problems.

is this a common problem on linux? is there something I don't know about?

yours hair-tearing-out-ing-ly,

Simon.

0

What does the Apache error log show?
Did you view the file on the server to make sure there's no "^M" characters at the end of each line?
Did you try one of my earlier suggestions to make sure the server is reading the file as a text file?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.