/
apache.pp
48 lines (41 loc) · 1.32 KB
/
apache.pp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Class: workstation::programming::www::apache
#
# This class initialize Apache server.
#
# Requires:
# Class workstation
#
# Sample Usage:
# include workstation::programming::www:apache
#
class workstation::programming::www::apache {
# Make sure this subclass is executed after workstation is loaded.
if ! defined(Class['workstation']) {
fail('You must include the base workstation class before using any subclasses.')
} else {
include workstation
}
include workstation::programming::www::php
include workstation::programming::www::mysql
class { 'apache': }
apache::vhost { 'localhost':
docroot => "/home/${workstation::username}/www/",
docroot_owner => $workstation::username,
docroot_group => $workstation::username,
override => 'All',
}
apache::vhost { 'mysql.localhost':
docroot => '/usr/local/www/phpMyAdmin/'
}
file { '/usr/local/etc/apache24/modules.d/001_mod-php.conf':
source => 'puppet:///modules/workstation/mod-php.conf',
}
file_line { 'Add PHP library to httpd.conf':
path => '/usr/local/etc/apache24/httpd.conf',
line => 'LoadModule php7_module libexec/apache24/libphp7.so'
}
file_line { 'Configure Apache to speak PHP':
path => '/usr/local/etc/apache24/httpd.conf',
line => 'Include "/usr/local/etc/apache24/modules.d/001_mod-php.conf"'
}
}