Using the port of lighttpd
on his jailbroken iPhone, Mark Hoekstra of GEEKtechnique
offers real-world proof
that an iPhone can, indeed, function as a web server. He put up a static page and served 411 unique visitors during the time his server was offline for maintenance. Obviously, that's not battle-testing for a busier server, and the lack of database queries certainly aided the capacity of the tiny server, but it's definitely a fun example of the capabilities of a (hacked) iPhone.
Apache has also been ported, along with Python, vim, curl and other tools web servers can make good use of. There's a good possibility we'll see similar scenarios as time progresses, especially as the hardware capabilities of the iPhone improve. So, is that a backup web server in your pocket, or are you just happy to see me?