HSAdmin Backend Domains, E-Mail, Datenbanken
Michael Hierweck
2017-06-26 4ec40ed6a65908e9dccc511860a7d5da23456092
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# This file is managed by HSAdmin.
# Do not edit manually. Changes will be overwritten.
#
 
<VirtualHost ${pac.curINetAddr.inetAddr}:80 ${pac.oldINetAddr.inetAddr}:80>
    ServerName ${dom.name}
    ServerAlias ${dom.serveraliases}
    ServerAdmin webmaster@${dom.name}
 
    SuexecUserGroup ${dom.user.name} ${pac.name}
 
    PassengerEnabled Off
    PassengerUser ${dom.user.name}
    PassengerGroup ${pac.name}
    PassengerAppRoot /home/doms/${dom.name}/app/
 
    DocumentRoot /home/doms/${dom.name}/htdocs
 
    Alias /cgi-bin/ /home/doms/${dom.name}/cgi/
    Alias /fastcgi-bin/ /home/doms/${dom.name}/fastcgi/
#if( ${letsencrypt} )
    Alias /.well-known/acme-challenge/ /var/lib/hostsharing/acmebot/webroot/${dom.name}/
#end
 
    <Directory />
    PassengerEnabled Off
        Options -ExecCGI ${includes} ${indexes} ${multiviews} +SymLinksIfOwnerMatch
    </Directory>
 
    <Directory /home/doms/${dom.name}/>
    PassengerEnabled On
        AllowOverride AuthConfig FileInfo Indexes Limit Options=IncludesNoExec,Indexes,MultiViews,PassengerNodejs,PassengerPython,PassengerRuby,PassengerAppEnv
    </Directory>
 
    <Location /cgi-bin/>
    PassengerEnabled Off
        SetHandler cgi-script
        Options +ExecCGI ${includes} -Indexes -MultiViews +SymLinksIfOwnerMatch
    </Location>
 
    <Location /fastcgi-bin/>
    PassengerEnabled Off
        SetHandler fcgid-script
        Options +ExecCGI ${includes} -Indexes -MultiViews +SymLinksIfOwnerMatch
    </Location>
 
    RewriteEngine On
    RewriteOptions Inherit
 
    RewriteCond %{REQUEST_URI} !^/cgi-bin/
    RewriteCond %{REQUEST_URI} !^/fastcgi-bin/
#if( ${letsencrypt} )
    RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge/
#end
    RewriteCond %{HTTP_HOST} ^(.+)\.${dom.name}\.?(:[0-9]+)?$ [novary]
    RewriteCond /home/doms/${dom.name}/subs/#[[${tolower:%1} ]]# -d
    RewriteRule ^(.*) /home/doms/${dom.name}/subs/#[[${tolower:%1}$1 ]]# [last]     
    
#if( !${htdocsfallback} )
    RewriteCond %{REQUEST_URI} !^/cgi-bin/
    RewriteCond %{REQUEST_URI} !^/fastcgi-bin/
#if( ${letsencrypt} )
    RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge/
#end
    RewriteCond %{HTTP_HOST} ^(.+)\.${dom.name}\.?(:80)?$ [novary]
    RewriteCond /home/doms/${dom.name}/subs/#[[${tolower:%1} ]]# !-d
    RewriteRule ^(.*) - [redirect=404,last]
 #end
 
    AddType application/x-httpd-php .php .php5 .php4 .php3
    Action application/x-httpd-php /fastcgi-bin/phpstub
</VirtualHost>
 
<VirtualHost ${pac.curINetAddr.inetAddr}:443 ${pac.oldINetAddr.inetAddr}:443>
    ServerName ${dom.name}
    ServerAlias ${dom.serveraliases}
    ServerAdmin ${dom.user.name}@${dom.name}
 
    SuexecUserGroup ${dom.user.name} ${pac.name}
    
    PassengerEnabled Off
    PassengerUser ${dom.user.name}
    PassengerGroup ${pac.name}
    PassengerAppRoot /home/doms/${dom.name}/app-ssl/
 
    SSLEngine On
    SSLCertificateFile /etc/apache2/pems-enabled/${dom.name}.crt
    SSLCertificateKeyFile /etc/apache2/pems-enabled/${dom.name}.key
    SSLCertificateChainFile /etc/apache2/pems-enabled/${dom.name}.chain
       
    DocumentRoot /home/doms/${dom.name}/htdocs-ssl
 
    Alias /cgi-bin/ /home/doms/${dom.name}/cgi-ssl/
    Alias /fastcgi-bin/ /home/doms/${dom.name}/fastcgi-ssl/
#if( ${letsencrypt} )
    Alias /.well-known/acme-challenge/ /var/lib/hostsharing/acmebot/webroot/${dom.name}/
#end
 
    <Directory />
        SSLRequireSSL On
    PassengerEnabled Off
        Options -ExecCGI ${includes} ${indexes} ${multiviews} +SymLinksIfOwnerMatch
    </Directory>
 
    <Directory /home/doms/${dom.name}/>
        PassengerEnabled On
        AllowOverride AuthConfig FileInfo Indexes Limit Options=IncludesNoExec,Indexes,MultiViews,PassengerNodejs,PassengerPython,PassengerRuby,PassengerAppEnv
    </Directory>
 
    <Location /cgi-bin/>
        PassengerEnabled Off
        SetHandler cgi-script
        Options +ExecCGI ${includes} -Indexes -MultiViews +SymLinksIfOwnerMatch
    </Location>
 
    <Location /fastcgi-bin/>
    PassengerEnabled Off
        SetHandler fcgid-script
        Options +ExecCGI ${includes} -Indexes -MultiViews +SymLinksIfOwnerMatch
    </Location>
    
    RewriteEngine On
    RewriteOptions Inherit
    
    RewriteCond %{REQUEST_URI} !^/cgi-bin/
    RewriteCond %{REQUEST_URI} !^/fastcgi-bin/    
#if( ${letsencrypt} )
    RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge/
#end
    RewriteCond %{HTTP_HOST} ^(.+)\.${dom.name}\.?(:[0-9]+)?$ [novary]
    RewriteCond /home/doms/${dom.name}/subs-ssl/#[[${tolower:%1} ]]# -d
    RewriteRule ^(.*) /home/doms/${dom.name}/subs-ssl/#[[${tolower:%1}$1 ]]# [last]    
    
#if( !${htdocsfallback} )
    RewriteCond %{REQUEST_URI} !^/cgi-bin/
    RewriteCond %{REQUEST_URI} !^/fastcgi-bin/
#if( ${letsencrypt} )
    RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge/
#end
    RewriteCond %{HTTP_HOST} ^(.+)\.${dom.name}\.?(:443)?$ [novary]
    RewriteCond /home/doms/${dom.name}/subs-ssl/#[[${tolower:%1} ]]# !-d
    RewriteRule ^(.*) - [redirect=404,last]
#end
 
    AddType application/x-httpd-php .php .php5 .php4 .php3
    Action application/x-httpd-php /fastcgi-bin/phpstub
 
</VirtualHost>