1

If you have only one large file in etc/apache/sites-available, is there a simple solution to split the apache vhost file into separate files so you could use them in the Apache folders sites-available and sites-enabled?

1

I created a python scrript that will do the task at github: https://github.com/rubo77/vhost-split.py

It splits an apache vhost file into separate files so you could use them in the Apache folders sites-available and sites-enabled.

Just pass 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, …). Usage:

vhost-split.py <config_file>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.