Files
cloud-apache-container/configs/shared-vhost-template.tpl

48 lines
1.6 KiB
Smarty
Raw Normal View History

<Directory "/mnt/users/~~user~~/~~domain~~">
AllowOverride None
Require all granted
</Directory>
<Directory "/mnt/users/~~user~~/~~domain~~/public_html">
Options All MultiViews
AllowOverride All
Require all granted
</Directory>
<VirtualHost *:80>
ServerName "~~domain~~"
~~alias_block~~
DocumentRoot "/mnt/users/~~user~~/~~domain~~/public_html"
RewriteEngine on
RewriteCond %{SERVER_NAME} =~~domain~~
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName "~~domain~~"
~~alias_block~~
DocumentRoot "/mnt/users/~~user~~/~~domain~~/public_html"
SSLCertificateFile /etc/pki/tls/certs/localhost.crt
SSLCertificateKeyFile /etc/pki/tls/private/localhost.key
<FilesMatch \.php$>
SetHandler "proxy:fcgi://~~fpm_host~~:~~fpm_port~~"
</FilesMatch>
# The shared httpd serves files from /mnt/users/{user}/{domain}/public_html
# but the FPM container has them at /home/{user}/public_html.
# Override both DOCUMENT_ROOT and SCRIPT_FILENAME so PHP sees the
# correct paths (required for plugins like WordFence that use
# $_SERVER['DOCUMENT_ROOT'] to locate config files).
ProxyFCGISetEnvIf "true" DOCUMENT_ROOT "/home/~~user~~/public_html"
ProxyFCGISetEnvIf "true" SCRIPT_FILENAME "/home/~~user~~/public_html%{reqenv:SCRIPT_NAME}"
DirectoryIndex index.php index.html index.htm
ErrorLog "/var/log/httpd/~~domain~~-error.log"
CustomLog "/var/log/httpd/~~domain~~-access.log" combined
</VirtualHost>
</IfModule>