digitized
09-11-2001, 06:36 AM
Hello folks,
I'm running into to problems getting my apache to execute cgi-scripts.I'm starting off using this small script listed below. I put the script in the /var/www/cgi-bin directory.
#!/usr/bin/perl
#
print "Content-type: text/html\n\n";
print "Hello World\n";
I have done a 'chmod +x /var/www/cgi-bin/test.cgi' to test it
I ran >perl -c test.cgi
syntax fine
Then >perl - w test.cgi
Hello World
I keep getting internal error 505
Trying to run http://www.mydomain.com/cgi-bin/first.cgi
Do I need to change my vhost container or add something else to my httpd file?
//some sections from httpd file
#
ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
#
<Directory "/var/www/cgi-bin">
AllowOverride None
Options ExecCGI
Order allow,deny
Allow from all
</Directory>
AddHandler cgi-script .cgi
# If the perl module is installed, this will be enabled.
<IfModule mod_perl.c>
Alias /perl/ /var/www/perl/
<Location /perl>
SetHandler perl-script
PerlHandler Apache::Registry
Options +ExecCGI
</Location>
</IfModule>
# Virtual host mydomain.com
<VirtualHost x.x.x.x>
DocumentRoot /home/mydomain/www/
ServerName www.mydomain.com (http://www.mydomain.com)
ServerSignature email
</VirtualHost>
Any suggestions? thanks
I'm running into to problems getting my apache to execute cgi-scripts.I'm starting off using this small script listed below. I put the script in the /var/www/cgi-bin directory.
#!/usr/bin/perl
#
print "Content-type: text/html\n\n";
print "Hello World\n";
I have done a 'chmod +x /var/www/cgi-bin/test.cgi' to test it
I ran >perl -c test.cgi
syntax fine
Then >perl - w test.cgi
Hello World
I keep getting internal error 505
Trying to run http://www.mydomain.com/cgi-bin/first.cgi
Do I need to change my vhost container or add something else to my httpd file?
//some sections from httpd file
#
ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
#
<Directory "/var/www/cgi-bin">
AllowOverride None
Options ExecCGI
Order allow,deny
Allow from all
</Directory>
AddHandler cgi-script .cgi
# If the perl module is installed, this will be enabled.
<IfModule mod_perl.c>
Alias /perl/ /var/www/perl/
<Location /perl>
SetHandler perl-script
PerlHandler Apache::Registry
Options +ExecCGI
</Location>
</IfModule>
# Virtual host mydomain.com
<VirtualHost x.x.x.x>
DocumentRoot /home/mydomain/www/
ServerName www.mydomain.com (http://www.mydomain.com)
ServerSignature email
</VirtualHost>
Any suggestions? thanks