Skip to content

Commit

Permalink
fix(suse): use correct vhostdir and sitesdir for suse family (#369)
Browse files Browse the repository at this point in the history
The Suse family of distributions does not implement the sites-available/sites-enabled
distinction and puts all vhosts into /etc/apache2/vhosts.d.

Sources:
- https://documentation.suse.com/sles/15-SP3/html/SLES-all/cha-apache2.html#sec-apache2-configuration-manually
- https://build.opensuse.org/package/view_file/openSUSE:Factory/apache2/apache2-httpd.conf?expand=1
  • Loading branch information
faeyben authored Aug 28, 2021
1 parent e354631 commit fe0ceb7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
4 changes: 2 additions & 2 deletions apache/osfamilymap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ Suse:
mod_geoip: apache2-mod_geoip
mod_geoip_database: GeoIP-data

vhostdir: /etc/apache2/sites-available
vhostdir: /etc/apache2/vhosts.d
confdir: /etc/apache2/conf.d
modulesdir: /usr/lib64/apache2/modules
confext: .conf
Expand All @@ -119,7 +119,7 @@ Suse:
logrotatedir: /etc/logrotate.d/apache2
wwwdir: /srv/www
moddir: /etc/apache2/mods-enabled
sitesdir: /etc/apache2/sites-enabled
sitesdir: /etc/apache2/vhosts.d

Gentoo:
pkg:
Expand Down
7 changes: 6 additions & 1 deletion test/integration/default/controls/config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,16 @@
title 'should match desired lines'

case platform[:family]
when 'debian', 'suse'
when 'debian'
vhostdir = '/etc/apache2/sites-available'
logrotatedir = '/etc/logrotate.d/apache2'
moddir = '/etc/apache2/mods-enabled'
sitesdir = '/etc/apache2/sites-enabled'
when 'suse'
vhostdir = '/etc/apache2/vhosts.d'
logrotatedir = '/etc/logrotate.d/apache2'
moddir = '/etc/apache2/mods-enabled'
sitesdir = '/etc/apache2/vhosts.d'
when 'redhat', 'fedora'
vhostdir = '/etc/httpd/vhosts.d'
logrotatedir = '/etc/logrotate.d/httpd'
Expand Down
8 changes: 7 additions & 1 deletion test/integration/modules/controls/config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,18 @@

apachectl = 'apachectl -t'
case platform[:family]
when 'debian', 'suse'
when 'debian'
vhostdir = '/etc/apache2/sites-available'
logrotatedir = '/etc/logrotate.d/apache2'
logdir = '/var/log/apache2'
moddir = '/etc/apache2/mods-enabled'
sitesdir = '/etc/apache2/sites-enabled'
when 'suse'
vhostdir = '/etc/apache2/vhosts.d'
logrotatedir = '/etc/logrotate.d/apache2'
logdir = '/var/log/apache2'
moddir = '/etc/apache2/mods-enabled'
sitesdir = '/etc/apache2/vhosts.d'
when 'redhat', 'fedora'
vhostdir = '/etc/httpd/vhosts.d'
logrotatedir = '/etc/logrotate.d/httpd'
Expand Down

0 comments on commit fe0ceb7

Please sign in to comment.