some gem cleanup work

This commit is contained in:
John Bintz 2010-05-06 11:05:24 -04:00
parent 53e750853d
commit 9e2010266c
5 changed files with 52 additions and 0 deletions

0
README
View File

33
README.md Normal file
View File

@ -0,0 +1,33 @@
# Apache Config Generator
Programmatically construct your Apache configuration using a powerful DSL built in Ruby.
## Installation
`gem install apache-config-generator`
## Usage
Run `apache-configurator <directory>` to create a new directory to hold your config files.
A Rakefile and config.yml file will also be generated.
## Building a config file
Configs center around the Apache::Config.build method:
Apache::Config.build('sites-available/my-site.conf') do
server_name 'my-cool-website.cool.wow'
document_root '/var/www/my-cool-website'
directory '/' do
options :follow_sym_links, :indexes
allow_from_all
end
location_match %r{^/secret} do
deny_from_all
basic_authentication "My secret", '/etc/apache2/users/global.users', :user => :john
satisfy :any
end
end

12
bin/apache-configurator Executable file
View File

@ -0,0 +1,12 @@
#!/usr/bin/env ruby
require 'fileutils'
if File.directory? ARGV[0]
puts "You can't overwrite an existing directory."
exit 1
end
FileUtils.cp_r File.expand_path(File.join(File.dirname(__FILE__), '..', 'skel')), ARGV[0]
FileUtils.mkdir_p File.join(ARGV[0], 'source')
FileUtils.mkdir_p File.join(ARGV[0], 'conf.d')

4
skel/Rakefile Normal file
View File

@ -0,0 +1,4 @@
require 'rubygems'
require 'apache-config-generator'
require 'apache/rake/create'

3
skel/config.yml Normal file
View File

@ -0,0 +1,3 @@
source: "source"
destination: "conf.d"
rotate_logs_path: '/path/to/apache/bin/rotatelogs'