From 7bbb0feacac0565457f5f56f65468429803454fb Mon Sep 17 00:00:00 2001 From: mh Date: Wed, 11 Aug 2010 14:06:53 +0200 Subject: introduce logmode feature We are now able to select how apache should log accesses. These modes are: * default: as you would use it * semianonym: no ips are logged for CustomLog, ErrorLog still logs ips * anonym: no ips are logged for CustomLog, ErrorLog is sent to /dev/null * nologs: all logs are sent to /dev/null --- manifests/vhost.pp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'manifests/vhost.pp') diff --git a/manifests/vhost.pp b/manifests/vhost.pp index f1a20f0..cc163eb 100644 --- a/manifests/vhost.pp +++ b/manifests/vhost.pp @@ -9,11 +9,17 @@ # php_default_charset: default charset header for php. # *default*: absent, which will set the same as default_charset # of apache +# logmode: +# - default: Do normal logging to CustomLog and ErrorLog +# - nologs: Send every logging to /dev/null +# - anonym: Don't log ips for CustomLog, send ErrorLog to /dev/null +# - semianonym: Don't log ips for CustomLog, log normal ErrorLog define apache::vhost( $ensure = present, $path = 'absent', $path_is_webdir = false, $logpath = 'absent', + $logmode = 'default', $template_mode = 'static', $vhost_mode = 'template', $vhost_source = 'absent', @@ -67,6 +73,7 @@ define apache::vhost( path => $path, path_is_webdir => $path_is_webdir, logpath => $logpath, + logmode => $logmode, domain => $domain, domainalias => $domainalias, server_admin => $server_admin, -- cgit v1.2.3 From 1bdb39c6dd8ccaf76d8a4aa2e9486069afd2d476 Mon Sep 17 00:00:00 2001 From: mh Date: Mon, 16 Aug 2010 19:01:24 +0200 Subject: impelement itk plus mode itk plus mode is an additional mode to deploy itk based hostings which should be a bit more performant. The idea is that we have two apache-instances running: A) prefork based, listening on the external interface B) itk based, listening on the loopback interface A) will serve all static webpages, as well as possibly serve all static content of dynamic websites. All requests to dynamic content will be redirected to B). The idea is that A) doesn't load any modules to server dynamic content at all. B) will serve all the dynamic scripts of a vhost. This will mean that for vhosts (static ones) as well as static content (all none dynamic scripts) we can benefit from the fast prefork model, while we can use itk's security model for all the dynamic scripts. There are two new additional run_modes: - proxy-itk: this just passes all requests to apache instance B). This one is similar to plain itk based mode and should be used for vhosts that shouldn't (yet) changed to the mixed mode. - static-itk: this passes only requests to dynamic scripts to B) while all static content is served by A). Beware that the user with which A) is running should be member of the run group of B) and all static files need to readable by the group. This reduces the security model you have with plain itk, as the prefork apache user will be able to read php (config-) files of any vhost that runs in static-itk mode. If you want to keep the level of security for a certain vhost, you need to run the specific vhost in proxy-itk mode. Note 1: you cannot run vhosts in itk mode and others in proxy or static itk mode. There is a duplicate file resource definition that blocks that possibility. Note 2: This mode works currently only on CentOS based systems, as no work have been done so far to implement an init.d script that's able to run 2 apache instances. --- manifests/vhost.pp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'manifests/vhost.pp') diff --git a/manifests/vhost.pp b/manifests/vhost.pp index cc163eb..cb89359 100644 --- a/manifests/vhost.pp +++ b/manifests/vhost.pp @@ -14,6 +14,25 @@ # - nologs: Send every logging to /dev/null # - anonym: Don't log ips for CustomLog, send ErrorLog to /dev/null # - semianonym: Don't log ips for CustomLog, log normal ErrorLog +# +# run_mode: controls in which mode the vhost should be run, there are different setups +# possible: +# - normal: (*default*) run vhost with the current active worker (default: prefork) don't +# setup anything special +# - itk: run vhost with the mpm_itk module (Incompatibility: cannot be used in combination +# with 'proxy-itk' & 'static-itk' mode) +# - proxy-itk: run vhost with a dual prefork/itk setup, where prefork just proxies all the +# requests for the itk setup, that listens only on the loobpack device. +# (Incompatibility: cannot be used in combination with the itk setup.) +# - static-itk: run vhost with a dual prefork/itk setup, where prefork serves all the static +# content and proxies the dynamic calls to the itk setup, that listens only on +# the loobpack device (Incompatibility: cannot be used in combination with +# 'itk' mode) +# +# mod_security: Whether we use mod_security or not (will include mod_security module) +# - false: (*default*) don't activate mod_security +# - true: activate mod_security +# define apache::vhost( $ensure = present, $path = 'absent', @@ -62,6 +81,8 @@ define apache::vhost( vhost_source => $vhost_source, vhost_destination => $vhost_destination, do_includes => $do_includes, + run_mode => $run_mode, + mode_security => $mod_security, htpasswd_file => $htpasswd_file, htpasswd_path => $htpasswd_path, use_mod_macro => $use_mod_macro, -- cgit v1.2.3 From 1ef6370acd4fb380c9f63b6557fd8f56c36b4a7f Mon Sep 17 00:00:00 2001 From: mh Date: Mon, 16 Aug 2010 20:32:52 +0200 Subject: fix wrong param naming --- manifests/vhost.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'manifests/vhost.pp') diff --git a/manifests/vhost.pp b/manifests/vhost.pp index cb89359..6d9ae33 100644 --- a/manifests/vhost.pp +++ b/manifests/vhost.pp @@ -82,7 +82,7 @@ define apache::vhost( vhost_destination => $vhost_destination, do_includes => $do_includes, run_mode => $run_mode, - mode_security => $mod_security, + mod_security => $mod_security, htpasswd_file => $htpasswd_file, htpasswd_path => $htpasswd_path, use_mod_macro => $use_mod_macro, -- cgit v1.2.3 From f14fd057987b5489228a40444c3a101768c5b6bb Mon Sep 17 00:00:00 2001 From: mh Date: Tue, 22 Feb 2011 22:59:40 +0100 Subject: first way to a unified partial based vhost template --- manifests/vhost.pp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'manifests/vhost.pp') diff --git a/manifests/vhost.pp b/manifests/vhost.pp index 6d9ae33..089eb62 100644 --- a/manifests/vhost.pp +++ b/manifests/vhost.pp @@ -40,6 +40,7 @@ define apache::vhost( $logpath = 'absent', $logmode = 'default', $template_mode = 'static', + $template_partial = 'absent', $vhost_mode = 'template', $vhost_source = 'absent', $vhost_destination = 'absent', @@ -95,6 +96,7 @@ define apache::vhost( path_is_webdir => $path_is_webdir, logpath => $logpath, logmode => $logmode, + template_partial => $template_partial, domain => $domain, domainalias => $domainalias, server_admin => $server_admin, -- cgit v1.2.3 From cbbffa1d3de5a19a72dd7bb88fb1bcb14e5384e1 Mon Sep 17 00:00:00 2001 From: mh Date: Tue, 17 May 2011 22:52:47 +0200 Subject: improve mod_security rules * handled now by a partial * possibility to add rules that should be removed * possibility to add custom mod_sec options" * use new infrastructure for existing mod_sec tweaks --- manifests/vhost.pp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'manifests/vhost.pp') diff --git a/manifests/vhost.pp b/manifests/vhost.pp index 089eb62..af067d1 100644 --- a/manifests/vhost.pp +++ b/manifests/vhost.pp @@ -70,6 +70,8 @@ define apache::vhost( $htpasswd_path = 'absent', $mod_security = true, $mod_security_relevantonly = true, + $mod_security_rules_to_disable = [], + $mod_security_additional_options = 'absent', $use_mod_macro = false, $ldap_auth = false, $ldap_user = 'any' @@ -123,6 +125,9 @@ define apache::vhost( ldap_auth => $ldap_auth, ldap_user => $ldap_user, mod_security => $mod_security, + mod_security_relevantonly => $mod_security_relevantonly, + mod_security_rules_to_disable => $mod_security_rules_to_disable, + mod_security_additional_options => $mod_security_additional_options, use_mod_macro => $use_mod_macro, } } -- cgit v1.2.3 From 34df80bc271f7ed17de879e82b54f31a98926e08 Mon Sep 17 00:00:00 2001 From: mh Date: Sat, 28 May 2011 11:32:39 +0200 Subject: first work on php_settings via hash --- manifests/vhost.pp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'manifests/vhost.pp') diff --git a/manifests/vhost.pp b/manifests/vhost.pp index af067d1..4ade9c8 100644 --- a/manifests/vhost.pp +++ b/manifests/vhost.pp @@ -56,6 +56,7 @@ define apache::vhost( $php_use_pear = false, $php_safe_mode = true, $php_default_charset = 'absent', + $php_settings = {}, $cgi_binpath = 'absent', $default_charset = 'absent', $do_includes = false, @@ -115,6 +116,7 @@ define apache::vhost( php_use_pear => $php_use_pear, php_safe_mode => $php_safe_mode, php_default_charset => $php_default_charset, + php_settings => $php_settings, run_mode => $run_mode, run_uid => $run_uid, run_gid => $run_gid, -- cgit v1.2.3 From 2fa748dcc92e34b13bd4b6f7e452ef89b29490c4 Mon Sep 17 00:00:00 2001 From: mh Date: Sat, 8 Oct 2011 19:22:40 +0200 Subject: introduce a new template style, less duplicated things, more handy options --- manifests/vhost.pp | 30 +++++------------------------- 1 file changed, 5 insertions(+), 25 deletions(-) (limited to 'manifests/vhost.pp') diff --git a/manifests/vhost.pp b/manifests/vhost.pp index 4ade9c8..64c20c7 100644 --- a/manifests/vhost.pp +++ b/manifests/vhost.pp @@ -3,12 +3,7 @@ # vhost_mode: which option is choosed to deploy the vhost # - template: generate it from a template (default) # - file: deploy a vhost file (apache::vhost::file will be called directly) -# php_safe_mode_exec_bins: An array of local binaries which should be linked in the -# safe_mode_exec_bin for this hosting -# *default*: None -# php_default_charset: default charset header for php. -# *default*: absent, which will set the same as default_charset -# of apache +# # logmode: # - default: Do normal logging to CustomLog and ErrorLog # - nologs: Send every logging to /dev/null @@ -39,9 +34,8 @@ define apache::vhost( $path_is_webdir = false, $logpath = 'absent', $logmode = 'default', - $template_mode = 'static', - $template_partial = 'absent', $vhost_mode = 'template', + $template_partial = 'apache/vhosts/static/partial.erb', $vhost_source = 'absent', $vhost_destination = 'absent', $content = 'absent', @@ -49,14 +43,8 @@ define apache::vhost( $domainalias = 'absent', $server_admin = 'absent', $allow_override = 'None', - $php_safe_mode_exec_bin_dir = 'absent', - $php_upload_tmp_dir = 'absent', - $php_session_save_path = 'absent', - $php_use_smarty = false, - $php_use_pear = false, - $php_safe_mode = true, - $php_default_charset = 'absent', $php_settings = {}, + $php_options = {}, $cgi_binpath = 'absent', $default_charset = 'absent', $do_includes = false, @@ -65,7 +53,6 @@ define apache::vhost( $run_mode = 'normal', $run_uid = 'absent', $run_gid = 'absent', - $template_mode = 'static', $ssl_mode = false, $htpasswd_file = 'absent', $htpasswd_path = 'absent', @@ -99,28 +86,21 @@ define apache::vhost( path_is_webdir => $path_is_webdir, logpath => $logpath, logmode => $logmode, - template_partial => $template_partial, domain => $domain, domainalias => $domainalias, server_admin => $server_admin, - 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, allow_override => $allow_override, do_includes => $do_includes, options => $options, additional_options => $additional_options, default_charset => $default_charset, - php_use_smarty => $php_use_smarty, - php_use_pear => $php_use_pear, - php_safe_mode => $php_safe_mode, - php_default_charset => $php_default_charset, php_settings => $php_settings, + php_options => $php_options, run_mode => $run_mode, run_uid => $run_uid, run_gid => $run_gid, - template_mode => $template_mode, + template_partial => $template_partial, ssl_mode => $ssl_mode, htpasswd_file => $htpasswd_file, htpasswd_path => $htpasswd_path, -- cgit v1.2.3 From 9cbf2fafee3f4623b75d1a6b70458ab097e64924 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 8 Jun 2012 12:09:39 -0300 Subject: fix dynamic scope variables, function access --- manifests/vhost.pp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'manifests/vhost.pp') diff --git a/manifests/vhost.pp b/manifests/vhost.pp index 64c20c7..90af00d 100644 --- a/manifests/vhost.pp +++ b/manifests/vhost.pp @@ -62,7 +62,9 @@ define apache::vhost( $mod_security_additional_options = 'absent', $use_mod_macro = false, $ldap_auth = false, - $ldap_user = 'any' + $ldap_user = 'any', + $passing_extension = 'absent', + $gempath = 'absent' ) { # file or template mode? case $vhost_mode { @@ -111,6 +113,8 @@ define apache::vhost( mod_security_rules_to_disable => $mod_security_rules_to_disable, mod_security_additional_options => $mod_security_additional_options, use_mod_macro => $use_mod_macro, + passing_extension => $passing_extension, + gempath => $gempath, } } default: { fail("no such vhost_mode: $vhost_mode defined for $name.") } -- cgit v1.2.3