Added apache modules

This commit is contained in:
Ossi Salmi 2010-11-09 14:41:06 +02:00 committed by Timo Mkinen
parent b280208ee9
commit ff6b42fc09
3 changed files with 239 additions and 17 deletions

View file

@ -310,17 +310,85 @@ class apache::mod::auth_kerb {
} }
# Install mod_authnz_ldap.
#
class apache::mod::authnz_ldap {
case $operatingsystem {
debian,ubuntu: {
apache::debian::a2enmod { "authnz_ldap": }
}
centos,fedora: { }
default: {
fail("Apache module not supported in ${operatingsystem}.")
}
}
}
# Install mod_fcgid. # Install mod_fcgid.
# #
class apache::mod::fcgid { class apache::mod::fcgid {
package { "mod_fcgid": package { "mod_fcgid":
ensure => installed, name => $operatingsystem ? {
debian => "libapache2-mod-fcgid",
ubuntu => "libapache2-mod-fcgid",
default => "mod_fcgid",
},
ensure => installed,
require => Package["httpd"], require => Package["httpd"],
} }
apache::configfile { "fcgid.conf": case $operatingsystem {
require => Package["mod_fcgid"], debian,ubuntu: {
apache::debian::a2enmod { "fcgid":
require => Package ["libapache2-mod-fcgid"],
}
}
centos,fedora: {
apache::configfile { "fcgid.conf":
require => Package["mod_fcgid"],
}
}
default: {
fail("Apache module not supported in ${operatingsystem}.")
}
}
}
# Install mod_headers.
#
class apache::mod::headers {
case $operatingsystem {
debian,ubuntu: {
apache::debian::a2enmod { "headers": }
}
centos,fedora: { }
default: {
fail("Apache module not supported in ${operatingsystem}.")
}
}
}
# Install mod_ldap.
#
class apache::mod::ldap {
case $operatingsystem {
debian,ubuntu: {
apache::debian::a2enmod { "ldap": }
}
centos,fedora: { }
default: {
fail("Apache module not supported in ${operatingsystem}.")
}
} }
} }
@ -331,12 +399,29 @@ class apache::mod::fcgid {
class apache::mod::perl { class apache::mod::perl {
package { "mod_perl": package { "mod_perl":
ensure => installed, name => $operatingsystem ? {
debian => "libapache2-mod-perl2",
ubuntu => "libapache2-mod-perl2",
default => "mod_perl",
},
ensure => installed,
require => Package["httpd"], require => Package["httpd"],
} }
apache::configfile { "perl.conf": case $operatingsystem {
require => Package["mod_perl"], debian,ubuntu: {
apache::debian::a2enmod { "perl2":
require => Package ["libapache2-mod-perl2"],
}
}
centos,fedora: {
apache::configfile { "perl.conf":
require => Package["mod_perl"],
}
}
default: {
fail("Apache module not supported in ${operatingsystem}.")
}
} }
} }
@ -347,12 +432,86 @@ class apache::mod::perl {
class apache::mod::php { class apache::mod::php {
package { "php": package { "php":
ensure => installed, name => $operatingsystem ? {
debian => "libapache2-mod-php5",
ubuntu => "libapache2-mod-php5",
default => "php",
},
ensure => installed,
require => Package["httpd"], require => Package["httpd"],
} }
apache::configfile { "php.conf": case $operatingsystem {
require => Package["php"], debian,ubuntu: {
apache::debian::a2enmod { "php5":
require => Package ["libapache2-mod-php5"],
}
}
centos,fedora: {
apache::configfile { "php.conf":
require => Package["php"],
}
}
default: {
fail("Apache module not supported in ${operatingsystem}.")
}
}
}
# Install mod_proxy
#
class apache::mod::proxy {
case $operatingsystem {
debian,ubuntu: {
apache::debian::a2enmod { "proxy":
content => template("apache/proxy.conf.erb"),
}
}
centos,fedora: {
apache::configfile { "proxy.conf":
content => template("apache/proxy.conf.erb"),
}
}
default: {
fail("Apache module not supported in ${operatingsystem}.")
}
}
}
# Install mod_proxy_http
#
class apache::mod::proxy_http {
case $operatingsystem {
debian,ubuntu: {
apache::debian::a2enmod { "proxy_http": }
}
centos,fedora: { }
default: {
fail("Apache module not supported in ${operatingsystem}.")
}
}
}
# Install mod_proxy_balancer
#
class apache::mod::proxy_balancer {
case $operatingsystem {
debian,ubuntu: {
apache::debian::a2enmod { "proxy_balancer": }
}
centos,fedora: { }
default: {
fail("Apache module not supported in ${operatingsystem}.")
}
} }
} }
@ -363,12 +522,46 @@ class apache::mod::php {
class apache::mod::python { class apache::mod::python {
package { "mod_python": package { "mod_python":
name => $operatingsystem ? {
debian => "libapache2-mod-python",
ubuntu => "libapache2-mod-python",
default => "mod_python",
},
ensure => installed, ensure => installed,
require => Package["httpd"], require => Package["httpd"],
} }
apache::configfile { "python.conf": case $operatingsystem {
require => Package["mod_python"], debian,ubuntu: {
apache::debian::a2enmod { "python":
require => Package ["libapache2-mod-python"],
}
}
centos,fedora: {
apache::configfile { "python.conf":
require => Package["mod_python"],
}
}
default: {
fail("Apache module not supported in ${operatingsystem}.")
}
}
}
# Install mod_rewrite.
#
class apache::mod::rewrite {
case $operatingsystem {
debian,ubuntu: {
apache::debian::a2enmod { "rewrite": }
}
centos,fedora: { }
default: {
fail("Apache module not supported in ${operatingsystem}.")
}
} }
} }
@ -379,12 +572,29 @@ class apache::mod::python {
class apache::mod::wsgi { class apache::mod::wsgi {
package { "mod_wsgi": package { "mod_wsgi":
name => $operatingsystem ? {
debian => "libapache2-mod-wsgi",
ubuntu => "libapache2-mod-wsgi",
default => "mod_wsgi",
},
ensure => installed, ensure => installed,
require => Package["httpd"], require => Package["httpd"],
} }
apache::configfile { "wsgi.conf": case $operatingsystem {
require => Package["mod_wsgi"], debian,ubuntu: {
apache::debian::a2enmod { "wsgi":
require => Package ["libapache2-mod-wsgi"],
}
}
centos,fedora: {
apache::configfile { "wsgi.conf":
require => Package["mod_wsgi"],
}
}
default: {
fail("Apache module not supported in ${operatingsystem}.")
}
} }
} }

View file

@ -0,0 +1,12 @@
<% if has_variable?("apache_proxy_allow") -%>
ProxyRequests On
ProxyVia On
<Proxy *>
Order deny,allow
Deny from all
Allow from <%= apache_proxy_allow %>
</Proxy>
<% else -%>
ProxyRequests Off
<% end -%>

View file

@ -187,10 +187,10 @@ class puppet::server inherits puppet::client {
} }
case $operatingsystem { case $operatingsystem {
debian,ubuntu: { debian,ubuntu: {
apache::debian::a2enmod { "headers": } include apache::mod::headers
apache::debian::a2enmod { "proxy": } include apache::mod::proxy
apache::debian::a2enmod { "proxy_http": } include apache::mod::proxy_http
apache::debian::a2enmod { "proxy_balancer": } include apache::mod::proxy_balancer
} }
} }