Make your iOS Device to your own and private web server.
Lighttpd, PHP and MySQL for your AppleTV, iPad or iPhone.
Use the free 'One Click Solution' for jailbroken iOS Devices.
Just add http://ios-webstack.tk/cydia to your Cydia repos and then install one of the main packages.
You need more technical information or the whole source code? Please look here: iOS WebStack at Google Code