Skip to content

Commit 9d71b58

Browse files
committed
Add default apache2 web template when configured with php-fpm backend
Use unix socket based php-fpm pools by default instead of tcp ports
1 parent ee22261 commit 9d71b58

File tree

3 files changed

+90
-2
lines changed

3 files changed

+90
-2
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<VirtualHost %ip%:%web_ssl_port%>
2+
3+
ServerName %domain_idn%
4+
%alias_string%
5+
ServerAdmin %email%
6+
DocumentRoot %sdocroot%
7+
ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/
8+
Alias /vstats/ %home%/%user%/web/%domain%/stats/
9+
Alias /error/ %home%/%user%/web/%domain%/document_errors/
10+
#SuexecUserGroup %user% %group%
11+
CustomLog /var/log/%web_system%/domains/%domain%.bytes bytes
12+
CustomLog /var/log/%web_system%/domains/%domain%.log combined
13+
ErrorLog /var/log/%web_system%/domains/%domain%.error.log
14+
<Directory %home%/%user%/web/%domain%/stats>
15+
AllowOverride All
16+
</Directory>
17+
<Directory %sdocroot%>
18+
AllowOverride All
19+
SSLRequireSSL
20+
Options +Includes -Indexes +ExecCGI
21+
</Directory>
22+
SSLEngine on
23+
SSLVerifyClient none
24+
SSLCertificateFile %ssl_crt%
25+
SSLCertificateKeyFile %ssl_key%
26+
%ssl_ca_str%SSLCertificateChainFile %ssl_ca%
27+
# <IfModule mod_ruid2.c>
28+
# RMode config
29+
# RUidGid %user% %group%
30+
# RGroups www-data
31+
# </IfModule>
32+
# <IfModule itk.c>
33+
# AssignUserID %user% %group%
34+
# </IfModule>
35+
36+
<FilesMatch \.php$>
37+
SetHandler "proxy:%backend_lsnr%|fcgi://localhost/"
38+
</FilesMatch>
39+
SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0
40+
41+
IncludeOptional %home%/%user%/conf/web/%domain%/%web_system%.ssl.conf_*
42+
43+
</VirtualHost>
44+
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<VirtualHost %ip%:%web_port%>
2+
3+
ServerName %domain_idn%
4+
%alias_string%
5+
ServerAdmin %email%
6+
DocumentRoot %docroot%
7+
ScriptAlias /cgi-bin/ %home%/%user%/web/%domain%/cgi-bin/
8+
Alias /vstats/ %home%/%user%/web/%domain%/stats/
9+
Alias /error/ %home%/%user%/web/%domain%/document_errors/
10+
#SuexecUserGroup %user% %group%
11+
CustomLog /var/log/%web_system%/domains/%domain%.bytes bytes
12+
CustomLog /var/log/%web_system%/domains/%domain%.log combined
13+
ErrorLog /var/log/%web_system%/domains/%domain%.error.log
14+
15+
IncludeOptional %home%/%user%/conf/web/%domain%/apache2.forcessl.conf*
16+
17+
<Directory %home%/%user%/web/%domain%/stats>
18+
AllowOverride All
19+
</Directory>
20+
<Directory %sdocroot%>
21+
AllowOverride All
22+
Options +Includes -Indexes +ExecCGI
23+
</Directory>
24+
# <IfModule mod_ruid2.c>
25+
# RMode config
26+
# RUidGid %user% %group%
27+
# RGroups www-data
28+
# </IfModule>
29+
# <IfModule itk.c>
30+
# AssignUserID %user% %group%
31+
# </IfModule>
32+
33+
<FilesMatch \.php$>
34+
SetHandler "proxy:%backend_lsnr%|fcgi://localhost/"
35+
</FilesMatch>
36+
SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0
37+
38+
IncludeOptional %home%/%user%/conf/web/%domain%/%web_system%.conf_*
39+
40+
</VirtualHost>
41+

install/deb/templates/web/php-fpm/default.tpl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
[%backend%]
2-
listen = 127.0.0.1:%backend_port%
3-
listen.allowed_clients = 127.0.0.1
2+
3+
listen = /run/php/php%backend_version%-fpm-%domain%.sock
4+
listen.owner = %user%
5+
listen.group = www-data
6+
listen.mode = 0660
47

58
user = %user%
69
group = %user%

0 commit comments

Comments
 (0)