I am trying to get my web server to execute cgi-scripts. I'm starting off using this small script listed below. I put the script in the /var/ directory and in my domain's cgi-bin folder.
> /home/mydomain/ (I have chmod 755 both places.)
#!/usr/bin/perl
#
print "Content-type: text/html\n\n";
print "Hello World\n";
I ran >perl -c test.cgi
syntax fine
Then >perl - w test.cgi
Hello World
command line works fine returns- Hello World.
/cgi-bin>#perl test.cgi
But running I keep getting internal error 505
Error_log
[error] (2) No such file or directory: exec of /home/mydomain/[error] Premature end of script headers
## httpd.conf - configuration for the Apache web server
#enable cgi-scripts
ScriptAlias /cgi-bin/ "/var/
<Directory "/var/AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
#use cgi-scripts
AddHandler cgi-script .cgi .pl
# If the perl module is installed, this will be enabled.
<IfModule mod_perl.c>
Alias /perl/ /var/<Location /perl>
SetHandler perl-script
PerlHandler Apache::Registry
Options None
</Location>
</IfModule>
ScriptAlias /cgi-bin/ "/home/mydomain/
<Directory "/home/mydomain/Options None
AllowOverride None
Order allow,deny
Allow from from all
</Directory>
# Virtual host mydomain
<VirtualHost x.x.x.x>
DocumentRoot /home/mydomain/www/
ServerName ScriptAlias /cgi-bin/ "/home/mydomain/ServerSignature email
</VirtualHost>
Do I need to add something else to httpd file?
Why can't it find file in /home/mydomain/
Thanks
> /home/mydomain/ (I have chmod 755 both places.)
#!/usr/bin/perl
#
print "Content-type: text/html\n\n";
print "Hello World\n";
I ran >perl -c test.cgi
syntax fine
Then >perl - w test.cgi
Hello World
command line works fine returns- Hello World.
/cgi-bin>#perl test.cgi
But running I keep getting internal error 505
Error_log
[error] (2) No such file or directory: exec of /home/mydomain/[error] Premature end of script headers
## httpd.conf - configuration for the Apache web server
#enable cgi-scripts
ScriptAlias /cgi-bin/ "/var/
<Directory "/var/AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
#use cgi-scripts
AddHandler cgi-script .cgi .pl
# If the perl module is installed, this will be enabled.
<IfModule mod_perl.c>
Alias /perl/ /var/<Location /perl>
SetHandler perl-script
PerlHandler Apache::Registry
Options None
</Location>
</IfModule>
ScriptAlias /cgi-bin/ "/home/mydomain/
<Directory "/home/mydomain/Options None
AllowOverride None
Order allow,deny
Allow from from all
</Directory>
# Virtual host mydomain
<VirtualHost x.x.x.x>
DocumentRoot /home/mydomain/www/
ServerName ScriptAlias /cgi-bin/ "/home/mydomain/ServerSignature email
</VirtualHost>
Do I need to add something else to httpd file?
Why can't it find file in /home/mydomain/
Thanks