Commit bf961241 authored by mh's avatar mh
Browse files

make things EL7 ready

parent 48bd5426
#
# PHP is an HTML-embedded scripting language which attempts to make it
# easy for developers to write dynamically generated webpages.
#
<IfModule prefork.c>
LoadModule php5_module modules/libphp5.so
</IfModule>
<IfModule mpm_itk_module>
LoadModule php5_module modules/libphp5.so
</IfModule>
<IfModule worker.c>
LoadModule php5_module modules/libphp5-zts.so
</IfModule>
#
# Cause the PHP interpreter to handle files with a .php extension.
#
AddHandler php5-script .php
AddType text/html .php
#
# Add index.php to the list of files that will be served as directory
# indexes.
#
DirectoryIndex index.php
#
# Uncomment the following line to allow PHP to pretty-print .phps
# files as PHP source code:
#
#AddType application/x-httpd-php-source .phps
# for security reasons we turn php by default off and only enable it by vhost
php_admin_flag engine off
# and we turn safe mode by default on
php_admin_flag safe_mode On
# with mod_itk we'll hit a lot of these errors
php_admin_value safe_mode_gid on
<IfDefine HttpdLocal>
#
# PHP is an HTML-embedded scripting language which attempts to make it
# easy for developers to write dynamically generated webpages.
#
<IfModule prefork.c>
LoadModule php5_module modules/libphp5.so
</IfModule>
<IfModule mpm_itk_module>
LoadModule php5_module modules/libphp5.so
</IfModule>
<IfModule worker.c>
LoadModule php5_module modules/libphp5-zts.so
</IfModule>
#
# Cause the PHP interpreter to handle files with a .php extension.
#
AddHandler php5-script .php
AddType text/html .php
#
# Add index.php to the list of files that will be served as directory
# indexes.
#
DirectoryIndex index.php
#
# Uncomment the following line to allow PHP to pretty-print .phps
# files as PHP source code:
#
#AddType application/x-httpd-php-source .phps
# for security reasons we turn php by default off and only enable it by vhost
php_admin_flag engine off
# and we turn safe mode by default on
php_admin_flag safe_mode On
# with mod_itk we'll hit a lot of these errors
php_admin_value safe_mode_gid on
</IfDefine>
# manage apc package
class php::apc {
package{'php-pecl-apc':
ensure => installed,
}
include perl::pcre::devel
}
......@@ -2,25 +2,37 @@
class php::base {
package{'php':
ensure => present,
notify => Service[apache],
notify => Service['apache'],
}
file{'php_ini_config':
path => '/etc/php.ini',
source => [
"puppet:///modules/site_php/${::fqdn}/php.ini",
"puppet:///modules/site_php/${php::cluster_node}/php.ini",
'puppet:///modules/site_php/php.ini',
"puppet:///modules/php/config/php.ini.${::architecture}",
'puppet:///modules/php/config/php.ini'
],
require => [ Package[php], Package[apache] ],
notify => Service[apache],
owner => root,
group => 0,
mode => '0644';
file{
'php_ini_config':
path => '/etc/php.ini',
source => [
"puppet:///modules/site_php/${::fqdn}/php.ini",
"puppet:///modules/site_php/${php::cluster_node}/php.ini",
'puppet:///modules/site_php/php.ini',
"puppet:///modules/php/config/php.ini.${::architecture}",
'puppet:///modules/php/config/php.ini'
],
require => Package['php'],
notify => Service['apache'],
owner => root,
group => 0,
mode => '0644';
'/etc/php.d/timezone.ini':
content => "date.timezone = '${php::timezone}'\n",
require => Package['php'],
notify => Service['apache'],
owner => root,
group => 0,
mode => '0644';
}
include php::suhosin
include php::apc
include php::extensions::common
include ::php::suhosin
include ::php::extensions::common
if versioncmp($::operatingsystemmajrelease,'6') > 0 {
include ::php::extensions::pecl::opcache
} else {
include ::php::apc
}
}
......@@ -6,8 +6,8 @@ class php::centos inherits php::base {
"puppet:///modules/site_php/apache/${::operatingsystem}/php.conf",
"puppet:///modules/php/apache/${::operatingsystem}/php.conf",
],
require => [ Package[php], Package[apache] ],
notify => Service[apache],
require => [ Package['php'], Package['apache'] ],
notify => Service['apache'],
owner => root,
group => 0,
mode => '0644';
......
# manage cli package
class php::cli {
php::package{'cli':
mode => direct,
mode => 'direct',
ensure => present,
}
}
\ No newline at end of file
}
# the debian class is not tested!
class php::debian inherits php::base {
#dunno yet about this config file under debian
File[php_ini_config]{
path => '/etc/php5/apache2/php.ini',
}
Package[php]{
name => 'php5',
}
package { 'libapache2-mod-php5':
ensure => installed,
require => Package[php],
}
php::pear { [ "curl", "idn", "imap", "ldap", "ming", "odbc", "pgsql", "ps",
"pspell", "recode", "snmp", "sqlite", "xmlrpc", "xsl" ]:
phpversion => 5
}
}
# manage the devel package
# we want it especially tight to the current
# architecture
class php::devel {
package{"php-devel.${::architecture}":
ensure => installed,
ensure => installed,
require => Package['php'],
}
}
# manifests/extensions/alldbs.pp
# extensions for all common databases
class php::extensions::alldbs {
include php::extensions::mysql
include php::extensions::pgsql
include ::php::extensions::mysql
include ::php::extensions::pgsql
}
# manifests/extensions/bcmath.pp
# manage bcmath
class php::extensions::bcmath {
php::package{'bcmath':
mode => 'direct',
}
php::package{'bcmath':
mode => 'direct',
}
}
# manifests/extensions/common.pp
# common php extensions
class php::extensions::common {
php::package{
[ 'common', 'tidy', 'gd' ]:
mode => 'direct';
}
if ($::operatingsystem == 'CentOS') and ($::operatingsystemmajrelease == '5') {
php::package{
[ 'common', 'tidy', 'gd' ]:
mode => 'direct',
'mhash':
mode => 'direct';
}
if ($::operatingsystem == 'centos' and $::lsbmajdistrelease == '5') {
php::package{
'mhash':
mode => 'direct';
}
}
if $php::centos_use_remi or $php::centos_use_testing {
#php-pecl-json is included in php-common of remi or testing
} else {
php::package{'json':
mode => 'pecl',
}
}
include php::pear::common
}
include ::php::pear::common
}
# manage crypt blowfish extensions
class php::extensions::crypt_blowfish {
php::pear{'Crypt-Blowfish': }
}
# manifests/extensions/imap.pp
# manage imap extension
class php::extensions::imap {
php::package{'imap':
mode => 'direct',
}
php::package{'imap':
mode => 'direct',
}
}
# manifests/extensions/ldap.pp
# manage ldap extension
class php::extensions::ldap {
php::package{'ldap':
mode => 'direct',
}
php::package{'ldap':
mode => 'direct',
}
}
# manage mcrypt extension
class php::extensions::mcrypt {
php::package{'mcrypt':
mode => 'direct',
}
php::package{'mcrypt':
mode => 'direct',
}
}
# manifests/extensions/mysql.pp
# manage mysql extension
class php::extensions::mysql {
php::package{'mysql':
mode => 'direct',
}
php::package{'mysql':
mode => 'direct',
}
}
# the Net_UserAgent_Detect package
class php::extensions::pear::net_useragent_detect {
php::pear{'Net_UserAgent_Detect':
mode => 'cli',
if versioncmp($::operatingsystemmajrelease,'6') > 0 {
package{'php-pear-Net-UserAgent-Detect':
ensure => installed,
}
} else {
php::pear{'Net_UserAgent_Detect':
mode => 'cli',
}
}
}
class php::extensions::pecl::opcache {
package{'php-pecl-zendopcache':
ensure => installed,
}
}
# manifests/extensions/pgsql.pp
# manage pgsql extension
class php::extensions::pgsql {
php::package{'pgsql':
mode => 'direct',
}
php::package{'pgsql':
mode => 'direct',
}
}
# manifests/extensions/phpunit.pp
# manage phpunit
class php::extensions::phpunit {
package{ 'phpunit2':
ensure => installed,
require => Package[php],
require => Package['php'],
}
}
Supports Markdown
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