Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am doing LAMP development for a mobile platform. However, the client browser does not allow me to view the source code of visited pages. I consider the source code to be of huge importance for debugging, so I would like to configure my web server so every time a user makes a request, in addition to sending the client a response, that response (the actual contents of the returned page) is also stored in a file with a filename I can cross-relate with access_log (maybe ip-timestamp-filename? or maybe a unique ID in an additional column in access_log?).

I've searched quite a bit, but haven't even gotten close to finding what I'm looking for. Has anybody been able to do this?

share|improve this question
    
Good question, thanks for asking it. Seems like someone I myself will find the need for sooner or later. –  andol Feb 3 '11 at 7:45

3 Answers 3

up vote 1 down vote accepted

There is an extra module for doing this: mod_dumpio.

Here you'll find an short article how to use it.

share|improve this answer
    
So far so good. However, I'm worried that: 1. It puts everything in the error log. This is problematic because. 2. It won't log binary files. I am dynamically generating images and swf data, so I also need binary data. 3. It appears to be truncating my data! Still reading about it so I'll be back in a bit. If you have more ideas please let me know. –  Oscar Rodriguez Feb 3 '11 at 8:01

Why don't you try to load the page with another browser from a regular desktop ? :p

share|improve this answer
    
Because the application requires some crypto stuff which is provided by the carrier, which I can't fake nor remove. –  Oscar Rodriguez Feb 3 '11 at 7:51

Well, I eventually forgot a much more obvious way of doing this. You can simply do tcpdump on the server and then analyze with Wireshark.

This doesn't work for HTTPS though...

share|improve this answer
    
Try putting stunnel in front of a HTTP webserver and tapping the traffic in between, or use curl as the client –  symcbean Feb 3 '11 at 9:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.