Latest "PHP" files
Workshop » Reference Section » Grimoires » IT » Platforms » Linux » Packages » PHP

Enable PHP 8.4 in Apache on Debian

According to the installer, to enable PHP 8.4 FPM in Apache2 do:
a2enmod proxy_fcgi setenvif
a2enconf php8.4-fpm

Workshop » Reference Section » Grimoires » IT » Platforms » Linux » Packages » PHP

How to monitor RAM for tuning pm.max_children

How to monitor RAM usage:

  1. free -h:

    • This command shows your system's total, used, and free memory in a human-readable format.
    • Key metrics:
      • total: Total RAM.
      • used: RAM currently in use.
      • free: Unused RAM.
      • buff/cache: RAM used for file system buffers and page cache. This is good; Linux uses free RAM for this and frees it when applications need it.
      • available: The most important metric. This estimates how much memory is available for starting new applications without swapping.
    • Run it before and after: Run free -h before you increase max_children and then after your server has been running for a while under typical load with the new settings. Compare the available memory.
  2. htop (recommended if installed):

    • htop (you might need to sudo…
Workshop » Reference Section » Grimoires » IT » Platforms » Linux » Packages » Apache

Add /fpm-status page to Apache virtual host

Add this to virtual host file in /etc/apache2/sites-available/, right below DocumentRoot, in both :80 and :443 sections



SetHandler "proxy:unix:/var/php-fpm/170027027353667.sock|fcgi://127.0.0.1"
Require all granted

May need in /etc/php/8.2/fpm/pool.d/www.conf, not sure:
pm.status_path = /fpm-status

May need at very start of .htaccess to prevent wordpress from intercepting the URL, not sure:
RewriteRule ^fpm-status$ - [L]

Linux

Linux SQL Tuning Utilities

1. tuning-primer.sh

Run from Github:
curl -L https://raw.githubusercontent.com/BMDan/tuning-primer.sh/main/tuning-primer.sh | bash

2. MySQLTuner.pl

wget http://mysqltuner.pl/ -O mysqltuner.pl
wget https://raw.githubusercontent.com/major/MySQLTuner-perl/master/basic_passwords.txt -O basic_passwords.txt
wget https://raw.githubusercontent.com/major/MySQLTuner-perl/master/vulnerabilities.csv -O vulnerabilities.csv
perl mysqltuner.pl --host 127.0.0.1 --user [user] --pass [pass]

Remember to quote any punctuation or BASH tokens in the password.