Commit 03eafe54 authored by mh's avatar mh
Browse files

enforce our best practice for apc settings for all phps

parent c992fe29
......@@ -4,9 +4,12 @@ class php::apc {
package{'php-pecl-apcu':
ensure => installed,
}
$settings_path = '/etc/php.d/apcu.ini'
} else {
package{'php-pecl-apc':
ensure => installed,
}
$settings_path = '/etc/php.d/apc.ini'
}
php::apc::settings{$settings_path: }
}
# some default stuff for apc
class php::apc::base(
$dir = '/var/www/apc_tmp',
){
Package<| title == 'apache' |> -> file{$dir:
ensure => directory,
owner => root,
gropup => 0,
mode => '1777',
}
}
# an abstracted way of setting the same options for all
define php::apc::settings(){
include ::php::apc::base
augeas{"apc_settings_${name}":
context => "/files${name}/.anon",
changes => [
# http://chrisgilligan.com/wordpress/how-to-configure-apc-cache-on-virtual-servers-with-php-running-under-fcgid/
'set apc.shm_size 64M',
'set apc.ttl 0',
"set apc.mmap_file_mask ${php::apc::base::dir}/apc.XXXXXX",
# partially because of http://lists.horde.org/archives/horde/Week-of-Mon-20140414/051263.html
'set apc.enable_cli 1',
],
}
}
......@@ -46,4 +46,5 @@ define php::scl::phpx(
notify => Service['apache'],
}
create_ini_settings({'' => $php_suhosin_settings},$suhosin_defaults)
php::apc::settings{"${etcdir}/php.d/apcu.ini": }
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment