Complete, small web/applications server with embedded database and scripting

I even don't know what question to ask but I'll try anyway I need a small footprint 'application server' that will host a database, scripting language and a web server - all in a single process. Something that will not require external SDK/frameworks like Java, .Net or Ruby - just an exe with a bunch of script files with my custom code.

The functionality should include: a http server, script programming API for common tasks (db access, http communication, system API interfacing) and an embedded database/key-value store. It should work on windows and unix.

For example MongoDB has no external dependencies, has a database built-in and also has javascript interpreter inside. But it can't run custom scripts or load extension libraries (afaik) - it was not designed to be an application server. But if it were, this would be what I'm looking for.

Any suggestions/ideas?

Most scripting languages would be suitable for this, for example Python or Tcl, since they can load SQLite3 bindings and run a web application server in a single process. Many of these languages also have simpler databases implemented in their native language.

If you are comfortable with Lua, it might be a particularly good choice because it is easy to strip it down to relatively few files.