diff options
Diffstat (limited to 'manifests/vhost/php')
-rw-r--r-- | manifests/vhost/php/drupal.pp | 6 | ||||
-rw-r--r-- | manifests/vhost/php/gallery2.pp | 32 | ||||
-rw-r--r-- | manifests/vhost/php/joomla.pp | 39 | ||||
-rw-r--r-- | manifests/vhost/php/silverstripe.pp | 8 | ||||
-rw-r--r-- | manifests/vhost/php/simplemachine.pp | 20 | ||||
-rw-r--r-- | manifests/vhost/php/spip.pp | 9 | ||||
-rw-r--r-- | manifests/vhost/php/standard.pp | 21 | ||||
-rw-r--r-- | manifests/vhost/php/typo3.pp | 40 | ||||
-rw-r--r-- | manifests/vhost/php/wordpress.pp | 6 |
9 files changed, 90 insertions, 91 deletions
diff --git a/manifests/vhost/php/drupal.pp b/manifests/vhost/php/drupal.pp index d07beb7..4025ada 100644 --- a/manifests/vhost/php/drupal.pp +++ b/manifests/vhost/php/drupal.pp @@ -70,7 +70,7 @@ define apache::vhost::php::drupal( $manage_cron = true ){ $documentroot = $path ? { - 'absent' => $operatingsystem ? { + 'absent' => $::operatingsystem ? { openbsd => "/var/www/htdocs/${name}/www", default => "/var/www/vhosts/${name}/www" }, @@ -89,7 +89,7 @@ define apache::vhost::php::drupal( owner => root, group => 0, mode => 0644; } } - + $std_drupal_php_settings = { magic_quotes_gpc => 0, register_globals => 0, @@ -98,7 +98,7 @@ define apache::vhost::php::drupal( 'mbstring.http_output' => 'pass', 'mbstring.encoding_translation' => 0, } - + # create vhost configuration file ::apache::vhost::php::webapp{$name: ensure => $ensure, diff --git a/manifests/vhost/php/gallery2.pp b/manifests/vhost/php/gallery2.pp index 1eae2b3..d1876ff 100644 --- a/manifests/vhost/php/gallery2.pp +++ b/manifests/vhost/php/gallery2.pp @@ -69,38 +69,36 @@ define apache::vhost::php::gallery2( $upload_dir = 'present' ){ $documentroot = $path ? { - 'absent' => $operatingsystem ? { + 'absent' => $::operatingsystem ? { openbsd => "/var/www/htdocs/${name}/www", default => "/var/www/vhosts/${name}/www" }, default => "${path}/www" } $gdatadir = $path ? { - 'absent' => $operatingsystem ? { + 'absent' => $::operatingsystem ? { openbsd => "/var/www/htdocs/${name}/g2data", default => "/var/www/vhosts/${name}/g2data" }, default => "${path}/g2data" } - file{$gdatadir: - ensure => $ensure ? { - 'present' => directory, - default => absent - }, - owner => $documentroot_owner, group => $documentroot_group, mode => 0660; - } - if ($upload_dir == 'present') or ($upload_dir == 'absent') { - $real_upload_dir = $operatingsystem ? { + $real_upload_dir = $::operatingsystem ? { openbsd => "/var/www/htdocs/${name}/upload", default => "/var/www/vhosts/${name}/upload" } } else { $real_upload_dir = $upload_dir } - - file{$real_upload_dir: - owner => $documentroot_owner, group => $documentroot_group, mode => 0660; + file{ + $gdatadir: + ensure => $ensure ? { + 'present' => directory, + default => absent + }, + owner => $documentroot_owner, group => $documentroot_group, mode => 0660; + $real_upload_dir: + owner => $documentroot_owner, group => $documentroot_group, mode => 0660; } if ($ensure == 'absent') or ($upload_dir == 'absent') { File[$real_upload_dir]{ @@ -119,7 +117,7 @@ define apache::vhost::php::gallery2( safe_mode => 'Off', output_buffering => 'Off', } - + # php upload_tmp_dir case $php_settings[upload_tmp_dir] { '',undef: { @@ -137,8 +135,8 @@ define apache::vhost::php::gallery2( $gallery_php_settings[open_basedir] = "${documentroot}:${php_settings[upload_tmp_dir]}:${php_settings['session.save_path']}:${gdatadir}:${real_upload_dir}" } else { $gallery_php_settings[open_basedir] = "${documentroot}:${php_settings[upload_tmp_dir]}:${php_settings['session.save_path']}:${gdatadir}" - } - + } + $real_php_settings = merge($gallery_php_settings,$php_settings) # create vhost configuration file diff --git a/manifests/vhost/php/joomla.pp b/manifests/vhost/php/joomla.pp index 69b08f6..eed142c 100644 --- a/manifests/vhost/php/joomla.pp +++ b/manifests/vhost/php/joomla.pp @@ -64,13 +64,13 @@ define apache::vhost::php::joomla( include ::apache::include::joomla $documentroot = $path ? { - 'absent' => $operatingsystem ? { + 'absent' => $::operatingsystem ? { openbsd => "/var/www/htdocs/${name}/www", default => "/var/www/vhosts/${name}/www" }, default => "${path}/www" } - + if $mod_security_additional_options == 'absent' { $real_mod_security_additional_options = '# http://optics.csufresno.edu/~kriehn/fedora/fedora_files/f9/howto/modsecurity.html # Exceptions for Joomla Root Directory @@ -79,8 +79,7 @@ define apache::vhost::php::joomla( </LocationMatch> # Exceptions for Joomla Administration Panel - SecRule REQUEST_FILENAME "/administrator/index2.php" \ - "allow,phase:1,nolog,ctl:ruleEngine=Off" + SecRule REQUEST_FILENAME "/administrator/index2.php" "allow,phase:1,nolog,ctl:ruleEngine=Off" # Exceptions for Joomla Component Expose <LocationMatch "^/components/com_expose/expose/manager/amfphp/gateway.php"> @@ -124,22 +123,22 @@ define apache::vhost::php::joomla( htpasswd_file => $htpasswd_file, htpasswd_path => $htpasswd_path, manage_directories => $manage_directories, - managed_directories => [ "$documentroot/administrator/backups", - "$documentroot/administrator/components", - "$documentroot/administrator/language", - "$documentroot/administrator/modules", - "$documentroot/administrator/templates", - "$documentroot/components", - "$documentroot/dmdocuments", - "$documentroot/images", - "$documentroot/language", - "$documentroot/media", - "$documentroot/modules", - "$documentroot/plugins", - "$documentroot/templates", - "$documentroot/cache", - "$documentroot/tmp", - "$documentroot/administrator/cache" ], + managed_directories => [ "${documentroot}/administrator/backups", + "${documentroot}/administrator/components", + "${documentroot}/administrator/language", + "${documentroot}/administrator/modules", + "${documentroot}/administrator/templates", + "${documentroot}/components", + "${documentroot}/dmdocuments", + "${documentroot}/images", + "${documentroot}/language", + "${documentroot}/media", + "${documentroot}/modules", + "${documentroot}/plugins", + "${documentroot}/templates", + "${documentroot}/cache", + "${documentroot}/tmp", + "${documentroot}/administrator/cache" ], manage_config => $manage_config, config_webwriteable => $config_webwriteable, config_file => 'configuration.php', diff --git a/manifests/vhost/php/silverstripe.pp b/manifests/vhost/php/silverstripe.pp index d120f04..da58296 100644 --- a/manifests/vhost/php/silverstripe.pp +++ b/manifests/vhost/php/silverstripe.pp @@ -61,11 +61,11 @@ define apache::vhost::php::silverstripe( $config_webwriteable = false, $manage_directories = true ){ - + include ::apache::include::silverstripe - + $documentroot = $path ? { - 'absent' => $operatingsystem ? { + 'absent' => $::operatingsystem ? { openbsd => "/var/www/htdocs/${name}/www", default => "/var/www/vhosts/${name}/www" }, @@ -109,7 +109,7 @@ define apache::vhost::php::silverstripe( htpasswd_file => $htpasswd_file, htpasswd_path => $htpasswd_path, manage_directories => $manage_directories, - managed_directories => [ "$documentroot/assets" ], + managed_directories => [ "${documentroot}/assets" ], manage_config => $manage_config, } diff --git a/manifests/vhost/php/simplemachine.pp b/manifests/vhost/php/simplemachine.pp index 78a165e..b5178da 100644 --- a/manifests/vhost/php/simplemachine.pp +++ b/manifests/vhost/php/simplemachine.pp @@ -62,7 +62,7 @@ define apache::vhost::php::simplemachine( $manage_directories = true ){ $documentroot = $path ? { - 'absent' => $operatingsystem ? { + 'absent' => $::operatingsystem ? { openbsd => "/var/www/htdocs/${name}/www", default => "/var/www/vhosts/${name}/www" }, @@ -105,15 +105,15 @@ define apache::vhost::php::simplemachine( htpasswd_path => $htpasswd_path, manage_directories => $manage_directories, managed_directories => [ - "$documentroot/agreement.txt", - "$documentroot/attachments", - "$documentroot/avatars", - "$documentroot/cache", - "$documentroot/Packages", - "$documentroot/Packages/installed.list", - "$documentroot/Smileys", - "$documentroot/Themes", - "$documentroot/Themes/default/languages/Install.english.php" + "${documentroot}/agreement.txt", + "${documentroot}/attachments", + "${documentroot}/avatars", + "${documentroot}/cache", + "${documentroot}/Packages", + "${documentroot}/Packages/installed.list", + "${documentroot}/Smileys", + "${documentroot}/Themes", + "${documentroot}/Themes/default/languages/Install.english.php" ], manage_config => $manage_config, config_webwriteable => $config_webwriteable, diff --git a/manifests/vhost/php/spip.pp b/manifests/vhost/php/spip.pp index 696ac8b..5f4ffdb 100644 --- a/manifests/vhost/php/spip.pp +++ b/manifests/vhost/php/spip.pp @@ -59,7 +59,7 @@ define apache::vhost::php::spip( $htpasswd_path = 'absent' ){ $documentroot = $path ? { - 'absent' => $operatingsystem ? { + 'absent' => $::operatingsystem ? { openbsd => "/var/www/htdocs/${name}/www", default => "/var/www/vhosts/${name}/www" }, @@ -100,7 +100,12 @@ define apache::vhost::php::spip( vhost_destination => $vhost_destination, htpasswd_file => $htpasswd_file, htpasswd_path => $htpasswd_path, - managed_directories => [ "$documentroot/IMG", "$documentroot/tmp", "$documentroot/local", "$documentroot/config" ], + managed_directories => [ + "${documentroot}/IMG", + "${documentroot}/tmp", + "${documentroot}/local", + "${documentroot}/config" + ], manage_config => false, } } diff --git a/manifests/vhost/php/standard.pp b/manifests/vhost/php/standard.pp index aea4551..3814680 100644 --- a/manifests/vhost/php/standard.pp +++ b/manifests/vhost/php/standard.pp @@ -78,9 +78,9 @@ define apache::vhost::php::standard( documentroot_mode => $documentroot_mode, } } - + $real_path = $path ? { - 'absent' => $operatingsystem ? { + 'absent' => $::operatingsystem ? { openbsd => "/var/www/htdocs/${name}", default => "/var/www/vhosts/${name}" }, @@ -96,13 +96,13 @@ define apache::vhost::php::standard( 'absent' => "$real_path/logs", default => $logpath } - + $std_php_options = { smarty => false, pear => false, } $real_php_options = merge($std_php_options,$php_options) - + if $real_php_options[smarty] { include php::extensions::smarty $smarty_path = '/usr/share/php/Smarty/:' @@ -115,7 +115,7 @@ define apache::vhost::php::standard( } else { $pear_path = '' } - + $std_php_settings = { engine => 'On', @@ -130,7 +130,7 @@ define apache::vhost::php::standard( if $run_mode == 'fcgid' { $std_php_settings[safe_mode_gid] = 'On' } - + if has_key($php_settings,'safe_mode_exec_dir') { $php_safe_mode_exec_dir = $php_settings[safe_mode_exec_dir] } else { @@ -166,7 +166,7 @@ define apache::vhost::php::standard( ensure => absent, } } - + if !has_key($php_settings,'default_charset') { if $default_charset != 'absent' { $std_php_settings[default_charset] = $default_charset ? { @@ -175,15 +175,12 @@ define apache::vhost::php::standard( } } } - + $real_php_settings = merge($std_php_settings,$php_settings) - + $passing_extension = 'php' if $ensure != 'absent' { case $run_mode { - 'itk': { - include ::php::itk - } 'proxy-itk','static-itk': { include ::php::itk_plus } diff --git a/manifests/vhost/php/typo3.pp b/manifests/vhost/php/typo3.pp index 6ed0fa5..a9f12d8 100644 --- a/manifests/vhost/php/typo3.pp +++ b/manifests/vhost/php/typo3.pp @@ -62,13 +62,13 @@ define apache::vhost::php::typo3( $manage_directories = true ){ $documentroot = $path ? { - 'absent' => $operatingsystem ? { + 'absent' => $::operatingsystem ? { openbsd => "/var/www/htdocs/${name}/www", default => "/var/www/vhosts/${name}/www" }, default => "${path}/www" } - + $modsec_rules = ["960010"] $real_mod_security_rules_to_disable = array_union($mod_security_rules_to_disable,$modsec_rules) if $mod_security_additional_options == 'absent' { @@ -80,7 +80,7 @@ define apache::vhost::php::typo3( } else { $real_mod_security_additional_options = $mod_security_additional_options } - + $typo3_php_settings = { # turn allow_url_fopen on for the extension manager fetch allow_url_fopen => 'On' @@ -122,23 +122,23 @@ define apache::vhost::php::typo3( htpasswd_file => $htpasswd_file, htpasswd_path => $htpasswd_path, manage_directories => $manage_directories, - managed_directories => [ "$documentroot/typo3temp", - "$documentroot/typo3temp/pics", - "$documentroot/typo3temp/temp", - "$documentroot/typo3temp/llxml", - "$documentroot/typo3temp/cs", - "$documentroot/typo3temp/GB", - "$documentroot/typo3temp/locks", - "$documentroot/typo3conf", - "$documentroot/typo3conf/ext", - "$documentroot/typo3conf/l10n", - # "$documentroot/typo3/ext/", # only needed for ext manager installing global extensions - "$documentroot/uploads", - "$documentroot/uploads/pics", - "$documentroot/uploads/media", - "$documentroot/uploads/tf", - "$documentroot/fileadmin", - "$documentroot/fileadmin/_temp_" + managed_directories => [ "${documentroot}/typo3temp", + "${documentroot}/typo3temp/pics", + "${documentroot}/typo3temp/temp", + "${documentroot}/typo3temp/llxml", + "${documentroot}/typo3temp/cs", + "${documentroot}/typo3temp/GB", + "${documentroot}/typo3temp/locks", + "${documentroot}/typo3conf", + "${documentroot}/typo3conf/ext", + "${documentroot}/typo3conf/l10n", + # "${documentroot}/typo3/ext/", # only needed for ext manager installing global extensions + "${documentroot}/uploads", + "${documentroot}/uploads/pics", + "${documentroot}/uploads/media", + "${documentroot}/uploads/tf", + "${documentroot}/fileadmin", + "${documentroot}/fileadmin/_temp_" ], manage_config => $manage_config, } diff --git a/manifests/vhost/php/wordpress.pp b/manifests/vhost/php/wordpress.pp index fef0807..b3f98c1 100644 --- a/manifests/vhost/php/wordpress.pp +++ b/manifests/vhost/php/wordpress.pp @@ -63,7 +63,7 @@ define apache::vhost::php::wordpress( ){ $documentroot = $path ? { - 'absent' => $operatingsystem ? { + 'absent' => $::operatingsystem ? { openbsd => "/var/www/htdocs/${name}/www", default => "/var/www/vhosts/${name}/www" }, @@ -98,7 +98,7 @@ define apache::vhost::php::wordpress( mod_security => $mod_security, mod_security_relevantonly => $mod_security_relevantonly, mod_security_rules_to_disable => $real_mod_security_rules_to_disable, - mod_security_additional_options => $mod_security_additional_options, + mod_security_additional_options => $mod_security_additional_options, ssl_mode => $ssl_mode, vhost_mode => $vhost_mode, template_partial => $template_partial, @@ -107,7 +107,7 @@ define apache::vhost::php::wordpress( htpasswd_file => $htpasswd_file, htpasswd_path => $htpasswd_path, manage_directories => $manage_directories, - managed_directories => "$documentroot/wp-content", + managed_directories => "${documentroot}/wp-content", manage_config => $manage_config, config_webwriteable => $config_webwriteable, config_file => 'wp-config.php', |