Wouldn't it be even more ideal to have the webserver and app be one and the same binary, all bells and whistles included? No need for CGI at all. Just one static binary, no extra disk I/O needed to load resources (all compiled in statically). Basically you can make the OS deny this app any additional disk access for additional hardiness.
Instantly reminded me of this: source code of the first big Portuguese www portal and search engine: https://github.com/celso/sapo
Wouldn't it be even more ideal to have the webserver and app be one and the same binary, all bells and whistles included? No need for CGI at all. Just one static binary, no extra disk I/O needed to load resources (all compiled in statically). Basically you can make the OS deny this app any additional disk access for additional hardiness.