Browse Source

fix(suse): use correct vhostdir and sitesdir for suse family (#369)

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
tags/v1.2.0
Fabian Niepelt 3 years ago
parent
commit
fe0ceb78b7
No account linked to committer's email address
3 changed files with 15 additions and 4 deletions
  1. +2
    -2
      apache/osfamilymap.yaml
  2. +6
    -1
      test/integration/default/controls/config_spec.rb
  3. +7
    -1
      test/integration/modules/controls/config_spec.rb

+ 2
- 2
apache/osfamilymap.yaml View File

mod_geoip: apache2-mod_geoip mod_geoip: apache2-mod_geoip
mod_geoip_database: GeoIP-data mod_geoip_database: GeoIP-data


vhostdir: /etc/apache2/sites-available
vhostdir: /etc/apache2/vhosts.d
confdir: /etc/apache2/conf.d confdir: /etc/apache2/conf.d
modulesdir: /usr/lib64/apache2/modules modulesdir: /usr/lib64/apache2/modules
confext: .conf confext: .conf
logrotatedir: /etc/logrotate.d/apache2 logrotatedir: /etc/logrotate.d/apache2
wwwdir: /srv/www wwwdir: /srv/www
moddir: /etc/apache2/mods-enabled moddir: /etc/apache2/mods-enabled
sitesdir: /etc/apache2/sites-enabled
sitesdir: /etc/apache2/vhosts.d


Gentoo: Gentoo:
pkg: pkg:

+ 6
- 1
test/integration/default/controls/config_spec.rb View File

title 'should match desired lines' title 'should match desired lines'


case platform[:family] case platform[:family]
when 'debian', 'suse'
when 'debian'
vhostdir = '/etc/apache2/sites-available' vhostdir = '/etc/apache2/sites-available'
logrotatedir = '/etc/logrotate.d/apache2' logrotatedir = '/etc/logrotate.d/apache2'
moddir = '/etc/apache2/mods-enabled' moddir = '/etc/apache2/mods-enabled'
sitesdir = '/etc/apache2/sites-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' when 'redhat', 'fedora'
vhostdir = '/etc/httpd/vhosts.d' vhostdir = '/etc/httpd/vhosts.d'
logrotatedir = '/etc/logrotate.d/httpd' logrotatedir = '/etc/logrotate.d/httpd'

+ 7
- 1
test/integration/modules/controls/config_spec.rb View File



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

Loading…
Cancel
Save