[enh] Update template files

* When a dommain type has an ssl support, template have as
suffixhttps,http, both* On each case we support each port with(out)
redirect*By default we support acme-challenge protocol
This commit is contained in:
azerttyu 2018-06-22 17:59:29 +02:00
parent 5079aa2e03
commit 4ee6ae395e
9 changed files with 75 additions and 93 deletions

View File

@ -1,42 +0,0 @@
<Virtualhost *:80>
ServerName %%fqdn%%
AssignUserId #%%UID%% #%%GID%%
SetEnv LOGIN "%%UID%%-%%LOGIN%%"
KeepAlive Off
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !/cgi-bin/
RewriteRule ^/(.*)$ https://%%fqdn%%/$1 [R=301,L]
</Virtualhost>
<VirtualHost *:443>
DocumentRoot /usr/share/alternc/panel/admin
AssignUserId alterncpanel alterncpanel
SetEnv LOGIN "%%UID%%-%%LOGIN%%"
ServerName %%fqdn%%
RewriteEngine on
RewriteRule ^/admin/(.*) /$1
alias /alternc-sql /usr/share/phpmyadmin
RewriteEngine On
RewriteRule ^webmail /webmail-redirect.php [L]
# Mail autoconfig
RewriteRule ^mail/mailautoconfig.xml$ /mailautoconfig_thunderbird.php [L]
RewriteRule ^mail/config-v1.1.xml$ /mailautoconfig_thunderbird.php [L]
RewriteRule ^autodiscover/autodiscover.xml$ /mailautoconfig_outlook.php [L]
RewriteRule ^Autodiscover/Autodiscover.xml$ /mailautoconfig_outlook.php [L]
RewriteRule ^Autodiscover.xml$ mailautoconfig_outlook.php [L]
RewriteRule ^autodiscover.xml$ mailautoconfig_outlook.php [L]
# will be used to define aliases such as /javascript /squirrelmail ...
Include /etc/alternc/apache-panel.d/*.conf
SSLEngine On
SSLCertificateFile %%CRT%%
SSLCertificateKeyFile %%KEY%%
%%CHAINLINE%%
</VirtualHost>

View File

@ -1,11 +1,24 @@
<VirtualHost *:80> <Virtualhost *:80>
ServerName %%fqdn%%
AssignUserId #%%UID%% #%%GID%%
SetEnv LOGIN "%%UID%%-%%LOGIN%%"
KeepAlive Off
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !/cgi-bin/
RewriteCond %{REQUEST_FILENAME} !/.well-known/acme-challenge/
RewriteRule ^/(.*)$ https://%%fqdn%%/$1 [R=301,L]
</Virtualhost>
<VirtualHost *:443>
DocumentRoot /usr/share/alternc/panel/admin DocumentRoot /usr/share/alternc/panel/admin
AssignUserId alterncpanel alterncpanel AssignUserId alterncpanel alterncpanel
SetEnv LOGIN "%%UID%%-%%LOGIN%%" SetEnv LOGIN "%%UID%%-%%LOGIN%%"
ServerName %%fqdn%% ServerName %%fqdn%%
RewriteEngine on RewriteEngine on
RewriteRule ^/admin/(.*) /$1 RewriteRule ^/admin/(.*) /$1
alias /alternc-sql /usr/share/phpmyadmin alias /alternc-sql /usr/share/phpmyadmin
RewriteEngine On RewriteEngine On
@ -22,4 +35,9 @@
# will be used to define aliases such as /javascript /squirrelmail ... # will be used to define aliases such as /javascript /squirrelmail ...
Include /etc/alternc/apache-panel.d/*.conf Include /etc/alternc/apache-panel.d/*.conf
SSLEngine On
SSLCertificateFile %%CRT%%
SSLCertificateKeyFile %%KEY%%
%%CHAINLINE%%
</VirtualHost> </VirtualHost>

View File

@ -1,13 +1,14 @@
<Virtualhost *:80> <Virtualhost *:80>
ServerName %%fqdn%% ServerName %%fqdn%%
AssignUserId #%%UID%% #%%GID%% AssignUserId #%%UID%% #%%GID%%
SetEnv LOGIN "%%UID%%-%%LOGIN%%" SetEnv LOGIN "%%UID%%-%%LOGIN%%"
KeepAlive Off KeepAlive Off
RewriteEngine On RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !/cgi-bin/ RewriteCond %{REQUEST_FILENAME} !/cgi-bin/
RewriteRule ^/(.*)$ https://%%fqdn%%/$1 [R=301,L] RewriteCond %{REQUEST_FILENAME} !/.well-known/acme-challenge/
RewriteRule ^/(.*)$ https://%%fqdn%%/$1 [R=301,L]
</Virtualhost> </Virtualhost>
<VirtualHost *:443> <VirtualHost *:443>

View File

@ -1,13 +1,14 @@
<Virtualhost *:80> <Virtualhost *:80>
ServerName %%fqdn%% ServerName %%fqdn%%
AssignUserId #%%UID%% #%%GID%% AssignUserId #%%UID%% #%%GID%%
SetEnv LOGIN "%%UID%%-%%LOGIN%%" SetEnv LOGIN "%%UID%%-%%LOGIN%%"
KeepAlive Off KeepAlive Off
RewriteEngine On RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !/cgi-bin/ RewriteCond %{REQUEST_FILENAME} !/cgi-bin/
RewriteRule ^/(.*)$ https://%%fqdn%%/$1 [R=301,L] RewriteCond %{REQUEST_FILENAME} !/.well-known/acme-challenge/
RewriteRule ^/(.*)$ https://%%fqdn%%/$1 [R=301,L]
</Virtualhost> </Virtualhost>
<VirtualHost *:443> <VirtualHost *:443>

View File

@ -1,27 +0,0 @@
<Virtualhost *:80>
ServerName %%fqdn%%
AssignUserId #%%UID%% #%%GID%%
SetEnv LOGIN "%%UID%%-%%LOGIN%%"
KeepAlive Off
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !/cgi-bin/
RewriteRule ^/(.*)$ %%redirect%%/$1 [R=301,L]
</Virtualhost>
<VirtualHost *:443>
ServerName %%fqdn%%
AssignUserId #%%UID%% #%%GID%%
SetEnv LOGIN "%%UID%%-%%LOGIN%%"
SSLEngine On
SSLCertificateFile %%CRT%%
SSLCertificateKeyFile %%KEY%%
%%CHAINLINE%%
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !/cgi-bin/
RewriteRule ^/(.*)$ %%redirect%%/$1 [R=301,L]
</VirtualHost>

View File

@ -1,12 +1,28 @@
<Virtualhost *:80> <Virtualhost *:80>
ServerName %%fqdn%% ServerName %%fqdn%%
AssignUserId #%%UID%% #%%GID%% AssignUserId #%%UID%% #%%GID%%
SetEnv LOGIN "%%UID%%-%%LOGIN%%" SetEnv LOGIN "%%UID%%-%%LOGIN%%"
KeepAlive Off KeepAlive Off
RewriteEngine On RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !/cgi-bin/ RewriteCond %{REQUEST_FILENAME} !/cgi-bin/
RewriteRule ^/(.*)$ %%redirect%%/$1 [R=301,L] RewriteCond %{REQUEST_FILENAME} !/.well-known/acme-challenge/
RewriteRule ^/(.*)$ %%redirect%%/$1 [R=301,L]
</Virtualhost> </Virtualhost>
<VirtualHost *:443>
ServerName %%fqdn%%
AssignUserId #%%UID%% #%%GID%%
SetEnv LOGIN "%%UID%%-%%LOGIN%%"
SSLEngine On
SSLCertificateFile %%CRT%%
SSLCertificateKeyFile %%KEY%%
%%CHAINLINE%%
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !/cgi-bin/
RewriteRule ^/(.*)$ %%redirect%%/$1 [R=301,L]
</VirtualHost>

View File

@ -1,3 +1,17 @@
<Virtualhost *:443>
ServerName %%fqdn%%
AssignUserId #%%UID%% #%%GID%%
SetEnv LOGIN "%%UID%%-%%LOGIN%%"
KeepAlive Off
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !/cgi-bin/
RewriteCond %{REQUEST_FILENAME} !/.well-known/acme-challenge/
RewriteRule ^/(.*)$ http://%%fqdn%%/$1 [R=301,L]
</Virtualhost>
<VirtualHost *:80> <VirtualHost *:80>
ServerName %%fqdn%% ServerName %%fqdn%%
DocumentRoot "%%document_root%%" DocumentRoot "%%document_root%%"
@ -16,8 +30,8 @@
Require all granted Require all granted
</Directory> </Directory>
# If you want to log the errors also in /var/log/alternc/sites/ # If you want to log the errors also in /var/log/alternc/sites/
# WARNING: this WILL FORK a vlogger for EACH VHOST havingg this !!! the load on the machine may be high # WARNING: this WILL FORK a vlogger for EACH VHOST havingg this !!! the load on the machine may be high
# on hosting with many vhosts. as a consequence, this is disabled by default # on hosting with many vhosts. as a consequence, this is disabled by default
# ErrorLog "|| /usr/sbin/vlogger -e -u alterncpanel -g alterncpanel -s error.log -t \"error-%Y%m%d.log\" /var/log/alternc/sites/%%UID%%-%%LOGIN%%/" # ErrorLog "|| /usr/sbin/vlogger -e -u alterncpanel -g alterncpanel -s error.log -t \"error-%Y%m%d.log\" /var/log/alternc/sites/%%UID%%-%%LOGIN%%/"

View File

@ -1,13 +1,14 @@
<Virtualhost *:80> <Virtualhost *:80>
ServerName %%fqdn%% ServerName %%fqdn%%
AssignUserId #%%UID%% #%%GID%% AssignUserId #%%UID%% #%%GID%%
SetEnv LOGIN "%%UID%%-%%LOGIN%%" SetEnv LOGIN "%%UID%%-%%LOGIN%%"
KeepAlive Off KeepAlive Off
RewriteEngine On RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !/cgi-bin/ RewriteCond %{REQUEST_FILENAME} !/cgi-bin/
RewriteRule ^/(.*)$ https://%%fqdn%%/$1 [R=301,L] RewriteCond %{REQUEST_FILENAME} !/.well-known/acme-challenge/
RewriteRule ^/(.*)$ https://%%fqdn%%/$1 [R=301,L]
</Virtualhost> </Virtualhost>
<VirtualHost *:443> <VirtualHost *:443>