简体   繁体   中英

Apache2 Returns 404 on Perl Script

[SOLVED]

After managing to get the server to throw 500's I then had to relocate the line; to a different location within the .pl script.

;-)

I have located this article VIA SO: Why does my Perl CGI program return a server error?

This is the same issue I am presently experiencing with Ubuntu 12.04.02 running A2, yet making the settings changes within /etc/apache2/sites-available which appear correct are making no positive influence.

=> Within the perl script (just beneath the call to perl interpreter) script I am having issue running from the browser which is functional VIA CLI;

 print "Content-type: text/plain\n\n";
 print STDERR "OK so far\n";
 print "Succeeded.";

=> This server is very basic at this point in configuration, and is only intended to host 1 web-site. At this point no domain has been assigned and I am just accessing it VIA LAN IP 10.0.0.50, which should not be an issue, I think?

=> My doc root is /var/www => The cg-bin is located: /var/www/cgi-bin

=> Presently /etc/apache2/sites-available/default is utilizing the following parameters with respect to ScriptAlias;

   ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
            AllowOverride None
            Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
            Order allow,deny
            Allow from all
    </Directory>

=> I have set the above to the following but still the server returns 404;

ScriptAlias /cgi-bin/ /var/www/cgi-bin/
<Directory "/var/www/cgi-bin/">
        AllowOverride None
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all
</Directory>

=> /var/log/apache2/error.log provides the following:

[Thu Apr 18 23:06:22 2013] [error] [client 10.0.0.10] script not found or unable to stat: /usr/lib/cgi-bin/acctmanager.pl
[Thu Apr 18 23:07:45 2013] [notice] caught SIGTERM, shutting down
[Thu Apr 18 23:07:46 2013] [notice] Apache/2.2.22 (Ubuntu) PHP/5.3.10-1ubuntu3.6 with Suhosin-Patch configured -- resuming normal operations

=> The top of** /etc/apache2/sites-available/default **appears as;

<VirtualHost *:80>
        ServerAdmin webmaster@localhost

        DocumentRoot /var/www
        <Directory /var/www>
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory

If anyone has some idea of my error(s) I would be greatly appreciative for your time and input.

Thank you

Best Regards

I believe you have u+x permission on the script/dir folders and the script resides in the ScriptAlias Directory, Check this link again to see if you have missed any config. -

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM