From bcb25abcb26f7ebb522f3c0dc3288c6a97ccf158 Mon Sep 17 00:00:00 2001 From: mh Date: Sun, 23 Feb 2014 15:17:06 +0100 Subject: introduce a datadir for all dynamic hostings --- manifests/centos.pp | 1 + manifests/openbsd.pp | 4 +++- manifests/vhost/php/standard.pp | 2 +- manifests/vhost/static.pp | 1 + manifests/vhost/webdav.pp | 1 + manifests/vhost/webdir.pp | 9 +++++++++ 6 files changed, 16 insertions(+), 2 deletions(-) (limited to 'manifests') diff --git a/manifests/centos.pp b/manifests/centos.pp index 02adf77..3d9664d 100644 --- a/manifests/centos.pp +++ b/manifests/centos.pp @@ -39,6 +39,7 @@ class apache::centos inherits apache::package { selinux::fcontext{ [ '/var/www/vhosts/[^/]*/www(/.*)?', '/var/www/vhosts/[^/]*/non_public(/.*)?', + '/var/www/vhosts/[^/]*/data(/.*)?', '/var/www/vhosts/[^/]*/g2data(/.*)?', '/var/www/vhosts/[^/]*/upload(/.*)?' ]: require => Package['apache'], diff --git a/manifests/openbsd.pp b/manifests/openbsd.pp index 095f9ea..96a216a 100644 --- a/manifests/openbsd.pp +++ b/manifests/openbsd.pp @@ -46,7 +46,9 @@ class apache::openbsd inherits apache::base { mode => '0700'; } - ::apache::vhost::webdir{'default': } + ::apache::vhost::webdir{'default': + datadir => false, + } Service['apache']{ restart => '/opt/bin/restart_apache.sh', diff --git a/manifests/vhost/php/standard.pp b/manifests/vhost/php/standard.pp index 2f381ce..160f638 100644 --- a/manifests/vhost/php/standard.pp +++ b/manifests/vhost/php/standard.pp @@ -121,7 +121,7 @@ define apache::vhost::php::standard( engine => 'On', upload_tmp_dir => "/var/www/upload_tmp_dir/${name}", 'session.save_path' => "/var/www/session.save_path/${name}", - open_basedir => "${smarty_path}${pear_path}${documentroot}:/var/www/upload_tmp_dir/${name}:/var/www/session.save_path/${name}", + open_basedir => "${smarty_path}${pear_path}${documentroot}:${real_path}/data:/var/www/upload_tmp_dir/${name}:/var/www/session.save_path/${name}", safe_mode => 'On' } if $logmode != 'nologs' { diff --git a/manifests/vhost/static.pp b/manifests/vhost/static.pp index a315e05..21b062e 100644 --- a/manifests/vhost/static.pp +++ b/manifests/vhost/static.pp @@ -49,6 +49,7 @@ define apache::vhost::static( owner => $owner, group => $group, run_mode => $run_mode, + datadir => false, documentroot_owner => $documentroot_owner, documentroot_group => $documentroot_group, documentroot_mode => $documentroot_mode, diff --git a/manifests/vhost/webdav.pp b/manifests/vhost/webdav.pp index 5570dcc..f90cf8d 100644 --- a/manifests/vhost/webdav.pp +++ b/manifests/vhost/webdav.pp @@ -76,6 +76,7 @@ define apache::vhost::webdav( owner => $owner, group => $group, run_mode => $run_mode, + datadir => false, documentroot_owner => $documentroot_owner, documentroot_group => $documentroot_group, documentroot_mode => $documentroot_mode, diff --git a/manifests/vhost/webdir.pp b/manifests/vhost/webdir.pp index 1e663e5..e0e2546 100644 --- a/manifests/vhost/webdir.pp +++ b/manifests/vhost/webdir.pp @@ -7,6 +7,7 @@ define apache::vhost::webdir( $mode = 0640, $run_mode = 'normal', $manage_docroot = true, + $datadir = true, $documentroot_owner = root, $documentroot_group = apache, $documentroot_mode = 0640, @@ -110,6 +111,14 @@ define apache::vhost::webdir( mode => $documentroot_mode; } } + if $datadir { + file{"${real_path}/data": + ensure => directory, + owner => $real_documentroot_owner, + group => $real_documentroot_group, + mode => '0640'; + } + } case $::operatingsystem { centos: { include apache::logrotate::centos::vhosts } default: { #nothing -- cgit v1.2.3