Просмотр исходного кода

Added a manual migration script for apache2 mpm_event.

Raphael Schneeberger 5 лет назад
Родитель
Сommit
c8303bef79
2 измененных файлов с 40 добавлено и 1 удалено
  1. 2 1
      CHANGELOG.md
  2. 38 0
      install/upgrade/manual/migrate_mpm_event.sh

+ 2 - 1
CHANGELOG.md

@@ -10,7 +10,8 @@ All notable changes to this project will be documented in this file.
 - Added Roundcube plugins newmail_notifier and zipdownload.
 - Added HELO support for multiple domains and IPs.
 - Added the possibility to manage ssh keys in the backend.
-- Switched to mod_event instead mod_prefork for apache2.
+- Switched to mpm_event instead mod_prefork for apache2 on fresh installs.
+- Added a manual migration script for apache2 mpm_event ($HESTIA/install/upgrade/manual/migrate_mpm_event.sh).
 
 ### Bugfixes
 - Do not allow to show apache2 server-status page from public.

+ 38 - 0
install/upgrade/manual/migrate_mpm_event.sh

@@ -0,0 +1,38 @@
+#!/bin/bash
+
+# This script migrates your apache2 installation form mod_prefork to mpm_event.
+
+# Includes
+source $HESTIA/conf/hestia.conf
+
+# Check if apache2 is in use
+if [ "$WEB_SYSTEM" != "apache2" ]; then
+    echo "Apache2 isnt installed on your system, canceling migration..."
+    exit
+fi
+
+# Check if mod_event is already enabled
+if apache2ctl -M | grep -q mpm_event_module; then
+    echo "mod_event is already enabled, canceling migration..."
+    exit
+fi
+
+# Disable prefork and php, enable event
+a2dismod php5.6 > /dev/null 2>&1
+a2dismod php7.0 > /dev/null 2>&1
+a2dismod php7.1 > /dev/null 2>&1
+a2dismod php7.2 > /dev/null 2>&1
+a2dismod php7.3 > /dev/null 2>&1
+a2dismod php7.4 > /dev/null 2>&1
+a2dismod mpm_prefork > /dev/null 2>&1
+a2enmod mpm_event > /dev/null 2>&1
+
+# Restart apache2 service
+systemctl restart apache2
+
+# Check if all went well
+if apache2ctl -M | grep -q mpm_event_module; then
+    echo "mpm_event module was successfully activated."
+else
+    echo "Something went wrong, please try to migrate manualy to mpm_event."
+fi