-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mod_fastcgi #390
mod_fastcgi #390
Changes from 6 commits
4341a1b
48fb00e
04e5e5b
edbfbbf
c6f2bc5
28dc493
e34ea78
be3e87e
f799a31
b1c92db
3faa5d5
1905d43
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
class apache::mod::fastcgi { | ||
|
||
# Debian specifies it's fastcgi lib path, but RedHat uses the default value | ||
# with no config file | ||
$fastcgi_lib_path = $apache::params::fastcgi_lib_path | ||
|
||
apache::mod { 'fastcgi': } | ||
|
||
if $fastcgi_lib_path { | ||
file { 'fastcgi.conf': | ||
ensure => file, | ||
path => "${apache::mod_dir}/fastcgi.conf", | ||
content => template('apache/mod/fastcgi.conf.erb'), | ||
require => Exec["mkdir ${apache::mod_dir}"], | ||
before => File[$apache::mod_dir], | ||
notify => Service['httpd'], | ||
} | ||
} | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -123,7 +123,10 @@ | |
$wsgi_process_group = undef, | ||
$wsgi_script_aliases = undef, | ||
$custom_fragment = undef, | ||
$itk = undef | ||
$itk = undef, | ||
$fastcgi_server = undef, | ||
$fastcgi_socket = undef, | ||
$fastcgi_dir = undef, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you also document these three variables in the "template uses" comment above the vhost file resource? You can add a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Resolved. |
||
) { | ||
# The base class must be included first because it is used by parameter defaults | ||
if ! defined(Class['apache']) { | ||
|
@@ -296,6 +299,13 @@ | |
} | ||
} | ||
|
||
# Load mod_fastci if needed and not yet loaded | ||
if $fastcgi_server and $fastcgi_socket { | ||
if ! defined(Class['apache::mod::fastcgi']) { | ||
include apache::mod::fastcgi | ||
} | ||
} | ||
|
||
# Configure the defaultness of a vhost | ||
if $priority { | ||
$priority_real = $priority | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
describe 'apache::mod::fastcgi', :type => :class do | ||
let :pre_condition do | ||
'include apache' | ||
end | ||
context "on a Debian OS" do | ||
let :facts do | ||
{ | ||
:osfamily => 'Debian', | ||
:operatingsystemrelease => '6', | ||
:concat_basedir => '/dne', | ||
} | ||
end | ||
it { should include_class("apache::params") } | ||
it { should contain_apache__mod('fastcgi') } | ||
it { should contain_package("libapache2-mod-fastcgi") } | ||
it { should contain_file('fastcgi.conf') } | ||
end | ||
|
||
context "on a RedHat OS" do | ||
let :facts do | ||
{ | ||
:osfamily => 'RedHat', | ||
:operatingsystemrelease => '6', | ||
:concat_basedir => '/dne', | ||
} | ||
end | ||
it { should include_class("apache::params") } | ||
it { should contain_apache__mod('fastcgi') } | ||
it { should contain_package("mod_fastcgi") } | ||
it { should_not contain_file('fastcgi.conf') } | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# The Fastcgi Apache module configuration file is being | ||
# managed by Puppet and changes will be overwritten. | ||
<IfModule mod_fastcgi.c> | ||
AddHandler fastcgi-script .fcgi | ||
FastCgiIpcDir <%= @fastcgi_lib_path %> | ||
</IfModule> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<% if @fastcgi_server -%> | ||
|
||
FastCgiExternalServer <%= @fastcgi_server -%> -socket <%= @fastcgi_socket -%> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you change these |
||
<% end -%> | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you remove this extra blank line? Otherwise it will always be inserted into the vhost .conf output. |
||
<% if @fastcgi_dir -%> | ||
|
||
<Directory <%= @fastcgi_dir -%>> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should have There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think within the <> it should heat the newline so the final closing caret is on the same line as the <Directory |
||
Options +ExecCGI | ||
AllowOverride All | ||
SetHandler fastcgi-script | ||
Order allow,deny | ||
Allow from all | ||
AuthBasicAuthoritative Off | ||
</Directory> | ||
|
||
AllowEncodedSlashes On | ||
ServerSignature Off | ||
<% end -%> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a template uses comment for the variables that its using. There are examples in the other mods.