aboutsummaryrefslogtreecommitdiffstats
path: root/deployment/websites/manifests/www.pp
blob: b42d4c2c453b9fc413f4a46deaa248c9c93ea412 (plain)
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
49
50
51
class websites {
    class www inherits base {
        $vhost = "www.$domain"
        $vhostdir = "$webdatadir/www.$domain"
        $svn_location = "svn://svn.$domain/svn/web/www/trunk"

        include apache::mod_php
        include apache::mod_geoip

        # for mailman reverse proxy, on ssl
        include apache::mod_proxy
        include apache::mod_ssl

        subversion::snapshot { $vhostdir:
            source => $svn_location,
        }

        file { "$vhostdir/var/tmp/cache":
            ensure => directory,
            owner => root,
            group => $apache::base::apache_group,
            mode => 0660,
        }

        apache::vhost_base { "$vhost":
            content => template('websites/vhost_www.conf', "websites/vhost_proxy_mailman.conf"),
            location => $vhostdir,
            options => ['FollowSymLinks'],
        }

        apache::vhost_base { "ssl_$vhost":
            use_ssl => true,
            vhost => $vhost,
            content => template('websites/vhost_www.conf', "websites/vhost_proxy_mailman_ssl.conf"),
            location => $vhostdir,
            options => ['FollowSymLinks'],
        }

        apache::vhost_redirect { $domain:
            url => 'http://www.mageia.org/',
        }

        apache::vhost_redirect { "ssl_$domain":
            use_ssl => true,
            vhost => $domain,
            url => 'https://www.mageia.org/',
        }

        package { ['php-mbstring', 'php-mcrypt', 'php-gettext', 'php-geoip']: }
    }
}