Split <VirtualHost> directives into multiple files

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 (vhost-split.py).

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 (http://www.mydomain.com, http://www.mydomain.com-1, …). The script will also report commented entries.

Advertisements

4 Responses to “Split <VirtualHost> directives into multiple files”

  1. Krisztián Says:

    Hi! I just used your script. Thank you I don’t have to write it myself. 🙂

  2. anonymous Says:

    Hi !
    Very efficient script !
    Thank you !

  3. rakotomandimby Says:

    Thank you for this helpfull script

  4. rubo77 Says:

    I transfered your useful script to Github at https://github.com/rubo77/vhost-split.py

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: