Westerberg
March 31st, 2008, 08:47 PM
I have a fresh install of lamp. I installed libapache2-mod-perl2 via apt-get. I created
/usr/lib/cgi-bin
and made a soft link from it to
/var/www/cgi-bin
I have a test script
#!/usr/bin/perl -w
print "Content-type: text/html\r\n\r\n";
print "Hello there!<br />\nJust testing some things.<br />\n";
for ($i=0; $i<10; $i++)
{
print $i."<br />";
}
that I placed in
/var/www/cgi-bin
and made executable.
If I enter "localhost" into the browser address bar, I see the "cgi-bin" directory, but if I click on it I get a message saying Forbidden
You don't have permission to access /cgi-bin/ on this server.
In /var/log/apache2/error.log the message says [error] [client 127.0.0.1] attempt to invoke directory as script: /usr/lib/cgi-bin/, referer: http://localhost/
If I open /var/www/cgi-bin/test.pl with the browser, it just prints out the contents of the script without processing them.
One thing I noticed -- not sure whether it's important -- there is no perl.conf file in /etc/apache2/mods-enabled.
Any help/advice/suggestions would be appreciated.
/usr/lib/cgi-bin
and made a soft link from it to
/var/www/cgi-bin
I have a test script
#!/usr/bin/perl -w
print "Content-type: text/html\r\n\r\n";
print "Hello there!<br />\nJust testing some things.<br />\n";
for ($i=0; $i<10; $i++)
{
print $i."<br />";
}
that I placed in
/var/www/cgi-bin
and made executable.
If I enter "localhost" into the browser address bar, I see the "cgi-bin" directory, but if I click on it I get a message saying Forbidden
You don't have permission to access /cgi-bin/ on this server.
In /var/log/apache2/error.log the message says [error] [client 127.0.0.1] attempt to invoke directory as script: /usr/lib/cgi-bin/, referer: http://localhost/
If I open /var/www/cgi-bin/test.pl with the browser, it just prints out the contents of the script without processing them.
One thing I noticed -- not sure whether it's important -- there is no perl.conf file in /etc/apache2/mods-enabled.
Any help/advice/suggestions would be appreciated.