more changes

This commit is contained in:
John Bintz 2010-04-27 17:00:43 -04:00
parent f21f3aaf2f
commit bc5ca70f75
4 changed files with 18 additions and 11 deletions

View File

@ -1,10 +1,12 @@
require 'apache/master' require 'apache/master'
require 'apache/permissions'
module Apache module Apache
class Config class Config
class << self class << self
include Apache::Master include Apache::Master
include Apache::Quoteize include Apache::Quoteize
include Apache::Permissions
def build(target, &block) def build(target, &block)
@config = [] @config = []

View File

@ -59,16 +59,6 @@ module Apache
group! group if group group! group if group
end end
def deny_from_all
order! "deny,allow"
deny! "from all"
end
def allow_from_all
order! "allow,deny"
allow! "from all"
end
def passenger(ruby_root, ruby_version, passenger_version) def passenger(ruby_root, ruby_version, passenger_version)
end end

13
lib/apache/permissions.rb Normal file
View File

@ -0,0 +1,13 @@
module Apache
module Permissions
def deny_from_all
order! "deny,allow"
deny! "from all"
end
def allow_from_all
order! "allow,deny"
allow! "from all"
end
end
end

View File

@ -1,3 +1,5 @@
IPS = [ '127.0.0.1:80', '127.0.0.1:81' ]
Apache::Config.build('httpd.conf') do Apache::Config.build('httpd.conf') do
server_root '/var/html/apache' server_root '/var/html/apache'
@ -17,7 +19,7 @@ Apache::Config.build('httpd.conf') do
deny_from_all deny_from_all
end end
virtual_host '127.0.0.1:80', '127.0.0.1:81' do virtual_host *IPS do
directory '/' do directory '/' do
allow_from_all allow_from_all
end end