JayBee has asked for the wisdom of the Perl Monks concerning the following question:

I am new to SSL and I've made a simple shopping cart that works great in http:// but I can't seem to run it in the SSL that's installed and in which I can browse the rest of the site just fine in https://. However, when I go to the perl script directory I get an error: 404
    Not Found
    The requested URL /cgi-bin/shop.cgi was not found on this server.

I've used the super seaches to find out how possible causes and so far I've learned I need to use a module or two allow https to allow the execution. Node 348806 Seems somewhat helpfull, and I've tried implementing parts of the code to mine, yet no luck. So I still don't get it.

Searching my server for SSL or HTTPS installed modules, I've found only these:
LWP::Protocol::https
LWP::Protocol::https10
URI::https
Net::HTTPS
Crypt::SSLeay     «sounds usefull
Net::SSLeay::Handle     «sounds usefull
Net::SSLeay     «sounds usefull
Net::SSL

Can someone please show me some examples? Or if you think it's worth installing a new module on the server, I can try and request it from the providers...

I'm accessing the file directly and also through SHTML
Here's the top portion of my code if it helps:

#!/usr/bin/perl use CGI ':standard'; use CGI::Carp "fatalsToBrowser"; use LWP::UserAgent; use LWP::Protocol::https; my $ua = LWP::UserAgent->new; my $request = POST 'https://myurl.com/cgi-bin/shop.cgi', [ UserID => $uid, Password => $upass, ]; if (!param()) { gofresh(); } elsif (param('start') =~ /mid/) { gofresh(2); } elsif (param('start') =~ /img/) { viewimg(); } elsif (param('start') =~ /checkout/) { checkout(); } elsif (param('start') =~ /addcart/) { $itnum=param('itnum'); &addtocart($itnum); print redirect( "../shop/#$itnum" ); } elsif (param('start') =~ /remove/) { $itnum=param('itnum'); &remove(param('itnum')); print redirect( "../shop/#$itnum" ); } elsif (param('start') =~ /shopdone/) { &addtocart(param('itnum')); paybill(); } elsif (param('start') =~ /paybill/) { paybill(); } else { print redirect( "../shop/" ); exit; }
Also most of the documentation on CPAN is over my head and they seem to have changed some of their setup... Thank you for your help in advance. JB

Replies are listed 'Best First'.
Re: https://script not found on port 443
by Anonymous Monk on Jan 29, 2005 at 02:11 UTC
    It is a server setup issue. Basically in Apache you have a config directive like:
    ScriptAlias /cgi-bin/ "/home/some.site.com/cgi-bin/" <Directory "/home/some.site.com/cgi-bin"> AllowOverride None Options None Order allow,deny Allow from all </Directory>

    This lets Apache know that the URL path /cgi-bin means look at /home/some.site.com/cgi-bin and exec the scripts in there.

    HTTPS basically has its own set of config directives that are more or less independent of the HTTP ones. There are several ways it gets set up but evidently your HTTPS config does not map to a cgi-bin dir OR it maps to a different directory. The net result is that Apache can't find your script.