Archive for the ‘Apache’ Category

Split <VirtualHost> directives into multiple files

February 15, 2007

Yesterday, I found out that I needed an application to split the virtual hosts of an Apache 1.3 configuration into separate files so I could use them in the sites-available/sites-enabled Debian‘s Apache 2 way. I googled just a bit and I did not find anything so I did my own one (

Just pass it the configuration file and the script will generate a bunch of files named with the ServerName variable found in each virtual host. Note that repeated entries will generate separate files (,, …). The script will also report commented entries.