I'm trying to remotely debug a cgi program running on a remote webserver from my local machine. The remote machine is my dedicated server running CentOS 3, the local machine Ubuntu 10.04, and I have root access to both. My understanding from documentation I've read is that when properly configured I should be able to run the ptkdb debugger on the remote webserver (invoked via a browser) and have the display appear on my local machine for interaction via my local keyboard.

I have the ptkdb debugger installed on the remote machine and know it works since from an X window to the cgi-bin directory on the remote machine via ssh I can run "/usr/bin/perl -d:ptkdb test.cgi" and an X window appears on my local machine with the ptkdb display.

To enable remote debugging from my local machine, I added the following to the remote test.cgi:

#!/usr/bin/perl -d:ptkdb sub BEGIN { $ENV{'DISPLAY'} = "local.router+firefall.ip:0.0" ; }
and then tried running test.cgi using my local machine's browser, expecting an X window to appear on my local machine with the ptkdb display, ala my first paragraph test. However the browser just spins and eventually times out. No /var/log/error_log entry appears.

On my local machine I have run, as both user and root,

xhosts webserver.ipnumber webserver.domainname

If what I am trying to do is possible, as the documentation I've found seems to indicate, then I assume that the problem lies in the firewall behind which my local machine resides, and the need to forward the display to the correct ip behind the firewall. I have in the past been able to successfully ssh into my local machine from outside by altering the Lynksys router/firewall - but for that case I knew what application name and port to specify, as the firewall setup requires, and here I know neither. I've tried using "ptkdb" and "perl" with ports 1-6000 with no success.

Advice would be appreciated (and I suspect would also be appreciated by others seeking to do the same - my google search did not seem to find anything addressing this issue). Or perhaps remotely debugging from behind a firewall in Perl cannot in reality be done.


In reply to Remote ptkdb behind firewall by glendeni

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.