non_ssl.template.erb 2.72 KB
Newer Older
1
2
3
4
####
##
#
#  This file is automatically generated from the template located at
5
#  /etc/sympl/apache.d/non_ssl.template.erb.
6
#
7
8
#  Feel free to make changes to this file.  However, If changes are made,
#  then this file will NOT be updated automatically when the template changes.
9
10
11
12
13
14
#
##
###

<VirtualHost <%= ips.collect{|ip| ip+":80"}.join(" ") %>>

15
16
17
18
19
        #
        # Put our server name
        #
        ServerName  <%= domain %>

20
21
22
23
        #
        # This is the testing alias.
        #
        ServerAlias <%= domain %>.testing.<%= hostname() %>
24

25
26
27
        #
        # And server alias in place
        #
28
29
        <%= server_aliases %>

30
31
32
33
        #
        # This is the directory people are redirected to if their site is
        # empty.
        #
34
35
        Alias /__sympl/ "/usr/share/sympl/static/"
        <Directory "/usr/share/sympl/static/">
36
37
38
39
40
41
42
43
44
45
                DirectoryIndex index.html
                AllowOverride All
                Require all granted
        </Directory>

        #
        # And this makes that redirection happen.
        #
        <LocationMatch "^/+$">
                Options -Indexes
46
                ErrorDocument 403 /__sympl/index.html
47
48
        </LocationMatch>

49
50
51
52
53
        #
        #  Allow users to override settings via .htaccess
        #
        <Directory <%=domain_directory%> >
                AllowOverride all
54
                Require all granted
55
56
57
58
59
        </Directory>

        #
        #  The document root
        #
60
        DocumentRoot     <%= htdocs_directory %>/
61

62
        <IfModule cgi_module>
63
64
65
66
                #
                # General CGI Handling
                #
                ScriptAlias /cgi-bin/ <%= cgibin_directory %>/
67

68
69
70
71
                <Location /cgi-bin>
                        Options +ExecCGI
                </Location>
        </IfModule>
72

73
74
75
76
77
78
        #
        # Disable indexes by default on the top-level.
        #
        <LocationMatch "^/+$">
                Options -Indexes
        </LocationMatch>
Paul Cammish's avatar
Paul Cammish committed
79
80
81
82
83
84
85
86
87
88
89
        
        #
        # Disable any restrictions or rewrites to /.well-known/acme-challenge
        # This ensures Let's Encrypt can validate domain ownership.
        #
        <Directory <%= htdocs_directory %>/.well-known/acme-challenge/ >
                Require all granted
                <IfModule rewrite_module>
                        RewriteEngine off
                </IfModule>
        </Directory>
90

91
92
93
94
95
        #
        #  We need to log the virtual hostname the incoming request was
        # made against, so that the cron-job in /etc/cron.daily may generate
        # statistics for each domain.
        #
96
97
        ErrorLog   "|| /usr/sbin/sympl-web-logger <%= domain.log_dir %>/error.log"
        CustomLog  "|| /usr/sbin/sympl-web-logger <%= domain.log_dir %>/access.log" combined
98
99
</VirtualHost>