Skip to content

Commit

Permalink
allow disabling default vhosts under 2.4
Browse files Browse the repository at this point in the history
when disabling the default vhost(s) under 2.4, there's nothing to
include in $sites-enabled/, which causes the following error:

    The apache2 configtest failed.
    Output of config test was:
    apache2: Syntax error on line 46 of /etc/apache2/apache2.conf: No
    matches for the wildcard '*' in '/etc/apache2/sites-enabled', failing
    (use IncludeOptional if required)
    Action 'configtest' failed.
    The Apache error log may have more information.

by using IncludeOptional (as recommended), we allow the use of httpd as
simple web server, with single purpose configuration, without having to
define a (default) vhost.
  • Loading branch information
igalic committed Oct 26, 2014
1 parent bc56a5e commit 88c6a98
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions templates/httpd.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@ IncludeOptional "<%= @confd_dir %>/*.conf"
Include "<%= @confd_dir %>/*.conf"
<%- end -%>
<% if @vhost_load_dir != @confd_dir -%>
<%- if scope.function_versioncmp([@apache_version, '2.4']) >= 0 -%>
IncludeOptional "<%= @vhost_load_dir %>/*"
<%- else -%>
Include "<%= @vhost_load_dir %>/*"
<%- end -%>
<% end -%>

<% if @error_documents -%>
Expand Down

0 comments on commit 88c6a98

Please sign in to comment.