0.0
No commit activity in last 3 years
No release in over 3 years
Automatically generate virtual host config files based on a directory of sites and a given ERB template
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0

Runtime

>= 0
 Project Readme

VhostWriter

Gem Version Code Climate Build Status Coverage Status

Automatically generate virtual host config files based on a directory of sites and a given ERB template.

Installation

$ gem install vhost_writer

Usage

Writing configs

vhost_writer write takes the following:

  • A directory of directories that contain sites
    • Each site's directory should share the name of its domain (like example.com)
  • A directory to write config files to
  • The path to a template file written in ERB
    • Within the template, the site variable contains the name of the site.

Example

$ vhost_writer write /srv/www/ /etc/apache2/sites-available/ /home/bok/template.erb

Scaffolding

vhost_writer has the ability to generate sane default ERB templates for you to modify and use with vhost_writer write. Access this functionality with vhost_writer scaffold.

# Display a list of included scaffolds
$ vhost_writer scaffold

# Generate an Apache ERB template
$ vhost_writer scaffold apache

Template Example

<VirtualHost *:80>
  ServerAdmin admin@<%= site %>
  ServerName <%= site %>
  ServerAlias www.<%= site %>
  DocumentRoot /srv/www/<%= site %>/public_html/
  ErrorLog /srv/www/<%= site %>/logs/error.log
  CustomLog /srv/www/<%= site %>/logs/access.log combined
</VirtualHost>

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request