Results 1 to 3 of 3
Hi there,
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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 07-11-2003 #1
Configuring cgi-bin
Hi there,
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 withCode: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.Code:#!/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:
Default Directory
My scriptaliasCode:<directory> Options FollowSymLinks ExecCGI Allow Override None </directory>
The script alias directoryCode:ScriptAlias /cgi-bin/ "/usr/local/apache/cgi-bin/"
Code:<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!!!
- 07-11-2003 #2Linux Engineer
- Join Date
- Jan 2003
- Location
- Lebanon, pa
- Posts
- 994
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.
- 07-11-2003 #3
Thanks for the reply.
I added
and it worked fine. I'll definitely will look at the modulesCode: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!!!


Reply With Quote
