From 1e9a68db95fda1219a477bd65148def0cbd7b0f5 Mon Sep 17 00:00:00 2001
From: "ncomputers.org" <contact@ncomputers.org>
Date: Sat, 4 Mar 2017 11:33:00 -0600
Subject: [PATCH] updated

---
 server/plugins-available/apache2_plugin.inc.php | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/server/plugins-available/apache2_plugin.inc.php b/server/plugins-available/apache2_plugin.inc.php
index c23b69edf9..c4059e42c4 100644
--- a/server/plugins-available/apache2_plugin.inc.php
+++ b/server/plugins-available/apache2_plugin.inc.php
@@ -1514,7 +1514,13 @@ class apache2_plugin {
 
 		//* If we have some alias records
 		if($server_alias) {
-			$tpl->setVar('alias', 'ServerAlias '.implode(' ',$server_alias));
+			//* begin a new ServerAlias line after 32 alias domains to avoid apache bugs
+			$server_alias_str = 'ServerAlias '.$server_alias[0];
+			for($n=1;$n<count($server_alias);++$n)
+				$server_alias_str .= ($n % 32?' ':"\nServerAlias ").$server_alias[$n];
+			$tpl->setVar('alias', $server_alias_str);
+			unset($server_alias_str);
+			unset($n);
 		} else {
 			$tpl->setVar('alias', '');
 		}
-- 
GitLab