Various scripts which help administration of DirectAdmin servers easier
Go to file
Yavuz Aydın ab89e9d4de Initial release 2022-11-11 10:31:17 +01:00
README.md Initial release 2022-11-11 10:31:17 +01:00
da_php_swap_version.sh Initial release 2022-11-11 10:31:17 +01:00
da_php_update_version.sh Initial release 2022-11-11 10:31:17 +01:00
da_php_version_selections.sh Initial release 2022-11-11 10:31:17 +01:00

README.md

DirectAdmin Scripts

Various scripts which help administration of DirectAdmin servers easier.

da_php_version_selections.sh

A script to show, save, and restore selection of the PHP version for each domain. Its intented use case is when there's a need to upgrade the PHP versions installed on the server, or change the default PHP version. It allows you to save the current version used by domains, and then after options.conf is updated, modify selections to ensure the same (if possible) version of PHP is used, even though the release number has changed. See comments in the script for more details.

A typical use case/scenario would be:

  1. You save the current PHP selections:
    da_php_version_selections.sh > ~/selections.txt
    
  2. You update options.conf and rearrange PHP versions, or change the default
  3. You update selections to make sure domains get the correct PHP version,
    da_php_version_selections.sh selections.txt
    
  4. You run /usr/local/directadmin/custombuild/build rewrite_confs

da_php_swap_version.sh

Swap version index numbers in config. This might be helpful when changing the order of your php-fpm index numbers in the DirectAdmin configuration.

In case version "1" has been requested, change configs with no version set, as "1" is the default.

A typical use case/scenario would be:

  1. Check which PHP versions are installed in which order:
    egrep php[1,2,3,4]_release= /usr/local/directadmin/custombuild/options.conf
    
    Output:
    php1_release=7.2
    php2_release=7.0
    php3_release=7.4
    php4_release=no
    
  2. Let's make 7.4 the default PHP versions:
    da_php_swap_version.sh 1 3
    
  3. Update DirectAdmin options and rebuild php:
    /usr/local/directadmin/custombuild/build set php1_release 7.4
    /usr/local/directadmin/custombuild/build set php3_release 7.2
    /usr/local/directadmin/custombuild/build php n
    

da_php_update_version.sh

Search for specific PHP version (1-4) and replace with specified version. If replacement of version "1" has been requested, change configs with no version set, as "1" is the default.

A typical use case/scenario would be:

  1. Check which PHP versions are installed in which order:
    egrep php[1,2,3,4]_release= /usr/local/directadmin/custombuild/options.conf
    
    Output:
    php1_release=7.2
    php2_release=7.0
    php3_release=7.4
    php4_release=no
    
  2. We want to retire PHP 7.0, let's update config for all websites currently using PHP 7.0 to make use of PHP 7.4:
    da_php_update_version.sh -s 2 -r 3
    
  3. Rewrite configurations:
    /usr/local/directadmin/custombuild/build rewrite_confs