Get the most out of your Centmin Mod LEMP stack
Become a Member

add post PHP & Nginx install/upgrade custom runtime scripts in 130.00beta01

Discussion in 'Centmin Mod Github Commits' started by eva2000, Jun 10, 2022.

  1. eva2000

    eva2000 Administrator Staff Member

    54,110
    12,179
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,739
    Local Time:
    4:50 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    add post PHP & Nginx install/upgrade custom runtime scripts in 130.00beta01


    - add a new function that can optionally be triggered after initial Centmin Mod install's Nginx/PHP install or after Nginx/PHP upgrade/recompiles via centmin.sh menu option 5. The purpose is so end users can script or add addition configuration/installation parameters to their Nginx/PHP installations i.e. install additional PHP extensions which Centmin Mod doesn't install or provide routines for out of the box or modify Nginx configuration parameters
    - on centmin.sh menu option 5 runs, added run_after_php_upgrade function which is triggered if prior to run, you create a shell script at /etc/centminmod/run-after-php-upgrade.sh - listing the additional SSH commands you want to run after PHP upgrade/recompiles
    - on initial Centmin Mod installation of PHP, add run_after_php_install function which is triggered when prior to install you create a shell script at /etc/centminmod/run-after-php-install.sh - listing the additional SSH commands you want to run after PHP initial installation
    - on centmin.sh menu option 4 runs, added run_after_nginx_upgrade function which is triggered if prior to run, you create a shell script at /etc/centminmod/run-after-nginx-upgrade.sh - listing the additional SSH commands you want to run after Nginx upgrade/recompiles
    - on initial Centmin Mod installation of Nginx, add run_after_nginx_install function which is triggered when prior to install you create a shell script at /etc/centminmod/run-after-nginx-install.sh - listing the additional SSH commands you want to run after Nginx initial installation
    - for example install PHP event extension which isn't provided by Centmin Mod requires the SSH commands outlined at https://community.centminmod.com/threads/install-php-8-1-event-extension.22911/#post-93405. If you placed those commands into /etc/centminmod/run-after-php-upgrade.sh and /etc/centminmod/run-after-php-install.sh, then Centmin Mod will run those commands after initial PHP install completion or after PHP upgrade/recompiles automatically
    - /etc/centminmod/run-after-nginx-upgrade.sh, /etc/centminmod/run-after-nginx-install.sh, /etc/centminmod/run-after-php-upgrade.sh, and /etc/centminmod/run-after-php-install.sh will accept any SSH commands so doesn't have to be for PHP extension installs or specific to Nginx. They can be system related if required i.e. creating custom directories you use etc.

    Continue reading...

    130.00beta01 branch
     
  2. eva2000

    eva2000 Administrator Staff Member

    54,110
    12,179
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,739
    Local Time:
    4:50 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    One note regarding adding SSH commands to those scripts is to instead of using cd to change into a directory use pushd to change into directory and popd at end of your very last SSH command to return to previous directory prior to pushd command. This ensures you do not accidentally change the rest of Centmin Mod's routines working directories

    So instead of
    Code (Text):
    cd /path/to/directory
    runcmd
    runlastcmd
    

    use the following with pushd/popd
    Code (Text):
    pushd /path/to/directory
    runcmd
    runlastcmd
    popd