From fc12e7e03e85ccbac3f3883657c5bbf39afe8286 Mon Sep 17 00:00:00 2001 From: Ossi Salmi Date: Sun, 16 Jun 2013 01:42:13 +0300 Subject: [PATCH] apache: Fix fcgid on CentOS, dependency fix for wsgi Create separate mod_fcgid socket dirs for http and httpsd. Also tune the process limits. --- apache/files/fcgid_http.conf | 11 +++++++ apache/files/fcgid_https.conf | 11 +++++++ apache/files/{mod_wsgi.conf => wsgi.conf} | 0 apache/manifests/init.pp | 36 +++++++++++++++++++---- 4 files changed, 52 insertions(+), 6 deletions(-) create mode 100644 apache/files/fcgid_http.conf create mode 100644 apache/files/fcgid_https.conf rename apache/files/{mod_wsgi.conf => wsgi.conf} (100%) diff --git a/apache/files/fcgid_http.conf b/apache/files/fcgid_http.conf new file mode 100644 index 0000000..7e14558 --- /dev/null +++ b/apache/files/fcgid_http.conf @@ -0,0 +1,11 @@ +LoadModule fcgid_module modules/mod_fcgid.so +AddHandler fcgid-script fcg fcgi fpl + +FcgidIPCDir /var/run/mod_fcgid +FcgidProcessTableFile /var/run/mod_fcgid/fcgid_shm + +FcgidMinProcessesPerClass 0 +FcgidMaxProcessesPerClass 5 +FcgidMaxRequestLen 16777216 + +FcgidPassHeader Authorization diff --git a/apache/files/fcgid_https.conf b/apache/files/fcgid_https.conf new file mode 100644 index 0000000..77544bd --- /dev/null +++ b/apache/files/fcgid_https.conf @@ -0,0 +1,11 @@ +LoadModule fcgid_module modules/mod_fcgid.so +AddHandler fcgid-script fcg fcgi fpl + +FcgidIPCDir /var/run/mod_fcgid_httpsd +FcgidProcessTableFile /var/run/mod_fcgid_httpsd/fcgid_shm + +FcgidMinProcessesPerClass 0 +FcgidMaxProcessesPerClass 5 +FcgidMaxRequestLen 16777216 + +FcgidPassHeader Authorization diff --git a/apache/files/mod_wsgi.conf b/apache/files/wsgi.conf similarity index 100% rename from apache/files/mod_wsgi.conf rename to apache/files/wsgi.conf diff --git a/apache/manifests/init.pp b/apache/manifests/init.pp index 4cde0ce..905a416 100644 --- a/apache/manifests/init.pp +++ b/apache/manifests/init.pp @@ -468,8 +468,31 @@ class apache::mod::fcgid { } } "centos","redhat","fedora": { - apache::configfile { "fcgid.conf": - require => Package["mod_fcgid"], + if defined(Class["apache::server"]) { + file { "/var/run/mod_fcgid": + ensure => directory, + mode => "0755", + owner => $apache::server::user, + group => $apache::server::group, + before => Service["httpd"], + } + apache::configfile { "fcgid_http.conf": + source => "puppet:///modules/apache/fcgid_http.conf", + https => false, + } + } + if defined(Class["apache::sslserver"]) { + file { "/var/run/mod_fcgid_httpsd": + ensure => directory, + mode => "0755", + owner => $apache::sslserver::user, + group => $apache::sslserver::group, + before => Service["httpsd"], + } + apache::configfile { "fcgid_https.conf": + source => "puppet:///modules/apache/fcgid_https.conf", + http => false, + } } } default: { @@ -748,15 +771,16 @@ class apache::mod::wsgi { } } "centos","redhat","fedora": { - apache::configfile { "wsgi.conf": - source => "puppet:///modules/apache/mod_wsgi.conf", - require => Package["mod_wsgi"], - } file { "/var/run/mod_wsgi": ensure => directory, mode => "0755", owner => "root", group => "root", + before => Apache::Configfile["wsgi.conf"], + } + apache::configfile { "wsgi.conf": + source => "puppet:///modules/apache/wsgi.conf", + require => Package["mod_wsgi"], } } default: {