Skip to content

Commit

Permalink
No implicit <Directory> entry for ScriptAlias path
Browse files Browse the repository at this point in the history
Support for ScriptAlias currently implicitly and automatically creates
<Directory> configuration directives for the path component in a given
ScriptAlias directive. These are not useful or needed, according to the
mod_alias documentation. Fixes issue puppetlabs#486.

This change also indirectly relates to puppetlabs#487 because the implicitly
created <Directory> entry for each ScriptAlias path also had
`SSLOptions +StdEnvVars` set for that directory.
  • Loading branch information
antaflos committed Nov 22, 2013
1 parent 66f62c2 commit 609298d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 20 deletions.
4 changes: 0 additions & 4 deletions spec/defines/vhost_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,6 @@
:value => '/usr/scripts',
:match => [
/^ ScriptAlias \/cgi-bin\/ \/usr\/scripts$/,
/^ <Directory \/usr\/scripts>$/,
],
},
{
Expand All @@ -273,7 +272,6 @@
:value => { 'alias' => '/blah/', 'path' => '/usr/scripts' },
:match => [
/^ ScriptAlias \/blah\/ \/usr\/scripts$/,
/^ <Directory \/usr\/scripts>$/,
],
:nomatch => [/ScriptAlias \/cgi\-bin\//],
},
Expand All @@ -284,7 +282,6 @@
:match => [
/^ ScriptAlias \/blah \/usr\/scripts$/,
/^ ScriptAlias \/blah2 \/usr\/scripts$/,
/^ <Directory \/usr\/scripts>$/,
],
:nomatch => [/ScriptAlias \/cgi\-bin\//],
},
Expand All @@ -295,7 +292,6 @@
:match => [
/^ ScriptAlias \/blah \/usr\/scripts$/,
/^ ScriptAlias \/blah2\/ \/usr\/scripts2\/$/,
/^ <Directory \/usr\/scripts>$/,
],
:nomatch => [/ScriptAlias \/cgi\-bin\//],
},
Expand Down
16 changes: 0 additions & 16 deletions templates/vhost/_scriptalias.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,8 @@
<%# for backward compatibility and ease of implementation -%>
<% aliases << { 'alias' => '/cgi-bin/', 'path' => @scriptalias } if @scriptalias -%>
<% aliases.flatten.compact! %>
<%# Multiple paths could be provided for the same directory, make sure we only -%>
<%# add a single <Directory> entry per path -%>
<% dirs = aliases.map { |h| h['path'] }.uniq.compact -%>
<% aliases.each do |salias| -%>
## Script alias directives
ScriptAlias <%= salias['alias'] %> <%= salias['path'] %>
<% end -%>

<% dirs.sort.each do |dir| -%>
<Directory <%= dir %>>
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
<% if @ssl -%>
SSLOptions +StdEnvVars
<% end -%>
</Directory>
<% end -%>
<% end -%>

0 comments on commit 609298d

Please sign in to comment.