Solved

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

Posted on 2001-06-08
6
182 Views
Last Modified: 2010-03-05
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
Comment
Question by:dglenp
  • 4
  • 2
6 Comments
 
LVL 8

Expert Comment

by:bebonham
ID: 6168763
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
 
LVL 3

Author Comment

by:dglenp
ID: 6168851
Thanks for the tip, but it didn't work. Good try, though.
0
 
LVL 8

Accepted Solution

by:
bebonham earned 200 total points
ID: 6169057
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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 8

Expert Comment

by:bebonham
ID: 6169058
if it does work, the problem is clearly your script.
0
 
LVL 3

Author Comment

by:dglenp
ID: 6169266
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
 
LVL 8

Expert Comment

by:bebonham
ID: 6169531
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (http://www.mongodb.org/downloads),  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now