I'm running a webserver on a local machine. I want to automate the process of setting up a website on it, mostly as an exercise to get more proficient with writing larger programs with Perl and getting familiar with more tools and modules out there. When setting up a new website, I'd like to update the apache config file with a very simple virtual host to direct traffic to the site:
<VirtualHost *:80>
DocumentRoot /var/www/temp
ServerName temp.mydomain.com
</VirtualHost>
Now it would be a simple matter to just append these lines to the end of the config file. But that's not a very elegant solution. I'm wondering what tools other Monks might have used to modify apache config files. It doesn't have to be a tool specific to apache like a cpan module. I'd be particularly interested to know if learning something like Template::Toolkit or other general purpose tools might allow me to intelligently handle updating config files in general.
If someone could steer me in the right general direction or things I should investigate, I'd appreciate the help.