oZones server refuses to start if htaccess is not writable

(cherry picked from commit 6ba6619c93)
This commit is contained in:
Tino Vazquez committed 2011-09-23 13:13:23 +02:00
1 parent 2bde155a58
commit bfa3c0bd1a
4 files changed
+20 -3

No files matched your search

+1 -1
View File
@@ -24,7 +24,7 @@
:databasetype: sqlite
#:htaccess: /var/www/.htaccess
:dbdebug: yes
:dbdebug: no
#####################
# Server Configuration
@@ -19,6 +19,11 @@ module OZones
class ApacheWritter
def initialize(file_path)
@file_path = file_path
File.open(@file_path, 'w') {|f|
f.flock(File::LOCK_EX)
f.write(htaccess)
}
end
def update
+7 -2
View File
@@ -23,11 +23,16 @@ module OZones
@file_path = file_path
else
if !ENV["ONE_LOCATION"]
@file_path="/usr/lib/one/ozones/htaccess"
@file_path="/var/lib/one/.htaccess"
else
@file_path=ENV["ONE_LOCATION"]+"/lib/ozones/htaccess"
@file_path=ENV["ONE_LOCATION"]+"/var/.htaccess"
end
end
# Let's check for file permissions
if !File.writable?(File.dirname(@file_path))
raise "#{@file_path} is not writable"
end
end
def update
+7
View File
@@ -97,6 +97,13 @@ end
ADMIN_NAME = @auth.name
ADMIN_PASS = @auth.password
begin
OZones::ProxyRules.new("apache",config[:htaccess])
rescue Exception => e
warn e.message
exit -1
end
##############################################################################
# Sinatra Configuration