Sorry if I came off a little disgrutled but do check out webmin. If you download the tar.gz file you can look at the code that they used to configure apache. It is all done in Perl.
--
BigJoeLearn patience, you must.
Young PerlMonk, craves Not these things.
Use the source Luke.