Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 197
  • Last Modified:

Problem moving Perl script from PWS 4.0 to Unix web server running Apache

I have written and tested two scripts on my NT 4.0 Workstation machine using Personal Web Server 4.0. I used Perl 5.005_03 from ActiveState for the Win32 platform to test the scripts. The web server runs Perl 5.005_02 and Apache 1.3.6. I have tried to avoid any obvious incompatibilities, but when I move the script to the Unix machine, I get an Internal Server Error. I believe I have taken care of the basics, i.e. file paths, etc. Any thoughts as to why the error occurs?

The script is below; it is a simple script for test purposes. Again, it runs fine on my test machine, but will not run on the Unix machine. Any obvious problems, or is it likely a configuration problem with the Unix server?

Thanks for your help...
 
#!/usr/local/safe/bin/perl
#######################################################
#
# Name: confirm.pl
#
#######################################################

use CGI;
use strict;

###################
# Constants
###################
use vars qw($CART_PATH $LOG_PATH);
use vars qw($MERCHANT);
use vars qw($URL);
use vars qw($SECRET);

###################
# Parameters
###################
use vars qw($response);
use vars qw($authcode);
use vars qw($message);
use vars qw($batch);
use vars qw($ticket);
use vars qw($queue);

###################
# Initialize
###################

$LOG_PATH = '/export/home/mission/public_html/cgi-bin/log';
$CART_PATH = '/export/home/mission/public_html/cgi-bin/cart';

    BEGIN {

        use CGI::Carp qw(carpout);

        # Send warnings and die messages to the browser.
        #
        carpout(STDOUT);

    }

###################
# Main script body
###################

$queue = new CGI;
print $queue->header('text/html');
print $queue->start_html('FAPS Demo Script');
print "<table><caption>This script received the following input:</caption>\n";

# Process input from the form
foreach my $n ($queue->param) {
    my $v = $queue->param($n);
    print "<tr><td>$n</td><td>$v</td></tr>\n";
    if ($n eq 'Response') {
        $response = $v;
    }
    elsif ($n eq 'AuthCode') {
          $authcode = $v;
    }
    elsif ($n eq 'Message') {
          $message = $v;
    }
    elsif ($n eq 'Batch') {
          $batch = $v;
    }
    elsif ($n eq 'Ticket') {
          $ticket = $v;
    }
}
print "</table>\n";
print $queue->end_html;
0
dglenp
Asked:
dglenp
  • 4
  • 2
1 Solution
 
bebonhamCommented:
do you have Carp on the unix system..

mine doesn't have fatalsToBrowser or carpout modules installed...

that's mostlikely the problem...

take out the parts about carp and see if it runs...

Bob

otherwise are you sure you set the permissions correctly?

0
 
dglenpAuthor Commented:
Thanks for the tip, but it didn't work. Good try, though.
0
 
bebonhamCommented:
can you run a hello world script?

#!/usr/local/safe/bin/perl


print "Content-type: text/html\n\n";

print "HELLO WORLD";





try that...

if that doesn't work it is either the permissions
(you need to do chmod +x scriptname.pl)

or the server is misconfigured or perl is misconfigured.

Bob
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
bebonhamCommented:
if it does work, the problem is clearly your script.
0
 
dglenpAuthor Commented:
Hi, Bob.

Thanks for the suggestion. I have been so focused on the script I'm writing, I didn't think to try the simple hello script. It's not the first bonehead thing I've done.

The 'hello world' script will not run. I have checked the permissions and double checked.

Thanks for the help.
0
 
bebonhamCommented:
yeah! (well, not 'yeah' for you) but yeah! at least we figured it out!

good luck,
sorry I am not really strong on Linux/Apache side, or else I'd try to help!

Bob
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now