tags:

views:

79

answers:

2

I'm attempting to move a web app we have (written in Perl) from an IIS6 server to an IIS7.5 server.

Everything seems to be parsing correctly, I'm just having some issues getting the app to actually work.

The app is basically a couple forms. You fill the first one out, click submit, it presents you with another form based on what checkboxes you selected (using includes and such).

I can get past the first form once... but then after that it stops working and pops up the generated error message. After looking into the code and such, it basically states that there aren't any checkboxes selected.

I know the app writes data into .dat files... (at what point, I'm not sure yet), but I don't see those being created. I've looked at file/directory permissions and seemingly I have MORE permissions on the new server than I did on the last. The user/group for the files/dirs are different though...

Would that have anything to do with it? Why would it pass me on to the next form, displaying the correct "modules" I checked the first time and then not any other time after that? (it seems to reset itself after a while)

I know this is complicated so if you have any questions for me, please ask and I'll answer to the best of my ability :).

Btw, total idiot when it comes to Perl.

EDIT AGAIN I've removed the source as to not reveal any security vulnerabilities... Thanks for pointing that out.

I'm not sure what else to do to show exactly what's going on with this though :(.

+1  A: 

I'd recommend verifying, step by step, that what you think is happening is really happening. Start by watching the HTTP request from your browser to the web server - are the arguments your second perl script expects actually being passed to the server? If not, you'll need to fix the first script.

(start edit)

There's lots of tools to watch the network traffic.

  • Wireshark will read the traffic as it passes over the network (you can run it on the sending or receiving system, or any system on the collision domain).
  • You can use a proxy server, like WebScarab (free), Burp, Paros, etc. You'll have to configure your browser to send traffic to the proxy server, which will then forward the requests to the server. These particular servers are intended to aid testing, in that you'll be able to mess with the requests as they go by (and much more)
  • As Sinan indicates, you can use browser addons like Fx LiveHttpHeaders, or Tamper Data, or Internet Explorer's developer kit (IIRC)

(end edit)

Next, you should print out all CGI arguments that the second perl script receives. That way, you'll know what the script really thinks it gets.

Then, you can enable verbose logging in IIS, so that it logs the full HTTP request.

This will get you closer to the source of the problem - you'll know if it's (a) the first script not creating correct HTML, resulting in an incomplete HTTP request from the browser, (b) the IIS server not receiving the CGI arguments for some odd reason, or (c) the arguments aren't getting from the IIS server and into the perl script (or, possibly, that the perl script is not correctly accessing the arguments).

Good luck!

atk
How do I go about viewing the HTTP request? Sorry :(
Will
There is always `LiveHTTPHeaders`. https://addons.mozilla.org/en-US/firefox/addon/3829/
Sinan Ünür
Will, I've added a few tools for watching network traffic to my answer. Hope it's helpful.
atk
+1  A: 

What you need to do is clear.

There is a lot of weird excess baggage in the script. There seemed to be no subroutines. Just one long series of commands with global variables.

It is time to start refactoring.

Get one thing running at a time.

I saw HTML::Template there but you still had raw HTML mixed in with code. Separate code from presentation.

Sinan Ünür
Yeah, I didn't write this thing. I don't know much about Perl, but it seems to be pretty messy nonetheless.
Will