Results 1 to 3 of 3
Thread: Configuring cgi-bin
Enjoy an ad free experience by logging in. Not a member yet? Register.
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
malformed header from script Bad Header = Hello World :hello.pl
perl hello.pl it works fine.
#!/usr/bin/perl print "Hello World\n";
Do I need to set the owner/group to the Apache user?
Here is some of my config options:
<directory> Options FollowSymLinks ExecCGI Allow Override None </directory>
ScriptAlias /cgi-bin/ "/usr/local/apache/cgi-bin/"
<directory "/usr/local/apache/cgi-bin"> AllowOverride None Options ExecCGI Order allow,deny Allow from All </directory>
My directory and scripts are set to 777 for testing.I am on a journey to mastering Linux and I got a bloody long way to go!!!
- Join Date
- Jan 2003
- Lebanon, pa
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.
print "Content-type : text/html\r\n\r\n";
CheersI am on a journey to mastering Linux and I got a bloody long way to go!!!