I am having a bit of a play with Apache and I want to setup my cgi-bin directory to run scripts
The server is working fine but I cannot execute scripts. I receive the following error in my log file
I guess the script might be wrong but when I execute the script with
malformed header from script Bad Header = Hello World :hello.pl
perl hello.pl it works fine.
I tried it with html included but it did not make a difference.
print "Hello World\n";
Do I need to set the owner/group to the Apache user?
Here is some of my config options:
Options FollowSymLinks ExecCGI
Allow Override None
The script alias directory
ScriptAlias /cgi-bin/ "/usr/local/apache/cgi-bin/"
Allow from All
My directory and scripts are set to 777 for testing.
It is because you are not sending an http header from the script. I suggest using the CGI perl module which will make it very simple to write cgi scripts. You can get the module at www.cpan.org or using perl -MCPAN -e shell.
Thanks for the reply.
and it worked fine. I'll definitely will look at the modules
print "Content-type : text/html\r\n\r\n";