From 7954ab8835aa06bb0768dbf8243f3de19291dc07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Grenier?= Date: Thu, 12 Jul 2018 22:54:51 -0300 Subject: [PATCH] make apache conf more compact, sometimes it gets large --- etc/alternc/templates/apache2/panel.conf | 10 +--------- etc/alternc/templates/apache2/url.conf | 7 +------ etc/alternc/templates/apache2/vhost-both.conf | 8 +------- etc/alternc/templates/apache2/vhost-http.conf | 11 +---------- etc/alternc/templates/apache2/vhost-https.conf | 8 +------- 5 files changed, 5 insertions(+), 39 deletions(-) diff --git a/etc/alternc/templates/apache2/panel.conf b/etc/alternc/templates/apache2/panel.conf index f2225296..20a14838 100644 --- a/etc/alternc/templates/apache2/panel.conf +++ b/etc/alternc/templates/apache2/panel.conf @@ -1,15 +1,13 @@ +# %%fqdn%% 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] - DocumentRoot /usr/share/alternc/panel/admin @@ -18,12 +16,9 @@ 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] @@ -31,13 +26,10 @@ 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%% - diff --git a/etc/alternc/templates/apache2/url.conf b/etc/alternc/templates/apache2/url.conf index 06c14fa1..4da6ac9c 100644 --- a/etc/alternc/templates/apache2/url.conf +++ b/etc/alternc/templates/apache2/url.conf @@ -1,28 +1,23 @@ +# %%fqdn%% 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 ^/(.*)$ %%redirect%%/$1 [R=301,L] - 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] - diff --git a/etc/alternc/templates/apache2/vhost-both.conf b/etc/alternc/templates/apache2/vhost-both.conf index 301834b8..c47e5f1f 100644 --- a/etc/alternc/templates/apache2/vhost-both.conf +++ b/etc/alternc/templates/apache2/vhost-both.conf @@ -1,9 +1,9 @@ +# %%fqdn%% ServerName %%fqdn%% DocumentRoot "%%document_root%%" AssignUserId #%%UID%% #%%GID%% SetEnv LOGIN "%%UID%%-%%LOGIN%%" - php_admin_value open_basedir "%%account_root%%:/usr/share/php/" php_admin_value upload_tmp_dir %%account_root%%/tmp @@ -12,15 +12,12 @@ Options +MultiViews -FollowSymLinks +SymLinksIfOwnerMatch AllowOverride AuthConfig FileInfo Limit Options Indexes - - ServerName %%fqdn%% DocumentRoot "%%document_root%%" AssignUserId #%%UID%% #%%GID%% SetEnv LOGIN "%%UID%%-%%LOGIN%%" - php_admin_value open_basedir "%%account_root%%:/usr/share/php/" php_admin_value upload_tmp_dir %%account_root%%/tmp @@ -29,11 +26,8 @@ Options +MultiViews -FollowSymLinks +SymLinksIfOwnerMatch AllowOverride AuthConfig FileInfo Limit Options Indexes - SSLEngine On SSLCertificateFile %%CRT%% SSLCertificateKeyFile %%KEY%% %%CHAINLINE%% - - diff --git a/etc/alternc/templates/apache2/vhost-http.conf b/etc/alternc/templates/apache2/vhost-http.conf index 9a31b45b..5b631ba1 100644 --- a/etc/alternc/templates/apache2/vhost-http.conf +++ b/etc/alternc/templates/apache2/vhost-http.conf @@ -1,28 +1,23 @@ +# %%fqdn%% 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] - SSLEngine On SSLCertificateFile %%CRT%% SSLCertificateKeyFile %%KEY%% %%CHAINLINE%% - - ServerName %%fqdn%% DocumentRoot "%%document_root%%" AssignUserId #%%UID%% #%%GID%% SetEnv LOGIN "%%UID%%-%%LOGIN%%" - php_admin_value open_basedir "%%account_root%%:/usr/share/php/" php_admin_value upload_tmp_dir %%account_root%%/tmp @@ -32,11 +27,7 @@ AllowOverride AuthConfig FileInfo Limit Options Indexes Require all granted - -# 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 # 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%%/" - - diff --git a/etc/alternc/templates/apache2/vhost-https.conf b/etc/alternc/templates/apache2/vhost-https.conf index 29b80df6..519be539 100644 --- a/etc/alternc/templates/apache2/vhost-https.conf +++ b/etc/alternc/templates/apache2/vhost-https.conf @@ -1,22 +1,19 @@ +# %%fqdn%% 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] - ServerName %%fqdn%% DocumentRoot "%%document_root%%" AssignUserId #%%UID%% #%%GID%% SetEnv LOGIN "%%UID%%-%%LOGIN%%" - php_admin_value open_basedir "%%account_root%%:/usr/share/php/" php_admin_value upload_tmp_dir %%account_root%%/tmp @@ -25,11 +22,8 @@ Options +MultiViews -FollowSymLinks +SymLinksIfOwnerMatch AllowOverride AuthConfig FileInfo Limit Options Indexes - SSLEngine On SSLCertificateFile %%CRT%% SSLCertificateKeyFile %%KEY%% %%CHAINLINE%% - -