?
Solved

Monitor Perl CGI execution

Posted on 2007-10-05
8
Medium Priority
?
531 Views
Last Modified: 2013-12-29
Hi,
   I'm trying to debug a Perl CGI program that is executing in a Tomcat server. The program never respond but just keeps waiting for the server (the browser says "waiting from localhost..."), and the program is rather complex at about 600 lines of code. Is there any way to monitor which part of the code is executing? It's more difficult than plain Perl since it's executing from a CGI server. Thanks in advance!
0
Comment
Question by:Envoy2064
  • 5
  • 3
8 Comments
 
LVL 39

Accepted Solution

by:
Adam314 earned 2000 total points
ID: 20023093
I'm not familiar with Tomcat...You could have your program print out something at several parts of the code.  This should be returned to your browser so you can see what is going on.
Or you could have your program write to a log file every so often.. you could check the log to see what is going on.
0
 

Author Comment

by:Envoy2064
ID: 20023468
Actually, now that I tried executing the Perl script directly from the command line, it prints the HTML code just fine. Do you know why the web browser just won't show the results of the Perl script no matter how long I waited but the command line execution of the script is just fine? Thanks!
0
 
LVL 39

Expert Comment

by:Adam314
ID: 20023704
Is the webserver running the script with different permissions than when you run from the command line?
If so, is there anything the script does that requires different permission than the webserver has?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 39

Expert Comment

by:Adam314
ID: 20024064
Did you figure out the proglem? What was it?
0
 

Author Comment

by:Envoy2064
ID: 20024627
Not yet, but I think the problem is permissions, as you've said. I just still couldn't figure out how to get the Tomcat to open up permissions for Perl executable...despite searching the web for quite a while.
0
 
LVL 39

Expert Comment

by:Adam314
ID: 20024731
Would you like help solving that?

If so:
Is this on a unix type system?  What user runs Tomcat?  What other files/directories does your perl program use, and what are the user/group/permissions on those?
0
 

Author Comment

by:Envoy2064
ID: 20024817
Hi Adam,
   Sure, any help will be appreciated. This is on a Windows system, running Tomcat 5.8.8. I'm the user running it, with Administrator privileges. The Perl program does a read-only scan of a database and produces a image file (PNG) and a data file on the local hard disk. Maybe it has something to do with where it is executing in the Tomcat server? I tried giving full control in Windows permission to "users" on the folder but it still doesn't work...
0
 
LVL 39

Expert Comment

by:Adam314
ID: 20024959
To try to figure out what is causing the problem, try creating a perl program to run in Tomcat that starts very simple.  As long as it works, continue adding features to it until it either stops working, or has all the functionality you need.

eg:
1) Just prints "testing" to the browser

2) Creates a text file on the local hard disk containing the current time, and prints the status to the browser

3) Connects to the database and gets some (any, but probably text) data from it and prints that data to the browser

4) Creates an empty image file on the local drive, and prints the status of this to the browser

5) Does everything
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Upgrading Tomcat – There are a couple of methods to upgrade Tomcat is to use The Apache Installer is to download and unzip and run the services.bat remove|install Tomcat6 Because of the App that we are working with, we can only use Tomcat 6.…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
The viewer will learn how to implement Singleton Design Pattern in Java.
Suggested Courses
Course of the Month14 days, 9 hours left to enroll

839 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