diff options
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/vhost.pp | 4 | ||||
-rw-r--r-- | manifests/vhost/php/standard.pp | 23 | ||||
-rw-r--r-- | manifests/vhost/php/typo3.pp | 14 | ||||
-rw-r--r-- | manifests/vhost/php/webapp.pp | 17 | ||||
-rw-r--r-- | manifests/vhost/phpdirs.pp | 6 | ||||
-rw-r--r-- | manifests/vhost/template.pp | 10 |
6 files changed, 46 insertions, 28 deletions
diff --git a/manifests/vhost.pp b/manifests/vhost.pp index f845162..0a76fbc 100644 --- a/manifests/vhost.pp +++ b/manifests/vhost.pp @@ -18,7 +18,7 @@ define apache::vhost( $domainalias = 'absent', $server_admin = 'absent', $allow_override = 'None', - $php_bin_dir = 'absent', + $php_safe_mode_exec_bin_dir = 'absent', $php_upload_tmp_dir = 'absent', $php_session_save_path = 'absent', $php_use_smarty = false, @@ -63,7 +63,7 @@ define apache::vhost( domain => $domain, domainalias => $domainalias, server_admin => $server_admin, - php_bin_dir => $php_bin_dir, + php_safe_mode_exec_bin_dir => $php_safe_mode_exec_bin_dir, php_upload_tmp_dir => $php_upload_tmp_dir, php_session_save_path => $php_session_save_path, cgi_binpath => $cgi_binpath, diff --git a/manifests/vhost/php/standard.pp b/manifests/vhost/php/standard.pp index 00a5216..6efba2a 100644 --- a/manifests/vhost/php/standard.pp +++ b/manifests/vhost/php/standard.pp @@ -22,7 +22,6 @@ define apache::vhost::php::standard( $run_uid = 'absent', $run_gid = 'absent', $allow_override = 'None', - $php_bin_dir = 'absent', $php_upload_tmp_dir = 'absent', $php_session_save_path = 'absent', $php_use_smarty = false, @@ -39,12 +38,14 @@ define apache::vhost::php::standard( $vhost_source = 'absent', $vhost_destination = 'absent', $htpasswd_file = 'absent', - $htpasswd_path = 'absent' + $htpasswd_path = 'absent', + $php_safe_mode_exec_bins = 'absent', + $php_safe_mode_exec_bin_dir = 'absent' ){ ::apache::vhost::phpdirs{"${name}": ensure => $ensure, - php_bin_dir => $php_bin_dir, + php_safe_mode_exec_bin_dir => $php_safe_mode_exec_bin_dir, php_upload_tmp_dir => $php_upload_tmp_dir, php_session_save_path => $php_session_save_path, documentroot_owner => $documentroot_owner, @@ -54,6 +55,20 @@ define apache::vhost::php::standard( run_uid => $run_uid, } + if $php_safe_mode_exec_bins != 'absent' { + file{$php_safe_mode_exec_bin_dir: + ensure => directory, + source => "puppet://$server/modules/common/empty", + recurse => true, + purge => true, + owner => $owner, group => $group, mode => 0750; + } + $php_safe_mode_exec_bins_subst = regsubst($php_safe_mode_exec_bins,"(.+)","${vhost}_\\1") + apache::vhost::php::safe_mode_bin{ $php_safe_mode_exec_bins_subst: + path => $php_safe_mode_exec_bin_dir + } + } + if $php_use_smarty { include php::extensions::smarty } @@ -92,7 +107,7 @@ define apache::vhost::php::standard( options => $options, additional_options => $additional_options, default_charset => $default_charset, - php_bin_dir => $php_bin_dir, + php_safe_mode_exec_bin_dir => $php_safe_mode_exec_bin_dir, php_upload_tmp_dir => $php_upload_tmp_dir, php_session_save_path => $php_session_save_path, php_use_smarty => $php_use_smarty, diff --git a/manifests/vhost/php/typo3.pp b/manifests/vhost/php/typo3.pp index dcc10bc..ccca1f8 100644 --- a/manifests/vhost/php/typo3.pp +++ b/manifests/vhost/php/typo3.pp @@ -19,7 +19,6 @@ define apache::vhost::php::typo3( $run_uid = 'absent', $run_gid = 'absent', $allow_override = 'None', - $php_bin_dir = 'absent', $php_upload_tmp_dir = 'absent', $php_session_save_path = 'absent', $do_includes = false, @@ -35,7 +34,8 @@ define apache::vhost::php::typo3( $htpasswd_path = 'absent', $manage_config = true, $config_webwriteable = false, - $manage_directories = true + $manage_directories = true, + $php_safe_mode_exec_bins = 'absent' ){ $documentroot = $path ? { 'absent' => $operatingsystem ? { @@ -45,14 +45,6 @@ define apache::vhost::php::typo3( default => "${path}/www" } - $php_bin_dir = $path ? { - 'absent' => $operatingsystem ? { - openbsd => "/var/www/htdocs/${name}/bin", - default => "/var/www/vhosts/${name}/bin" - }, - default => "${path}/bin" - } - # create vhost configuration file ::apache::vhost::php::webapp{$name: ensure => $ensure, @@ -70,7 +62,6 @@ define apache::vhost::php::typo3( run_uid => $run_uid, run_gid => $run_gid, allow_override => $allow_override, - php_bin_dir => $php_bin_dir, php_upload_tmp_dir => $php_upload_tmp_dir, php_session_save_path => $php_session_save_path, do_includes => $do_includes, @@ -104,6 +95,7 @@ define apache::vhost::php::typo3( "$documentroot/fileadmin/_temp_" ], manage_config => $manage_config, + php_safe_mode_exec_bins => $php_safe_mode_exec_bins, } } diff --git a/manifests/vhost/php/webapp.pp b/manifests/vhost/php/webapp.pp index 4abb63c..4edc069 100644 --- a/manifests/vhost/php/webapp.pp +++ b/manifests/vhost/php/webapp.pp @@ -22,7 +22,6 @@ define apache::vhost::php::webapp( $run_uid = 'absent', $run_gid = 'absent', $allow_override = 'None', - $php_bin_dir = 'absent', $php_upload_tmp_dir = 'absent', $php_session_save_path = 'absent', $do_includes = false, @@ -40,7 +39,8 @@ define apache::vhost::php::webapp( $config_file = 'absent', $config_webwriteable = false, $manage_directories = true, - $managed_directories = 'absent' + $managed_directories = 'absent', + $php_safe_mode_exec_bins = 'absent' ){ if ($ensure != 'absent') { if $manage_directories and ($managed_directories != 'absent') { @@ -71,6 +71,16 @@ define apache::vhost::php::webapp( } } + if $php_safe_mode_exec_bins and ($php_safe_mode_exec_bins != 'absent') { + $php_safe_mode_exec_bin_dir = $path ? { + 'absent' => $operatingsystem ? { + openbsd => "/var/www/htdocs/${name}/bin", + default => "/var/www/vhosts/${name}/bin" + }, + default => "${path}/bin" + } + } + # create vhost configuration file ::apache::vhost::php::standard{$name: ensure => $ensure, @@ -90,7 +100,6 @@ define apache::vhost::php::webapp( run_uid => $run_uid, run_gid => $run_gid, allow_override => $allow_override, - php_bin_dir => $php_bin_dir, php_upload_tmp_dir => $php_upload_tmp_dir, php_session_save_path => $php_session_save_path, do_includes => $do_includes, @@ -104,6 +113,8 @@ define apache::vhost::php::webapp( vhost_destination => $vhost_destination, htpasswd_file => $htpasswd_file, htpasswd_path => $htpasswd_path, + php_safe_mode_exec_bins => $php_safe_mode_exec_bins, + php_safe_mode_exec_bin_dir => $php_safe_mode_exec_bin_dir, } } diff --git a/manifests/vhost/phpdirs.pp b/manifests/vhost/phpdirs.pp index 3593408..891a120 100644 --- a/manifests/vhost/phpdirs.pp +++ b/manifests/vhost/phpdirs.pp @@ -1,6 +1,6 @@ define apache::vhost::phpdirs( $ensure = present, - $php_bin_dir = 'absent', + $php_safe_mode_exec_bin_dir = 'absent', $php_upload_tmp_dir = 'absent', $php_session_save_path = 'absent', $documentroot_owner = apache, @@ -10,9 +10,9 @@ define apache::vhost::phpdirs( $run_uid = 'absent' ){ # php bin_dir - case $php_bin_dir { + case $php_safe_mode_exec_bin_dir { 'absent': { - $real_php_bin_dir = "/var/www/vhosts/$name/bin" + $real_php_safe_mode_exec_bin_dir = "/var/www/vhosts/$name/bin" } default: { $real_php_upload_tmp_dir = $php_upload_tmp_dir } } diff --git a/manifests/vhost/template.pp b/manifests/vhost/template.pp index 75cb9cf..ba2e4d1 100644 --- a/manifests/vhost/template.pp +++ b/manifests/vhost/template.pp @@ -24,7 +24,7 @@ define apache::vhost::template( $domainalias = 'absent', $server_admin = 'absent', $allow_override = 'None', - $php_bin_dir = 'absent', + $php_safe_mode_exec_bin_dir = 'absent', $php_upload_tmp_dir = 'absent', $php_session_save_path = 'absent', $cgi_binpath = 'absent', @@ -95,12 +95,12 @@ define apache::vhost::template( } # set default dirs for templates - # php bin_dir - case $php_bin_dir { + # php php_safe_mode_exec_bin directory + case $php_safe_mode_exec_bin_dir { 'absent': { - $real_php_bin_dir = "/var/www/vhosts/$name/bin" + $real_php_safe_mode_exec_bin_dir = "/var/www/vhosts/$name/bin" } - default: { $real_php_bin_dir = $php_bin_dir } + default: { $real_php_safe_mode_exec_bin_dir = $php_safe_mode_exec_bin_dir } } # php upload_tmp_dir case $php_upload_tmp_dir { |