It sounds like you're looking for a web server/framework stack. A web server would run your application, which in turn would execute code to combine/assemble HTML and serve it to the user. If you were using PHP, you'd have, for instance, a layout.phtml file:
<!doctype html>
<html>
<head></head>
<body>
<?php
echo $this->getContent('content.phtml');
?>
</body>
</html>
And a content file, content.phtml:
<p>Some content</p>
Your web app would look at the layout file, see that you want to plug in the DOM from content.phtml, fetch that DOM and render it within the layout.phtml. It would then serve the combined version to the user.
Some common web frameworks:
Light: Express on Node.js, Sinatra on Ruby
Heavy: Ruby on Rails, Zend Framework on PHP, Django on Python
If you're looking for a sandbox to host your web app, or a service to take care of server administration for you, check out Heroku.