Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

comment on

( [id://3333] : superdoc . print w/replies, xml ) Need Help??

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 </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.

$PM = "Perl Monk's";
$MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate";
$nysus = $PM . ' ' . $MCF;
Click here if you love Perl Monks

In reply to Guidance on updating apache config files by nysus

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.