Migrate_mpm script

Anyone used this script successfully?

$HESTIA/install/upgrade/manual/migrate_mpm_event.sh

thanks

Yes, with out any issues…

same here, works well.

thanks

lol, as per usual things don’t always work for me:

$HESTIA/install/upgrade/manual/migrate_mpm_event.sh
Module php7.3 disabled.
ERROR: The following modules depend on mpm_prefork and need to be disabled first: mpm_itk
Module mpm_itk disabled.
ERROR: Module mpm_prefork is enabled - cannot proceed due to conflicts. It needs to be disabled first!
Something went wrong, rolling back. Please try to migrate manually to mpm_event.
Considering dependency mpm_prefork for php7.3:
Considering conflict mpm_event for mpm_prefork:
Considering conflict mpm_worker for mpm_prefork:
Module mpm_prefork already enabled
Considering conflict php5 for php7.3:
Enabling module php7.3.
To activate the new configuration, you need to run:
systemctl restart apache2
Considering conflict mpm_event for mpm_prefork:
Considering conflict mpm_worker for mpm_prefork:
Module mpm_prefork already enabled
Considering dependency mpm_prefork for mpm_itk:
Considering conflict mpm_event for mpm_prefork:
Considering conflict mpm_worker for mpm_prefork:
Module mpm_prefork already enabled
Enabling module mpm_itk.
To activate the new configuration, you need

I do have one domain on php 5.6 due to script needs.

thanks

Can you change the line 27 from

a2modules="php5.6 php7.0 php7.1 php7.2 php7.3 php7.4 mpm_prefork mpm_itk ruid2"

to

a2modules="php5.6 php7.0 php7.1 php7.2 php7.3 php7.4 ruid2 mpm_itk mpm_prefork"

And give it again a run?

Problem was partially reproduced on our side too, and a fix was pushed here https://github.com/hestiacp/hestiacp/pull/1098/files

But even when disabling mpm modules in the wrong order, apache2ctl configtest should not have failed, there could be an additional problem there.

still a fail

$HESTIA/install/upgrade/manual/migrate_mpm_event.sh
Module php7.3 disabled.
ERROR: The following modules depend on mpm_prefork and need to be disabled first: mpm_itk
Module mpm_itk disabled.
ERROR: Module mpm_prefork is enabled - cannot proceed due to conflicts. It needs to be disabled first!
Something went wrong, rolling back. Please try to migrate manually to mpm_event.
Considering dependency mpm_prefork for php7.3:
Considering conflict mpm_event for mpm_prefork:
Considering conflict mpm_worker for mpm_prefork:
Module mpm_prefork already enabled
Considering conflict php5 for php7.3:
Enabling module php7.3.
To activate the new configuration, you need to run:
systemctl restart apache2
Considering conflict mpm_event for mpm_prefork:
Considering conflict mpm_worker for mpm_prefork:
Module mpm_prefork already enabled
Considering dependency mpm_prefork for mpm_itk:
Considering conflict mpm_event for mpm_prefork:
Considering conflict mpm_worker for mpm_prefork:
Module mpm_prefork already enabled
Enabling module mpm_itk.
To activate the new configuration, you need to run:
systemctl restart apache2

Have you applied the changes to migrate script? from the output it looks like the old one.

Fetch the last migrate script:

wget 'https://raw.githubusercontent.com/hestiacp/hestiacp/b6ba7aa384dc781d83125b32804eab56ab825340/install/upgrade/manual/migrate_mpm_event.sh' -O '/usr/local/hestia/install/upgrade/manual/migrate_mpm_event.sh'

Also post the output of apache2ctl configtest

yes i did apply edit, downloaded new script, still errors

$> $HESTIA/install/upgrade/manual/migrate_mpm_event.sh

Module php7.3 disabled.
Module mpm_itk disabled.
Module mpm_prefork disabled.
Enabling module mpm_event.
Something went wrong, rolling back. Please try to migrate manually to mpm_event.
Module mpm_event disabled.
Considering dependency mpm_prefork for php7.3:
Considering conflict mpm_event for mpm_prefork:
Considering conflict mpm_worker for mpm_prefork:
Enabling module mpm_prefork.
Considering conflict php5 for php7.3:
Enabling module php7.3.
To activate the new configuration, you need to run:
  systemctl restart apache2
Considering dependency mpm_prefork for mpm_itk:
Considering conflict mpm_event for mpm_prefork:
Considering conflict mpm_worker for mpm_prefork:
Module mpm_prefork already enabled
Enabling module mpm_itk.
To activate the new configuration, you need to run:
  systemctl restart apache2
Considering conflict mpm_event for mpm_prefork:
Considering conflict mpm_worker for mpm_prefork:
Module mpm_prefork already enabled
$> apache2ctl configtest
Syntax OK

Looks better now, mpm modules are disabled in the right order, still apache2ctl configtest fails and the migration is being rolled back

The error should be present in the apache logs:
journalctl --no-hostname -n 40 -u apache2.service

$> journalctl --no-hostname -n 40 -u apache2.service
-- Logs begin at Thu 2020-06-04 18:55:00 BST, end at Sat 2020-08-22 09:23:04 BST. --
Aug 16 00:00:05 systemd[1]: Reloaded The Apache HTTP Server.
Aug 20 22:35:55 systemd[1]: Reloading The Apache HTTP Server.
Aug 20 22:35:55 systemd[1]: Reloaded The Apache HTTP Server.
Aug 20 22:36:59 systemd[1]: Reloading The Apache HTTP Server.
Aug 20 22:36:59 systemd[1]: Reloaded The Apache HTTP Server.
Aug 20 22:41:49 systemd[1]: Reloading The Apache HTTP Server.
Aug 20 22:41:49 systemd[1]: Reloaded The Apache HTTP Server.
Aug 20 22:48:49 systemd[1]: Stopping The Apache HTTP Server...
Aug 20 22:48:49 systemd[1]: apache2.service: Succeeded.
Aug 20 22:48:49 systemd[1]: Stopped The Apache HTTP Server.
-- Reboot --
Aug 20 22:49:01 systemd[1]: Starting The Apache HTTP Server...
Aug 20 22:49:09 systemd[1]: Started The Apache HTTP Server.
Aug 21 01:34:54 systemd[1]: Reloading The Apache HTTP Server.
Aug 21 01:34:54 systemd[1]: Reloaded The Apache HTTP Server.
Aug 21 01:34:55 systemd[1]: Reloading The Apache HTTP Server.
Aug 21 01:34:55 systemd[1]: Reloaded The Apache HTTP Server.
Aug 21 01:34:55 systemd[1]: Reloading The Apache HTTP Server.
Aug 21 01:34:55 systemd[1]: Reloaded The Apache HTTP Server.
Aug 21 01:34:55 systemd[1]: Reloading The Apache HTTP Server.
Aug 21 01:34:55 systemd[1]: Reloaded The Apache HTTP Server.
Aug 21 11:46:41 systemd[1]: Reloading The Apache HTTP Server.
Aug 21 11:46:41 systemd[1]: Reloaded The Apache HTTP Server.
Aug 21 11:57:27 systemd[1]: Reloading The Apache HTTP Server.
Aug 21 11:57:28 systemd[1]: Reloaded The Apache HTTP Server.
Aug 21 12:19:07 systemd[1]: Reloading The Apache HTTP Server.
Aug 21 12:19:07 systemd[1]: Reloaded The Apache HTTP Server.
Aug 21 16:01:25 systemd[1]: Reloading The Apache HTTP Server.
Aug 21 16:01:26 systemd[1]: Reloaded The Apache HTTP Server.
Aug 21 16:01:26 systemd[1]: Reloading The Apache HTTP Server.
Aug 21 16:01:26 systemd[1]: Reloaded The Apache HTTP Server.
Aug 21 19:42:04 systemd[1]: Stopping The Apache HTTP Server...
Aug 21 19:42:04 systemd[1]: apache2.service: Succeeded.
Aug 21 19:42:04 systemd[1]: Stopped The Apache HTTP Server.
Aug 21 19:42:04 systemd[1]: Starting The Apache HTTP Server...
Aug 21 19:42:04 systemd[1]: Started The Apache HTTP Server.
Aug 22 08:19:54 systemd[1]: Stopping The Apache HTTP Server...
Aug 22 08:19:54 systemd[1]: apache2.service: Succeeded.
Aug 22 08:19:54 systemd[1]: Stopped The Apache HTTP Server.
Aug 22 08:19:54 systemd[1]: Starting The Apache HTTP Server...
Aug 22 08:19:54 systemd[1]: Started The Apache HTTP Server.

Nothing usefull there unfortunately.

Can you edit the migrate script so it doesn’t hide the output of configtest, like so:
/usr/local/hestia/install/upgrade/manual/migrate_mpm_event.sh

-- if ! apache2ctl configtest >/dev/null 2>&1; then
++ if ! apache2ctl configtest; then

ok have a clue now, going to get the file mentioned

$> /usr/local/hestia/install/upgrade/manual/migrate_mpm_event.sh
Module php7.3 disabled.
Module mpm_itk disabled.
Module mpm_prefork disabled.
Enabling module mpm_event.
AH00526: Syntax error on line 25 of /etc/apache2/conf.d/domains/christchurchwestgreen.org.conf:
Invalid command 'php_admin_value', perhaps misspelled or defined by a module not included in the server configuration
Action 'configtest' failed.
The Apache error log may have more information.
Something went wrong, rolling back. Please try to migrate manually to mpm_event.
Module mpm_event disabled.
Considering dependency mpm_prefork for php7.3:
Considering conflict mpm_event for mpm_prefork:
Considering conflict mpm_worker for mpm_prefork:
Enabling module mpm_prefork.
Considering conflict php5 for php7.3:
Enabling module php7.3.
To activate the new configuration, you need to run:
  systemctl restart apache2
Considering dependency mpm_prefork for mpm_itk:
Considering conflict mpm_event for mpm_prefork:
Considering conflict mpm_worker for mpm_prefork:
Module mpm_prefork already enabled
Enabling module mpm_itk.
To activate the new configuration, you need to run:
  systemctl restart apache2
Considering conflict mpm_event for mpm_prefork:
Considering conflict mpm_worker for mpm_prefork:
Module mpm_prefork already enabled

I can’t see anything obvious

$> cat /etc/apache2/conf.d/domains/christchurchwestgreen.org.conf

#=======================================================================#
# Default Web Domain Template                                           #
# DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS #
#=======================================================================#

<VirtualHost 176.9.39.21:8080>

    ServerName christchurchwestgreen.org
    ServerAlias www.christchurchwestgreen.org
    ServerAdmin [email protected]
    DocumentRoot /home/chwg/web/christchurchwestgreen.org/public_html
    ScriptAlias /cgi-bin/ /home/chwg/web/christchurchwestgreen.org/cgi-bin/
    Alias /vstats/ /home/chwg/web/christchurchwestgreen.org/stats/
    Alias /error/ /home/chwg/web/christchurchwestgreen.org/document_errors/
    #SuexecUserGroup chwg chwg
    CustomLog /var/log/apache2/domains/christchurchwestgreen.org.bytes bytes
    CustomLog /var/log/apache2/domains/christchurchwestgreen.org.log combined
    ErrorLog /var/log/apache2/domains/christchurchwestgreen.org.error.log
        
    IncludeOptional /home/chwg/conf/web/christchurchwestgreen.org/forcessl.apache2.conf*
    
    <Directory /home/chwg/web/christchurchwestgreen.org/public_html>
        AllowOverride All
        Options +Includes -Indexes +ExecCGI
        php_admin_value upload_max_filesize 10M
        php_admin_value max_execution_time 20
        php_admin_value post_max_size  8M
        php_admin_value memory_limit 32M
        php_admin_flag mysql.allow_persistent  off
        php_admin_flag safe_mode off
        php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -f [email protected]"
        php_admin_value open_basedir /home/chwg/web/christchurchwestgreen.org/public_html:/home/chwg/tmp:/bin:/usr/bin:/usr/local/bin:/var/www/html:/tmp:/usr/share:/etc/phpMyAdmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/etc/roundcubemail:/etc/roundcube:/var/lib/roundcube
        php_admin_value upload_tmp_dir /home/chwg/tmp
        php_admin_value session.save_path /home/chwg/tmp
    </Directory>
    <Directory /home/chwg/web/christchurchwestgreen.org/stats>
        AllowOverride All
    </Directory>
    <IfModule mod_ruid2.c>
        RMode config
        RUidGid chwg chwg
        RGroups www-data
    </IfModule>
    <IfModule mpm_itk.c>
        AssignUserID chwg chwg
    </IfModule>

    IncludeOptional /home/chwg/conf/web/christchurchwestgreen.org/apache2.conf_*

</VirtualHost>

php_admin_value is something you might see in the apache templates. setting php vars that way only works with prefork

so you probably just want to switch that domain to use another template - don’t edit the .conf file or template itself, as it will be overwritten on updates/rebuilds!

also be aware, that these kind of directives and settings are commonly used in .htaccess for quite some CMSes/plugins etc.
with moving away from prefork, you must understand, that you might need to adjust quite some things and e.g. switch over to use .user.ini instead…

so don’t complain or say you haven’t been warned! :wink: :stuck_out_tongue:

ok, will investigate what changes may be needed before doing change.

thanks