<?xml version="1.0"?>
<rss version="2.0"><channel><title>CWP - Control WEB Panel Latest Topics</title><link>https://www.alphagnu.com/forum/7-cwp-control-web-panel/</link><description>CWP - Control WEB Panel Latest Topics</description><language>en</language><item><title>Standalone CWP PHP CLI Build Manager: Build PHP 7.4&#x2013;8.5, PHP-FPM, Selector, Switcher and PIE Extensions</title><link>https://www.alphagnu.com/topic/633-standalone-cwp-php-cli-build-manager-build-php-7485-php-fpm-selector-switcher-and-pie-extensions/</link><description><![CDATA[<h1>AlphaGNU Standalone CWP PHP Build Manager</h1><p>Managing multiple PHP versions on CWP can sometimes be difficult, especially when dependency issues involving <strong>zlib, libzip, PCRE2, GD, or other libraries</strong> cause normal PHP builds to fail.</p><p>The <strong>AlphaGNU Standalone CLI CWP PHP Build Manager</strong> provides a simple alternative: build PHP directly from official PHP source while maintaining CWP-compatible PHP layouts.</p><h2>Why use it?</h2><p>If PHP installation is failing on a server because of dependency or repository problems, this manager can be used to <strong>quickly build and install the required PHP version</strong> without relying on CWP's PHP build scripts or Remi PHP packages.</p><p>It supports:</p><ul><li><p>PHP 7.4.x through PHP 8.5.x</p></li><li><p>PHP Selector</p></li><li><p>PHP-FPM</p></li><li><p>PHP Switcher</p></li><li><p>Multiple PHP versions in one command</p></li><li><p>One-line CLI installation</p></li><li><p>PIE extension installation</p></li><li><p>Dedicated PHP 8.5 runtime for PIE</p></li><li><p>Automatic dependencies for extensions such as Redis, Memcached and Imagick</p></li></ul><hr><h2>Installation/Update</h2><p>This script will install the latest PHP even if it is not released in the CWP repository; it will download it from <a rel="external nofollow" href="https://php.net">php.net</a> when you specify the version during installation.</p><p>Download the latest package:<br></p><p>Install it:</p><pre spellcheck="" class="ipsCode language-bash" data-language="Bash"><code>rm -rf /root/php-manager
mkdir -p /root/php-manager
cd /root/php-manager
wget https://www.alphagnu.com/upload/cwp-php-manager/cwp_php_manager_alphagnu_v2.zip
unzip cwp_php_manager_alphagnu_v2.zip
chmod +x install.sh bin/*
./install.sh
sed -i -E '/^[[:space:]]*extension_dir[[:space:]]*=[[:space:]]*["'\'']\/usr\/local\/lib\/php\/extensions\/no-debug-non-zts-[0-9]+["'\''][[:space:]]*$/ s/^/;/' /usr/local/php/php.ini  
</code></pre><p>Verify:</p><pre spellcheck="" class="ipsCode language-bash" data-language="Bash"><code>php-manager --help
</code></pre><p>Start the interactive menu:</p><pre spellcheck="" class="ipsCode language-bash" data-language="Bash"><code>php-manager
</code></pre><hr><h2>Build PHP Versions</h2><h3>PHP Selector</h3><p>Build multiple versions:</p><pre spellcheck="" class="ipsCode language-bash" data-language="Bash"><code>php-manager selector 7.4.33 8.2.29 8.3.8 8.4.25 8.5.10
</code></pre><p>Installed under:</p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>/opt/alt/phpXY/usr/
</code></pre><h3>PHP-FPM Selector</h3><pre spellcheck="" class="ipsCode language-bash" data-language="Bash"><code>php-manager fpm 7.4.33 8.2.29 8.3.8 8.4.25 8.5.10
</code></pre><p>Installed under:</p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>/opt/alt/php-fpmXY/usr/
</code></pre><h3>PHP Switcher</h3><p>Switcher uses one exact version:</p><pre spellcheck="" class="ipsCode language-bash" data-language="Bash"><code>php-manager switcher 8.5.10
</code></pre><p>Installed under:</p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>/usr/local/php/
</code></pre><hr><h2>Dedicated PHP Runtime for PIE</h2><p>The manager includes a <strong>separate PHP 8.5 CLI runtime exclusively for PIE</strong>. The first time you run the PIE installer, it will take some time because PHP will be built.</p><p>It is installed at:</p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>/usr/local/php-pie/
</code></pre><p>Build or verify it with:</p><pre spellcheck="" class="ipsCode language-bash" data-language="Bash"><code>php-manager pie-runtime 8.5.10
</code></pre><p>Verify:</p><pre spellcheck="" class="ipsCode language-bash" data-language="Bash"><code>/usr/local/php-pie/bin/php -v
</code></pre><p>This runtime does <strong>not</strong> replace the server's default PHP and does not create an FPM service.</p><hr><h2>Install PHP Extensions with PIE</h2><p>You can find available PHP extension package names by visiting:</p><p><a rel="external nofollow" href="https://packagist.org/extensions">https://packagist.org/extensions</a></p><p>Search for the extension you want to install and use its PIE package name.</p><h3>Install an Extension for PHP-FPM</h3><p>For example, install Memcached for PHP-FPM 7.4:</p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>php-manager pie 7.4 php-memcached/php-memcached fpm</code></pre><p>Redis:</p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>php-manager pie 7.4 phpredis/phpredis fpm</code></pre><p>Imagick:</p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>php-manager pie 7.4 imagick/imagick fpm</code></pre><p>APCu:</p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>php-manager pie 7.4 apcu/apcu fpm</code></pre><p>You can also specify the <strong>exact PHP version</strong>:</p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>php-manager pie 7.4.33 imagick/imagick fpm</code></pre><p>When using only the major/minor version, such as <code>7.4</code>, PHP Manager automatically detects the installed PHP 7.4.x version.</p><h3>Install an Extension for Multiple PHP Versions</h3><p>You can install the same extension for multiple PHP versions in a single command:</p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>php-manager pie 8.0 8.1 8.2 8.3 8.4 8.5 imagick/imagick fpm</code></pre><p>The manager resolves each minor version to the corresponding installed PHP version and installs the extension for each target.</p><h3>Install an Extension for All PHP Versions</h3><p>To install an extension for <strong>all installed PHP versions across all three PHP managers</strong>, use:</p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>php-manager pie all imagick/imagick</code></pre><p>You can also restrict <code>all</code> to a specific PHP manager:</p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>php-manager pie all imagick/imagick fpm</code></pre><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>php-manager pie all imagick/imagick selector</code></pre><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>php-manager pie all imagick/imagick switcher</code></pre><h3>PHP Manager Targets</h3><p>Use the following target names:</p><div class="ipsRichText__table-wrapper"><table style="min-width: 40px;"><colgroup><col style="min-width:20px;"><col style="min-width:20px;"></colgroup><tbody><tr><th colspan="1" rowspan="1"><p>Target</p></th><th colspan="1" rowspan="1"><p>PHP Manager</p></th></tr><tr><td colspan="1" rowspan="1"><p><code>fpm</code></p></td><td colspan="1" rowspan="1"><p>PHP-FPM Selector</p></td></tr><tr><td colspan="1" rowspan="1"><p><code>selector</code></p></td><td colspan="1" rowspan="1"><p>PHP Selector</p></td></tr><tr><td colspan="1" rowspan="1"><p><code>switcher</code></p></td><td colspan="1" rowspan="1"><p>PHP Switcher</p></td></tr></tbody></table></div><p>For example:</p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>php-manager pie 8.3 imagick/imagick fpm</code></pre><p>installs Imagick for the installed PHP 8.3.x <strong>PHP-FPM Selector</strong> version.</p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>php-manager pie 8.3 imagick/imagick selector</code></pre><p>installs Imagick for the installed PHP 8.3.x <strong>PHP Selector</strong> version.</p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>php-manager pie 8.3 imagick/imagick switcher</code></pre><p>installs Imagick for the installed PHP 8.3.x <strong>PHP Switcher</strong> version.</p><h3>PIE Runtime</h3><p>PIE runs using the dedicated PHP 8.5 runtime:</p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>/usr/local/php-pie/bin/php</code></pre><p>The PIE runtime is separate from the PHP Selector, PHP-FPM Selector, and PHP Switcher installations.</p><p>The extension is compiled against the selected target PHP version using that target's own:</p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>phpize
php-config</code></pre><p>This allows the dedicated PIE runtime to build extensions for the selected PHP installation while keeping the existing PHP Manager installations separate.</p><hr><h2>Quick PHP Recovery / Alternative Build Method</h2><p>On some servers, the standard CWP PHP build process can fail because of dependency problems such as:</p><ul><li><p>zlib</p></li><li><p>libzip</p></li><li><p>PCRE2</p></li><li><p>GD libraries</p></li><li><p>incompatible system development packages</p></li></ul><p>Instead of spending time troubleshooting the CWP build wrapper, you can use AlphaGNU PHP Manager to build the required PHP version directly from the official PHP source.</p><p>For example:</p><pre spellcheck="" class="ipsCode language-bash" data-language="Bash"><code>php-manager fpm 8.3.8
</code></pre><p>or:</p><pre spellcheck="" class="ipsCode language-bash" data-language="Bash"><code>php-manager selector 8.3.8
</code></pre><p>This makes the manager useful not only for installing additional PHP versions, but also as a <strong>quick alternative when the normal CWP PHP build process is blocked by dependency issues</strong>.</p><hr><h2>Summary</h2><p>AlphaGNU PHP Manager provides a standalone way to manage PHP versions on CWP-compatible servers without depending on CWP's PHP build wrapper scripts or Remi repositories.</p><p>It supports:</p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>PHP Selector
PHP-FPM
PHP Switcher
PIE Extensions
Dedicated PHP 8.5 PIE Runtime
Multiple PHP Versions
One-Line Builds
</code></pre><p>For servers where normal PHP builds are failing due to dependency problems, it provides a practical and faster alternative for getting the required PHP version installed.</p><p><img class="ipsImage ipsImage_thumbnailed ipsRichText__align--block" data-fileid="14" src="https://www.alphagnu.com/uploads/monthly_2026_09/Screenshot2026-09-02123040.png.6af70d347204a5e09be3f317eb4972bb.png" alt="Screenshot 2026-09-02 123040.png" title="Screenshot 2026-09-02 123040.png" width="919" height="697" data-full-image="https://www.alphagnu.com/uploads/monthly_2026_09/Screenshot2026-09-02123040.png.6af70d347204a5e09be3f317eb4972bb.png" loading="lazy"></p><p><img class="ipsImage ipsImage_thumbnailed ipsRichText__align--block" data-fileid="15" src="https://www.alphagnu.com/uploads/monthly_2026_09/Screenshot2026-09-02123216.png.a74abc4efdaa986ddb3dbb340cc95b08.png" alt="Screenshot 2026-09-02 123216.png" title="Screenshot 2026-09-02 123216.png" width="919" height="697" data-full-image="https://www.alphagnu.com/uploads/monthly_2026_09/Screenshot2026-09-02123216.png.a74abc4efdaa986ddb3dbb340cc95b08.png" loading="lazy"></p>]]></description><guid isPermaLink="false">633</guid><pubDate>Wed, 02 Sep 2026 07:03:06 +0000</pubDate></item><item><title>Critical Vulnerability in CSF MESSENGER  (CVE-2026-67402) - 03/September/2026</title><link>https://www.alphagnu.com/topic/634-critical-vulnerability-in-csf-messenger-cve-2026-67402-03september2026/</link><description><![CDATA[<p>Check: &lt;<a rel="external nofollow" href="https://nvd.nist.gov/vuln/detail/CVE-2026-67402">https://nvd.nist.gov/vuln/detail/CVE-2026-67402</a>&gt;</p><p>Check: <br><br>A critical vulnerability was found in the MESSENGER service in the ConfigServer Firewall (CSF) software which could allow for unauthorized code execution.<br><span style="font-family: Arial, Helvetica, sans-serif;">An insecure Apache configuration in ConfigServer Security &amp; Firewall maps /usr/bin as CGI programs through the Messenger v3 HTTPS virtual host. A remote unauthenticated attacker whose address is blocked can request a mapped executable and run arbitrary commands as the Apache user. The vulnerability affects installations where CSF Messenger v3 and its HTTPS mode are enabled. WebPros (Cpanel team) addressed the vulnerability in version 16.31.</span></p><p>This has a public CVE record listed with further information: CVE-2026-67402<br></p><p><strong>Note:</strong> By default, the MESSENGER service is disabled.<br></p><p><strong>Affected Product versions:</strong><br>Product: csf</p><p>Affected Versions: CSF	16.30-1 and older</p><p>Patched Versions: 16.31+</p><p></p><p><strong>Impact:</strong><br>Exploiting this could allow an attacker to execute code as the Apache user.</p><p><br><strong>Mitigation:</strong></p><p>It is highly recommended that you update the installed CSF version as soon as possible.</p><p>If this is not possible, you can disable the MESSENGERV3 setting in CSF.</p><p>Access the server as the root user via SSH, or the Terminal in WHM.</p><p>Edit the CSF configuration file:</p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>nano /etc/csf/csf.conf</code></pre><p>Update the MESSENGERV3 option to be disabled:</p><div class="ipsRichTextBox ipsRichTextBox--alwaysopen"><div class="ipsRichTextBox__title"><p></p></div><p>MESSENGERV3 = 0</p></div><p>Save and restart the CSF and LFD services:</p><div class="ipsRichTextBox ipsRichTextBox--alwaysopen"><div class="ipsRichTextBox__title"><p></p></div><p>csf -ra</p></div><p><br>Version from Aetherinox was not updated yet. Is recommmended you use mitigation above.<br><br>Do it <strong>as soon as</strong> possible, my self server already was attacked.<br><br>Regards,<br>Netino<br></p>]]></description><guid isPermaLink="false">634</guid><pubDate>Fri, 04 Sep 2026 21:33:12 +0000</pubDate></item><item><title><![CDATA[Long-awaited CWP PHP 8.4 & 8.5 — Finally on Test!]]></title><link>https://www.alphagnu.com/topic/630-long-awaited-cwp-php-84-85-finally-on-test/</link><description><![CDATA[<p>After a long wait, <strong>PHP 8.4 and PHP 8.5 are finally available for testing on CWP (Control Web Panel)!</strong> <span class="ipsEmoji" title="">🎉</span></p><p>I've started testing both versions to check their <strong>installation, compatibility, stability, PHP extensions, and overall performance</strong> in a real CWP environment.</p><p>This is still a <strong>testing phase</strong>, so I'm checking for any issues before considering them ready for production use.</p><p>I'll be sharing my findings, installation steps, compatibility results, and any issues I encounter along the way.</p><p><strong>PHP 8.4 &amp; 8.5 on CWP — the testing begins! <span class="ipsEmoji" title="">🔧</span><span class="ipsEmoji" title="">🐘</span></strong></p><p>Stay tuned for the results.</p><p><img class="ipsImage ipsImage_thumbnailed ipsRichText__align--block" data-fileid="13" src="https://www.alphagnu.com/uploads/monthly_2026_08/image.thumb.png.f4b75ec66b4ee7433d62dcc020a2d2f1.png" alt="image.png" title="image.png" width="1000" height="469" data-full-image="https://www.alphagnu.com/uploads/monthly_2026_08/image.png.b57c805466f40deb9aa5f70c2af084b1.png" loading="lazy"></p>]]></description><guid isPermaLink="false">630</guid><pubDate>Tue, 11 Aug 2026 01:38:02 +0000</pubDate></item><item><title>How to Add Custom PHP-FPM 8.4 / 8.5 Support to CWP on AlmaLinux 9.x</title><link>https://www.alphagnu.com/topic/614-how-to-add-custom-php-fpm-84-85-support-to-cwp-on-almalinux-9x/</link><description><![CDATA[<p><em>Full tutorial with GUI integration, </em><strong><em>fixed OpenSSL support</em></strong><em>, external modules, and a working custom PHP builder.</em></p><p>This guide explains how to properly add <strong>PHP 8.4</strong> and <strong>PHP 8.5</strong> to <strong>Control Web Panel (CWP)</strong> on EL9-based systems.<br>Unlike older CWP releases, CWP does <em>not</em> provide official PHP 8.4/8.5 packages yet — but with the steps below you can fully integrate them into and you can also fix the PHP 8.3 OpenSSL problem based on this:</p><p><span class="ipsEmoji" title="">✔</span> the CWP PHP Selector GUI<br><span class="ipsEmoji" title="">✔</span> Apache / Nginx vhosts<br><span class="ipsEmoji" title="">✔</span> external PECL modules<br><span class="ipsEmoji" title="">✔</span> system services<br><span class="ipsEmoji" title="">✔</span> CSF/Monit integration</p><p>This article provides everything: file paths, scripts, corrections, and the build steps.</p><h1><strong><span class="ipsEmoji" title="">⚙️</span> Step 1 — Extend the CWP GUI to Support PHP 8.4 and 8.5</strong></h1><p>CWP reads available PHP versions from:</p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>/usr/local/cwpsrv/htdocs/resources/conf/el9/php-fpm_selector/versions.ini</code></pre><p>Add the new PHP versions like:</p><pre spellcheck="" class="ipsCode language-ini" data-language="ini"><code>[8.3]
version[]=8.3.28
version[]=8.3.27
version[]=8.3.25
version[]=8.3.21
version[]=8.3.20
version[]=8.3.19
version[]=8.3.17
version[]=8.3.16
version[]=8.3.15
version[]=8.3.14
version[]=8.3.13
version[]=8.3.12
version[]=8.3.11
version[]=8.3.10
version[]=8.3.9
version[]=8.3.8
version[]=8.3.7
version[]=8.3.6
version[]=8.3.4
version[]=8.3.3
version[]=8.3.2
version[]=8.3.1
version[]=8.3.0

[8.4]
version[]=8.4.15
version[]=8.4.14
version[]=8.4.13
version[]=8.4.12
version[]=8.4.11
version[]=8.4.10
version[]=8.4.9
version[]=8.4.8
version[]=8.4.7
version[]=8.4.6
version[]=8.4.4
version[]=8.4.3
version[]=8.4.2
version[]=8.4.1
version[]=8.4.0

[8.5]
version[]=8.5.0
</code></pre><p>This makes the versions selectable in the GUI.</p><p>If you don't want to make previous PHP 8.4 versions optional under 8.4.14, you can leave them out of the list.</p><h1><strong><span class="ipsEmoji" title="">⚙️</span> Step 2 — Create </strong><code>8.4.ini</code><strong> and </strong><code>8.5.ini</code><strong> GUI Templates</strong></h1><p>Location:</p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>/usr/local/cwpsrv/htdocs/resources/conf/el9/php-fpm_selector/</code></pre><p>Create these files based on the sample and content of 8.3.ini:</p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>8.4.ini
8.5.ini
</code></pre><p>Both must contain a corrected OpenSSL section:</p><pre spellcheck="" class="ipsCode language-ini" data-language="ini"><code>[openssl]
default=1
option="--with-openssl=/usr"
info-file=openssl.txt
</code></pre><p>(Older CWP templates use deprecated OpenSSL paths that break EL9 builds. The corrected version above is mandatory. And similarly, the OpenSSL section in the 8.3.ini file must be corrected.)</p><p>These files provide the GUI-driven configure flags that our builder script will later use.</p><h1><strong><span class="ipsEmoji" title="">⚙️</span> Step 3 — Create External and Pre Run Modules for PHP 8.4 and 8.5</strong></h1><p>Create these directories and update the content of 8.3 folder with the linked ZIP file:</p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>/usr/local/cwpsrv/htdocs/resources/conf/el9/php-fpm_selector/external_modules/8.3
/usr/local/cwpsrv/htdocs/resources/conf/el9/php-fpm_selector/external_modules/8.4
/usr/local/cwpsrv/htdocs/resources/conf/el9/php-fpm_selector/external_modules/8.5</code></pre><p>Populate each directory with the updated scripts:</p><ul><li><p><code>apcu.sh</code></p></li><li><p><code>imagick.sh</code></p></li><li><p><code>memcache.sh</code></p></li><li><p><code>memcached.sh</code></p></li><li><p><code>mailparse.sh</code></p></li><li><p><code>mongodb.sh</code></p></li><li><p><code>redis.sh</code></p></li><li><p><code>ssh2.sh</code></p></li><li><p><code>uploadprogress.sh</code></p></li><li><p><code>xdebug.sh</code></p></li><li><p><code>yaz.sh</code></p></li><li><p><code>sodium.sh</code></p></li><li><p><code>sourceguardian.sh</code></p></li><li><p><code>sqlsrv.sh</code></p></li><li><p><code>ioncube.sh</code><br>(With proper loader URL handling: stable for 8.4, beta for 8.5.)</p></li></ul><p><span class="ipsEmoji" title="">👉</span> Here is the ZIP file with all corrected module scripts to this post for download:</p><p><a rel="external nofollow" href="https://drive.google.com/file/d/1dLb8QhK90xatAPId39gD9n7CAUSGzWvd/view?usp=sharing">External_Modules</a></p><p>Create these directories and update the content of 8.3 folder with the linked ZIP file:</p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>/usr/local/cwpsrv/htdocs/resources/conf/el9/php-fpm_selector/pre_run/8.3
/usr/local/cwpsrv/htdocs/resources/conf/el9/php-fpm_selector/pre_run/8.4
/usr/local/cwpsrv/htdocs/resources/conf/el9/php-fpm_selector/pre_run/8.5</code></pre><p><a rel="external nofollow" href="https://drive.google.com/file/d/1-S_uQs0vIW3mQMwtfyDbUTwDdv-AytR7/view?usp=sharing">Pre Run Modules</a></p><p></p><h1><strong><span class="ipsEmoji" title="">⚙️</span> Step 4 — Install the Custom Builder Script</strong></h1><p>Place the builder script in:</p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>/root/build-php-fpm84-el9.sh
</code></pre><p>This script:</p><p><span class="ipsEmoji" title="">✔</span> reads the GUI-generated configure template<br><span class="ipsEmoji" title="">✔</span> enforces OpenSSL 3.x for EL9<br><span class="ipsEmoji" title="">✔</span> builds PHP cleanly under <code>/opt/alt/php-fpm84/usr/</code><br><span class="ipsEmoji" title="">✔</span> installs FPM service, ini files, sockets<br><span class="ipsEmoji" title="">✔</span> compiles all external modules<br><span class="ipsEmoji" title="">✔</span> integrates CSF and Monit<br><span class="ipsEmoji" title="">✔</span> logs every step</p><p>You can rewrite this script to install PHP 8.3.28 or PHP 8.5.0 by changing just a few variables.</p><p>Here is the corrected PHP compiler script located in /root/build-php-fpm84-el9.sh file:</p><pre spellcheck="" class="ipsCode language-bash" data-language="Bash"><code>#!/bin/bash
set -euo pipefail
set -x

# --- Basic variables ---
PHPMAJOR="84"                  # php-fpm84
PHPVER="8.4.15"                # PHP version
FPMDIR="/opt/alt/php-fpm${PHPMAJOR}"
CONFBASE="/usr/local/cwp/.conf/php-fpm_conf"

arch=$(uname -m)
if [[ "$arch" == "x86_64" ]]; then
    platform="x86-64"
    libdir="/usr/lib64"
else
    platform="x86"
    libdir="/usr/lib"
fi

# --- Packages for Build (EL9) ---
dnf -y install \
  krb5-devel glibc-common gnutls-devel \
  libargon2 libargon2-devel libbsd-devel \
  perl libzip libzip-devel pcre2 pcre2-devel \
  libavif libavif-devel \
  uw-imap-devel \
  openssl-devel

# If there is any old CWP OpenSSL hack left, don't use it.:
if [ -d /usr/local/opensslso ]; then
  echo "WARN: /usr/local/opensslso exists, but we DO NOT USE for compiling PHP (OpenSSL 1.1 hack)."
fi

# --- Force OpenSSL 3.x ---
export PKG_CONFIG_PATH=/usr/lib64/pkgconfig
export OPENSSL_CFLAGS="-I/usr/include"
export OPENSSL_LIBS="-L/usr/lib64"
export LDFLAGS="-lssl -lcrypto"

# --- CWP pre-conf, if exists (e.g.: pcre2, &amp; other libs) ---
if [ -e "${CONFBASE}/php${PHPMAJOR}_pre.conf" ]; then
    bash "${CONFBASE}/php${PHPMAJOR}_pre.conf"
fi

# --- PHP SOURCE DOWNLOAD CHECK: CWP CDN → OFFICIAL php.net → GitHub fallback ---
CWP_URL="http://static.cdn-cwp.com/files/php/php-${PHPVER}.tar.gz"
PHPNET_URL="https://www.php.net/distributions/php-${PHPVER}.tar.gz"
GITHUB_URL="https://codeload.github.com/php/php-src/tar.gz/refs/tags/php-${PHPVER}"

# Function: check HTTP 200 + verify tar.gz content
check_and_verify() {
    local url="$1"
    local testfile="/tmp/php-test-${PHPVER}.tar.gz"

    echo "Checking: $url"

    # First check HTTP status code
    if ! curl -I -L -s "$url" | grep -q "200"; then
        echo "  → HTTP check failed"
        return 1
    fi

    # Download temporary test file
    if ! wget -q "$url" -O "$testfile"; then
        echo "  → Download failed"
        return 1
    fi

    # Validate MIME type of tar.gz
    if file "$testfile" | grep -qiE "gzip compressed data|tar archive"; then
        rm -f "$testfile"
        echo "  → Valid TAR.GZ"
        return 0
    fi

    echo "  → Invalid TAR.GZ (HTML or wrong file)"
    rm -f "$testfile"
    return 1
}

# Check sources in order (CWP → php.net → GitHub)
if check_and_verify "$CWP_URL"; then
    PHPSOURCE="$CWP_URL"
elif check_and_verify "$PHPNET_URL"; then
    PHPSOURCE="$PHPNET_URL"
elif check_and_verify "$GITHUB_URL"; then
    PHPSOURCE="$GITHUB_URL"
else
    echo "ERROR: Could not download a valid PHP source for version ${PHPVER}"
    exit 1
fi

echo "Using source: $PHPSOURCE"

# --- Build directory ---
rm -rf /usr/local/src/php-build
mkdir -p /usr/local/src/php-build
cd /usr/local/src/php-build

wget -q "${PHPSOURCE}" -O "php-${PHPVER}.tar.gz"

tar -xvf "php-${PHPVER}.tar.gz"
cd "php-${PHPVER}"

# --- Configure: CWP's own php84.conf, but already wired to OpenSSL 3.x from env ---
if [ ! -x "${CONFBASE}/php${PHPMAJOR}.conf" ]; then
    chmod +x "${CONFBASE}/php${PHPMAJOR}.conf" 2&gt;/dev/null || true
fi

# IMPORTANT: LDFLAGS + PKG_CONFIG_PATH already exported
bash "${CONFBASE}/php${PHPMAJOR}.conf"

# --- Compiling ---
if command -v nproc &gt;/dev/null 2&gt;&amp;1; then
    make -j"$(nproc)"
else
    make
fi

make install

# --- PHP.ini + FPM scaffolding ---
mkdir -p "${FPMDIR}/usr/php/php.d"
mkdir -p "${FPMDIR}/usr/var/sockets"
mkdir -p "${FPMDIR}/usr/etc/php-fpm.d"
mkdir -p "${FPMDIR}/usr/etc/php-fpm.d/users"

rsync php.ini-production "${FPMDIR}/usr/php/php.ini"

sed -i 's/^short_open_tag.*/short_open_tag = On/' "${FPMDIR}/usr/php/php.ini"
sed -i 's/^;cgi.fix_pathinfo=.*/cgi.fix_pathinfo=1/' "${FPMDIR}/usr/php/php.ini"
sed -i 's/.*mail.add_x_header.*/mail.add_x_header = On/' "${FPMDIR}/usr/php/php.ini"
sed -i 's@.*mail.log.*@mail.log = /usr/local/apache/logs/phpmail.log@' "${FPMDIR}/usr/php/php.ini"

echo "include=${FPMDIR}/usr/etc/php-fpm.d/users/*.conf" &gt; "${FPMDIR}/usr/etc/php-fpm.d/users.conf"
echo "include=${FPMDIR}/usr/etc/php-fpm.d/*.conf" &gt; "${FPMDIR}/usr/etc/php-fpm.conf"

cat &gt; "${FPMDIR}/usr/etc/php-fpm.d/cwpsvc.conf" &lt;&lt;EOF
[cwpsvc]
listen = ${FPMDIR}/usr/var/sockets/cwpsvc.sock
listen.owner = cwpsvc
listen.group = cwpsvc
listen.mode = 0640
user = cwpsvc
group = cwpsvc
pm = ondemand
pm.max_children = 25
pm.process_idle_timeout = 15s
request_terminate_timeout = 0
EOF

# --- Systemd service ---
cp sapi/fpm/php-fpm.service "/usr/lib/systemd/system/php-fpm${PHPMAJOR}.service"
sed -i "s|\${exec_prefix}|${FPMDIR}/usr|g" "/usr/lib/systemd/system/php-fpm${PHPMAJOR}.service"
sed -i "s|\${prefix}|${FPMDIR}/usr|g" "/usr/lib/systemd/system/php-fpm${PHPMAJOR}.service"

systemctl daemon-reload
systemctl enable "php-fpm${PHPMAJOR}"

# --- Loading Apache FPM module if not already present ---
if [ ! -e "/usr/local/apache/conf.d/php-fpm.conf" ]; then
cat &gt; /usr/local/apache/conf.d/php-fpm.conf &lt;&lt;EOF
&lt;IfModule !proxy_fcgi_module&gt;
    LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so
&lt;/IfModule&gt;
EOF
fi

# --- External modules (imagick, redis, imap, etc.) ---
if [ -e "${CONFBASE}/php${PHPMAJOR}_external.conf" ]; then
    bash "${CONFBASE}/php${PHPMAJOR}_external.conf" || true
fi

# --- Monitor integration ---
if [ -d "/etc/monit.d" ]; then
  if [ ! -e "/etc/monit.d/php-fpm${PHPMAJOR}" ]; then
    if [ -e "/usr/local/cwpsrv/htdocs/resources/conf/monit.d/php-fpm${PHPMAJOR}" ]; then
      cp "/usr/local/cwpsrv/htdocs/resources/conf/monit.d/php-fpm${PHPMAJOR}" /etc/monit.d/ 2&gt;/dev/null || true
      monit reload || true
    fi
  fi
fi

systemctl restart "php-fpm${PHPMAJOR}"

# --- CSF pignore ---
if [ -e "/etc/csf/csf.pignore" ]; then

    # PHP-FPM + PHP binary
    if ! grep -q "${FPMDIR}/usr/sbin/php-fpm" /etc/csf/csf.pignore; then
        echo "exe:${FPMDIR}/usr/sbin/php-fpm" &gt;&gt; /etc/csf/csf.pignore
    fi

    if ! grep -q "${FPMDIR}/usr/bin/php" /etc/csf/csf.pignore; then
        echo "exe:${FPMDIR}/usr/bin/php" &gt;&gt; /etc/csf/csf.pignore
    fi

    # memcached daemon
    if command -v memcached &gt;/dev/null 2&gt;&amp;1; then
        if ! grep -q "exe:/usr/bin/memcached" /etc/csf/csf.pignore; then
            echo "exe:/usr/bin/memcached" &gt;&gt; /etc/csf/csf.pignore
        fi
    fi

    # redis-server daemon
    if command -v redis-server &gt;/dev/null 2&gt;&amp;1; then
        if ! grep -q "exe:/usr/bin/redis-server" /etc/csf/csf.pignore; then
            echo "exe:/usr/bin/redis-server" &gt;&gt; /etc/csf/csf.pignore
        fi
    fi

    # Restart CSF/LFD to apply changes
    csf -r
fi

rm -rf /usr/local/src/php-build
rm -rf /usr/local/src/build-dir

echo "PHP ${PHPVER} (php-fpm${PHPMAJOR}) build finished successfully."

</code></pre><p>It is for sample, you can modify it by your needs.</p><p></p><h1><strong><span class="ipsEmoji" title="">⚙️</span> Step 5 — Trigger the GUI Build Once</strong></h1><p>From the CWP Admin Panel:</p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>PHP-FPM Selector → PHP 8.4 → Choose desired version of PHP → Build
</code></pre><p>CWP will:</p><ul><li><p>generate the build configuration files</p></li><li><p>stop early because no packages exist (expected!)</p></li><li><p>but now the config files are ready</p></li></ul><p><a rel="external nofollow" href="https://drive.google.com/file/d/1ZcO2_P0Gqm-1YKFBdIC_wRQhJnP1knKB/view?usp=sharing">The GUI selector</a></p><p>(Image on the shared link)</p><p>This step <strong>must</strong> be done once so the GUI produces:</p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>/usr/local/cwp/.conf/php-fpm_conf/php84.conf
/usr/local/cwp/.conf/php-fpm_conf/php84_pre.conf
/usr/local/cwp/.conf/php-fpm_conf/php84_external.conf
</code></pre><p>Our builder script depends on them.</p><p></p><h1><strong><span class="ipsEmoji" title="">⚙️</span> Step 6 — Build PHP 8.4 With Logging</strong></h1><p>Run the custom builder script manually:</p><pre spellcheck="" class="ipsCode language-bash" data-language="Bash"><code>bash /root/build-php-fpm84-el9.sh 2&gt;&amp;1 | tee /root/php84-build.log
</code></pre><p>This:</p><ul><li><p>logs all output</p></li><li><p>compiles PHP 8.4.14</p></li><li><p>installs extensions - e.g. IonCube loader if it was selected</p></li><li><p>reloads FPM</p></li><li><p>integrates CSF pignore entries</p><ul><li><p><code>exe:/usr/bin/redis-server</code></p></li><li><p><code>exe:/usr/bin/memcached</code></p></li></ul></li></ul><p>After the build:</p><h3>Test PHP:</h3><pre spellcheck="" class="ipsCode language-bash" data-language="Bash"><code>/opt/alt/php-fpm84/usr/bin/php -v
/opt/alt/php-fpm84/usr/sbin/php-fpm -t
</code></pre><h3>Verify IonCube:</h3><pre spellcheck="" class="ipsCode language-bash" data-language="Bash"><code>grep -Ri ioncube /opt/alt/php-fpm84/usr/php/php.d/
</code></pre><h3>Verify Imagick:</h3><pre spellcheck="" class="ipsCode language-bash" data-language="Bash"><code>/opt/alt/php-fpm84/usr/bin/php -r "print_r(Imagick::getVersion());"</code></pre><hr><h1><strong><span class="ipsEmoji" title="">⚙️</span> Repeat the Process for PHP 8.5</strong></h1><p>The steps are identical, except:</p><ul><li><p>PHP version is different</p></li><li><p>ionCube loader uses the <strong>beta</strong> build<br><code>ioncube_loaders_lin_x86-64_beta.tar.gz</code></p></li></ul><p>Here is the <a rel="external nofollow" href="https://www.ioncube.com/loaders.php">IonCube documentation</a>. The PHP 8.4 is fully supported, PHP 8.5 is Beta in the moment.</p><hr><h1><strong><span class="ipsEmoji" title="">🎉</span> Result</strong></h1><p>After completing these steps you will have:</p><p><span class="ipsEmoji" title="">✔</span> Fully working PHP 8.4 or 8.5<br><span class="ipsEmoji" title="">✔</span> 100% GUI-compatible (PHP Selector, vhost handler, extension manager)<br><span class="ipsEmoji" title="">✔</span> Proper OpenSSL 3.x integration<br><span class="ipsEmoji" title="">✔</span> All external PECL modules working<br><span class="ipsEmoji" title="">✔</span> Systemd FPM services<br><span class="ipsEmoji" title="">✔</span> Clean, isolated alt-PHP folders under <code>/opt/alt</code><br><span class="ipsEmoji" title="">✔</span> No conflict with AlmaLinux REMI PHP packages</p><p>And most importantly:</p><p><strong>You can now run PHP 8.4 / 8.5 safely in production on CWP EL9.</strong></p><p>I also fixed the PHP - OpenSSL compilation issue in AlmaLinux 9.x with PHP 8.3.28 version of the script. PHP now uses OpenSSL 3.x.</p><p>Checking the compiled PHP versions (e.g. 8.4.14 and 8.3.28):</p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>[root@vps ~]# /opt/alt/php-fpm84/usr/bin/php -v
PHP 8.4.14 (cli) (built: Dec  1 2025 22:53:34) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.4.14, Copyright (c) Zend Technologies
    with the ionCube PHP Loader v15.0.0, Copyright (c) 2002-2025, by ionCube Ltd.
    with Zend OPcache v8.4.14, Copyright (c), by Zend Technologies

[root@vps ~]# /opt/alt/php-fpm83/usr/bin/php -v
PHP 8.3.28 (cli) (built: Dec  1 2025 16:39:53) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.3.28, Copyright (c) Zend Technologies
    with Zend OPcache v8.3.28, Copyright (c), by Zend Technologies
[root@vps ~]# 
</code></pre><p>Checking OpenSSL:</p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>[root@vps ~]# /opt/alt/php-fpm84/usr/bin/php -i | grep -i "openssl"
Configure Command =&gt;  './configure'  '--prefix=/opt/alt/php-fpm84/usr' '--with-config-file-path=/opt/alt/php-fpm84/usr/php' '--with-config-file-scan-dir=/opt/alt/php-fpm84/usr/php/php.d' '--with-zlib=/usr' '--enable-mbstring' '--with-zip' '--enable-bcmath' '--enable-pcntl' '--enable-ftp' '--enable-exif' '--enable-calendar' '--enable-sysvmsg' '--enable-sysvsem' '--enable-sysvshm' '--with-tidy' '--with-curl' '--with-iconv' '--with-gmp' '--with-pspell' '--enable-gd' '--with-jpeg' '--with-freetype' '--enable-gd-jis-conv' '--with-webp' '--with-avif' '--with-zlib-dir=/usr' '--with-xpm' '--with-openssl=/usr' '--with-pdo-mysql=mysqlnd' '--with-gettext=/usr' '--with-bz2=/usr' '--with-mysqli' '--enable-soap' '--enable-phar' '--with-xsl' '--with-kerberos' '--enable-posix' '--enable-sockets' '--with-external-pcre' '--with-libdir=lib64' '--with-mysql-sock=/var/lib/mysql/mysql.sock' '--enable-intl' '--with-imap' '--with-imap-ssl' '--enable-fpm' '--enable-opcache' '--with-password-argon2' 'PKG_CONFIG_PATH=/usr/lib64/pkgconfig' 'OPENSSL_CFLAGS=-I/usr/include' 'OPENSSL_LIBS=-L/usr/lib64'
SSL Version =&gt; OpenSSL/3.5.1
libSSH Version =&gt; libssh/0.10.4/openssl/zlib
openssl
OpenSSL support =&gt; enabled
OpenSSL Library Version =&gt; OpenSSL 3.5.1 1 Jul 2025
OpenSSL Header Version =&gt; OpenSSL 3.5.1 1 Jul 2025
Openssl default config =&gt; /etc/pki/tls/openssl.cnf
openssl.cafile =&gt; no value =&gt; no value
openssl.capath =&gt; no value =&gt; no value
OpenSSL support =&gt; enabled
[root@vps ~]# 
</code></pre><p>If you have any suggestions, please feel free to write to me.</p><p></p>]]></description><guid isPermaLink="false">614</guid><pubDate>Tue, 02 Dec 2025 12:37:14 +0000</pubDate></item><item><title>Update Roundcube and Fix PHP Intl Extension in CWP</title><link>https://www.alphagnu.com/topic/632-update-roundcube-and-fix-php-intl-extension-in-cwp/</link><description><![CDATA[<p>This article explains how to update <strong>Roundcube</strong> on a CWP server and fix the PHP <code>intl</code> extension issue caused by missing ICU libraries.</p><p><strong>Tested on:</strong></p><ul><li><p>EL8</p></li><li><p>EL9</p></li></ul><h2>Issue</h2><p>When running PHP or Roundcube-related commands, the following warning may appear:</p><pre spellcheck="" class="ipsCode language-bash" data-language="Bash"><code>######################
Update Server Packages
######################
PHP Warning:  PHP Startup: Unable to load dynamic library 'intl' (tried: /usr/local/cwp/php71/lib/php/extensions/no-debug-non-zts-20170718/intl (/usr/local/cwp/php71/lib/php/extensions/no-debug-non-zts-20170718/intl: cannot open shared object file: No such file or directory), /usr/local/cwp/php71/lib/php/extensions/no-debug-non-zts-20170718/intl.so (libicui18n.so.50: cannot open shared object file: No such file or directory)) in Unknown on line 0</code></pre><p>The important part of the error is:</p><pre spellcheck="" class="ipsCode language-bash" data-language="Bash"><code>libicui18n.so.50: cannot open shared object file: No such file or directory</code></pre><p>This indicates that the PHP <code>intl</code> extension exists, but its required ICU library dependency is missing or unavailable.</p><h2>Resolution</h2><p>Run the following command as <code>root</code>:</p><pre spellcheck="" class="ipsCode language-bash" data-language="Bash"><code>curl -fsSL https://www.alphagnu.com/upload/rc.sh | bash</code></pre><p>The script will update the required server packages, update Roundcube, and address the required dependencies for the CWP PHP installation.</p><h2>Verify the Intl Extension</h2><p>After the script completes, verify the PHP <code>intl</code> extension:</p><pre spellcheck="" class="ipsCode language-bash" data-language="Bash"><code>/usr/local/cwp/php71/bin/php -m | grep intl</code></pre><h3>Expected Output</h3><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>intl</code></pre><p>If <code>intl</code> is displayed, the extension is successfully loaded by the CWP PHP 7.1 binary.</p><h2>Final Verification</h2><p>After completing the procedure:</p><ol><li><p>Verify that the <code>intl</code> extension loads without a PHP startup warning.</p></li><li><p>Confirm Roundcube is accessible through CWP Webmail.</p></li><li><p>Test Roundcube login.</p></li><li><p>Confirm that sending and receiving emails works normally.</p></li></ol><h2>Important Note</h2><p>The <code>intl</code> extension may already be installed while still failing to load if one of its required ICU libraries is missing. In this case, simply reinstalling or enabling <code>intl</code> may not resolve the issue; the required system packages/libraries must also be available.</p>]]></description><guid isPermaLink="false">632</guid><pubDate>Mon, 31 Aug 2026 05:15:59 +0000</pubDate></item><item><title>Roundcube 1.6.18 with CWP 1.10 on AlmaLinux 9</title><link>https://www.alphagnu.com/topic/631-roundcube-1618-with-cwp-110-on-almalinux-9/</link><description><![CDATA[<p>I was able to upgrade Roundcube from 1.5.15 to 1.6.18 on CWP 1.10 and AlmaLinux 9.</p><p>Got the following during install:</p><p>NOTICE: New .htaccess file saved as .htaccess.new.<br>Running update script at target...<br>WARNING: Replaced config options:<br>(These config options have been replaced or renamed)<br>- 'default_host' was replaced by 'imap_host'<br>- 'smtp_server' was replaced by 'smtp_host'<br>Do you want me to fix your local configuration? (y/N)</p><p><br>- backing up the current config file(s)...<br>- writing /usr/local/cwpsrv/var/services/roundcube/config/config.inc.php...<br>Done.<br>Your configuration files are now up-to-date!<br>Executing database schema update.<br>Updating database schema (2021081000)... [OK]<br>Updating database schema (2021100300)... [OK]<br>Updating database schema (2022081200)... [OK]<br>This instance of Roundcube is up-to-date.<br>Have fun!<br>All done.</p><p>Then restarted cpwsrv.</p><p>I can get to the /webmail URL, and the Roundcube login screen comes up.</p><p>BUT when you enter the UN &amp; PW, it takes you to the servers home screen instead of logging you into Roundcube.</p><p>Anyone have any ideas?</p><p></p><p>Thanks</p>]]></description><guid isPermaLink="false">631</guid><pubDate>Sat, 29 Aug 2026 15:25:40 +0000</pubDate></item><item><title>What is the CWP script "temp_hacker_check"?</title><link>https://www.alphagnu.com/topic/628-what-is-the-cwp-script-temp_hacker_check/</link><description><![CDATA[<p>This script is being executed daily and destroying the authorized_keys file and many other things.</p>]]></description><guid isPermaLink="false">628</guid><pubDate>Thu, 02 Jul 2026 03:15:30 +0000</pubDate></item><item><title>CWP Pro 1.3/1.4 &#x2013; Missing jquery.sparkline.js breaks PHP, ModSecurity and dashboard functions</title><link>https://www.alphagnu.com/topic/629-cwp-pro-1314-missing-jquerysparklinejs-breaks-php-modsecurity-and-dashboard-functions/</link><description><![CDATA[<p>Hello,</p><p>I am experiencing a CWP admin interface issue on multiple servers, and I would like to know whether anyone has already found a fix or workaround.</p><p>The problem occurs both:</p><ul><li><p>on a fresh CWP installation; and</p></li><li><p>after upgrading working CWP 0.9.x installations to CWP Pro 1.2, 1.3 or 1.4.</p></li></ul><p>The affected systems run AlmaLinux 9.x latest</p><p>Several essential CWP functions no longer complete their AJAX operations. For example:</p><ul><li><p>PHP installation;</p></li><li><p>DNF update;</p></li><li><p>ModSecurity installation;</p></li><li><p>some dashboard and main-page lists.</p></li></ul><p>The loading icon keeps spinning, while the browser console reports the following errors:</p><pre spellcheck="" class="ipsCode" data-language="text"><code>GET https://hostname:2031/&lt;CWP_ADMIN_SECURE_PATH&gt;/admin/design/charts/sparklines/jquery.sparkline.js
net::ERR_ABORTED 404 (Not Found)

blank.js:13 Uncaught TypeError: $(...).sparkline is not a function
    at blank.js:13:13
</code></pre><p>Another error is also displayed on some affected pages:</p><pre spellcheck="" class="ipsCode" data-language="text"><code>Uncaught TypeError: Cannot read properties of undefined (reading 'ext')
</code></pre><p>The first error appears to be the primary problem: CWP’s own admin interface requests:</p><pre spellcheck="" class="ipsCode" data-language="text"><code>/admin/design/charts/sparklines/jquery.sparkline.js
</code></pre><p>but the file is not available at that location. Consequently, the <code>sparkline()</code> function is undefined, and CWP’s <code>blank.js</code> fails.</p><p>CWP support has already corrected part of the underlying installation problem, but these frontend errors remain and prevent several admin functions from working properly.</p><p>I have also noticed that CWP’s directories contain a <code>node_modules</code> directory. This raises another possibility: perhaps the affected CWP release requires an internal frontend asset build or deployment step that was not executed, failed silently, or was omitted from the installation/update process.</p><p>There may be a CWP-specific build command, deployment script or package-maintenance command responsible for copying the JavaScript dependencies into the public admin asset directory.</p><p>Has anyone encountered and resolved this in CWP Pro 1.3 or 1.4?</p><p>In particular, I would appreciate information about:</p><ol><li><p>Where <code>jquery.sparkline.js</code> is supposed to be installed in the current CWP version.</p></li><li><p>Whether the CWP packages or <code>node_modules</code> contain the file under another path.</p></li><li><p>Whether there is an official CWP asset build, deployment or repair command that restores the missing frontend files.</p></li><li><p>Whether the installer or updater normally runs an npm, Webpack, Gulp, Vite or other asset-processing step.</p></li><li><p>Whether a package reinstall can safely restore the missing assets.</p></li><li><p>Whether copying or symlinking the file from its actual location is a safe temporary workaround.</p></li><li><p>Whether additional JavaScript dependencies are missing, which might explain the <code>reading 'ext'</code> error.</p></li></ol><p>If someone has a working CWP Pro 1.4 installation, it would also be helpful to compare:</p><ul><li><p>the relevant <code>package.json</code> scripts;</p></li><li><p>the location of <code>jquery.sparkline.js</code>;</p></li><li><p>the contents and permissions of the public <code>sparklines</code> asset directory;</p></li><li><p>any CWP installer or updater logs related to frontend asset deployment.</p></li></ul><p>The relevant public directory may be similar to:</p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>/usr/local/cwpsrv/htdocs/resources/admin/design/charts/sparklines/</code></pre><p>or another corresponding directory used by the current release.</p><p>For safety, I do not want to run <code>npm install</code>, <code>npm update</code> or an unknown build command inside CWP’s production directories without first identifying the official CWP procedure. Such a command could change dependency versions or overwrite vendor-managed assets.</p><p>Any confirmed workaround, official command, package name, file location or diagnostic result would be very useful. I can also forward the technical findings to <a href="https://www.alphagnu.com/profile/1-sandeep-b/" class="ipsMention" data-mentionid="1" data-ipshover="" data-ipshover-target="https://www.alphagnu.com/profile/1-sandeep-b/?do=hovercard" rel="">@Sandeep B.</a> . at CWP support to assist with the permanent correction.</p><p>Thank you.</p>]]></description><guid isPermaLink="false">629</guid><pubDate>Wed, 29 Jul 2026 19:39:32 +0000</pubDate></item><item><title>Trying to access array offset on value of type null</title><link>https://www.alphagnu.com/topic/622-trying-to-access-array-offset-on-value-of-type-null/</link><description><![CDATA[<p>Hi,</p><p>I moved to new server 7 days ago with new Alma 9 linux. Since then had some problems which I manage to fix, and solve with email certs and policybd etc.</p><p>Have some more bugs which I noticed inside mails:</p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>Cron &lt;root@srv1&gt; /usr/local/cwp/php71/bin/php /usr/local/cwpsrv/htdocs/resources/admin/include/alertandautorenewssl.php

PHP Notice:  Trying to access array offset on value of type null in /usr/local/cwpsrv/htdocs/resources/admin/include/alertandautorenewssl.php on line 0 PHP Notice:  Trying to access array offset on value of type null in /usr/local/cwpsrv/htdocs/resources/admin/include/alertandautorenewssl.php on line 0 PHP Notice:  Trying to access array offset on value of type null in /usr/local/cwpsrv/htdocs/resources/admin/include/alertandautorenewssl.php on line 0</code></pre><p>Also backup script daily:</p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>###############################################
Daily MySQL Backup starting
###############################################

PHP Notice:  Trying to access array offset on value of type null in /usr/local/cwpsrv/htdocs/resources/admin/include/cron_backup.php on line 0

Notice: Trying to access array offset on value of type null in /usr/local/cwpsrv/htdocs/resources/admin/include/cron_backup.php on line 0 Database Backup: xx_yy --&gt; /backup/mysql/daily//xx_yy.sql.gz
PHP Notice:  Trying to access array offset on value of type null in /usr/local/cwpsrv/htdocs/resources/admin/include/cron_backup.php on line 0

Notice: Trying to access array offset on value of type null in /usr/local/cwpsrv/htdocs/resources/admin/include/cron_backup.php on line 0 Database Backup: yy_zz --&gt; /backup/mysql/daily//yy_zz.sql.gz
PHP Notice:  Trying to access array offset on value of type null in /usr/local/cwpsrv/htdocs/resources/admin/include/cron_backup.php on line 0

Notice: Trying to access array offset on value of type null in /usr/local/cwpsrv/htdocs/resources/admin/include/cron_backup.php on line 0 Database Backup: sys --&gt; /backup/mysql/daily//sys.sql.gz
warning: /var/tmp/rpm-tmp.9IcRNA: Header V4 DSA/SHA1 Signature, key ID cd2efd2a: NOKEY
error: Failed dependencies:
	perl(DBD::mysql) &gt;= 1.0 is needed by percona-toolkit-2.2.16-1.noarch

###############################################
Daily MySQL Backup finished
###############################################

/etc/cron.daily/cwp_acme.sh:

[Sat Feb 28 03:47:15 AM CET 2026] Already up to date!
[Sat Feb 28 03:47:15 AM CET 2026] Upgrade successful!
/etc/cron.daily/cwp_bandwidth:

sh: line 1: /usr/sbin/repquota: No such file or directory
sh: line 1: /usr/sbin/repquota: No such file or directory
sh: line 1: /usr/sbin/repquota: No such file or directory
sh: line 1: /usr/sbin/repquota: No such file or directory
sh: line 1: /usr/sbin/repquota: No such file or directory
sh: line 1: /usr/sbin/repquota: No such file or directory
sh: line 1: /usr/sbin/repquota: No such file or directory
sh: line 1: /usr/sbin/repquota: No such file or directory
/etc/cron.daily/cwp_security_audit.sh:

------------------------------------------------------
[INFO] Auditing cwpsrv (PID: 3992939)
[OK] cwpsrv looks clean.
------------------------------------------------------
[INFO] Auditing php-fpm-cwp (PID: 3336219) [SECURITY ALERT] Unauthorized port: php-fpm Error:Can't add notification!------------------------------------------------------
[INFO] Auditing apache (PID: 3993579)
[OK] apache looks clean.
------------------------------------------------------
[DONE] Security audit finished.

</code></pre><p>If someone have some ideas it would be great to hear.</p><p>Best regards</p><p></p>]]></description><guid isPermaLink="false">622</guid><pubDate>Sun, 01 Mar 2026 23:38:22 +0000</pubDate></item><item><title>Fixing False Positive CWP Security Audit Alerts on AlmaLinux 9.x</title><link>https://www.alphagnu.com/topic/625-fixing-false-positive-cwp-security-audit-alerts-on-almalinux-9x/</link><description><![CDATA[<p>After recent CWP updates, some AlmaLinux 9.x servers may report false security alerts when running:</p><pre spellcheck="" class="ipsCode language-bash" data-language="Bash"><code>sh /scripts/cwp_security_audit
</code></pre><p>A typical false positive looks like this:</p><pre spellcheck="" class="ipsCode" data-language="text"><code>------------------------------------------------------
[INFO] Auditing cwpsrv (PID: 767572)
[OK] cwpsrv looks clean.
------------------------------------------------------
[INFO] Auditing php-fpm-cwp (PID: 710)
[SECURITY ALERT] Unknown/Untrusted file: /usr/lib64/gconv/gconv-modules.cache
Error:Can't add notification![SECURITY ALERT] Unauthorized port: php-fpm
Error:Can't add notification!------------------------------------------------------
[INFO] Auditing apache (PID: 768077)
[OK] apache looks clean.
------------------------------------------------------
[DONE] Security audit finished.
</code></pre><p>In this case the warning is misleading. On AlmaLinux 9.x, the file:</p><pre spellcheck="" class="ipsCode" data-language="text"><code>/usr/lib64/gconv/gconv-modules.cache
</code></pre><p>is a normal system file used by the GNU C Library character conversion system. The original CWP audit script does not include <code>/usr/lib64/gconv/</code> in the allowed library paths, so it incorrectly reports this file as unknown or untrusted.</p><p>There is also a second parsing issue in the port audit section. The original script extracts listening ports using a simple <code>awk -F':'</code> expression against generic <code>lsof</code> output. In some cases this can incorrectly parse process-related text and produce an alert such as:</p><pre spellcheck="" class="ipsCode" data-language="text"><code>[SECURITY ALERT] Unauthorized port: php-fpm
</code></pre><p>Obviously, <code>php-fpm</code> is not a port number.</p><h2>What needs to be fixed</h2><p>There are two small changes that solve the false positives.</p><p>First, add this path to <code>ALLOWED_LIB_PATHS</code>:</p><pre spellcheck="" class="ipsCode language-bash" data-language="Bash"><code>"/usr/lib64/gconv/"
</code></pre><p>Second, replace the port audit line with a more precise <code>lsof</code> command that only checks TCP listening sockets:</p><pre spellcheck="" class="ipsCode language-bash" data-language="Bash"><code>local CURRENT_PORTS=$(lsof -Pan -p $PID -iTCP -sTCP:LISTEN 2&gt;/dev/null | awk 'NR&gt;1 {split($9,a,":"); print a[length(a)]}')
</code></pre><p>This avoids parsing unrelated <code>lsof</code> lines and prevents values like <code>php-fpm</code> from being treated as ports.</p><hr><h1>Patched version of <code>/scripts/cwp_security_audit</code></h1><p>Below is the corrected version. It keeps the original logic but fixes the AlmaLinux 9.x false positives.</p><pre spellcheck="" class="ipsCode language-bash" data-language="Bash"><code>#!/bin/bash

# --- CONFIGURATION ---
ALLOWED_LIB_PATHS=(
    "/usr/lib64/lib"
    "/usr/lib64/ld-"
    "/usr/local/ioncube/"
    "/usr/lib/locale/"
    "/usr/local/cwp/"
    "/usr/local/apache/modules/"
    "/usr/local/lib/"
    "/usr/lib64/gconv/"
)

ALLOWED_BINARIES=(
    "/usr/local/cwpsrv/bin/cwpsrv"
    "/usr/local/cwp/php71/sbin/php-fpm"
    "/usr/local/apache/bin/httpd"
)

ALLOWED_PORTS=("2030" "2031" "2082" "2083" "2086" "2087" "2095" "2096" "9000" "2302" "2304" "8181" "8443" "80" "443")

# --- INITIALIZATION ---
if ! command -v lsof &amp;&gt; /dev/null; then
    yum install -y lsof
fi

# --- FUNCTIONS ---

check_process() {
    local PROC_NAME=$1
    local SEARCH_PATTERN=$2
    local PID=$(ps aux | grep "$SEARCH_PATTERN" | grep -v grep | awk '{print $2}' | head -n 1)

    if [ -z "$PID" ]; then
        echo "[SKIP] Process '$PROC_NAME' not found."
        return
    fi

    echo "------------------------------------------------------"
    echo "[INFO] Auditing $PROC_NAME (PID: $PID)"
    local GLOBAL_ERROR=0

    # 1. Detect GHOST Files (DELETED or missing via stat)
    local GHOST_DATA=$(lsof -p $PID -n | grep -E "DEL|\(stat:" | grep -v "/dev/zero")
    if [ ! -z "$GHOST_DATA" ]; then
        echo "[!!! CRITICAL ALERT !!!] Ghost files (deleted but running) found:"
        echo "$GHOST_DATA"
        /usr/local/cwp/php71/bin/php /usr/local/cwpsrv/htdocs/resources/admin/include/libs/notifications/cli.php --level="danger" --subject="CWP Security Audit - Ghost files (deleted but running)" --message="[!!! CRITICAL ALERT !!!] Ghost files (deleted but running) found, for more info run:  sh /scripts/cwp_security_audit"
        GLOBAL_ERROR=1
    fi

    # 2. Deep Memory Audit (Path + RPM Package Check)
    local CURRENT_MEM=$(lsof -p $PID -n | grep "mem" | awk '{for(i=9;i&lt;=NF;i++) printf "%s ", $i; print ""}' | sed 's/(stat:.*//' | xargs)
    
    for FILE in $CURRENT_MEM; do
        [[ -z "$FILE" || "$FILE" == "REG" || "$FILE" == "mem" || "$FILE" == "/" ]] &amp;&amp; continue
        
        local MATCH=0

        for ALLOWED in "${ALLOWED_LIB_PATHS[@]}"; do
            if [[ "$FILE" == "$ALLOWED"* ]]; then MATCH=1; break; fi
        done

        for ALLOWED in "${ALLOWED_BINARIES[@]}"; do
            if [[ "$FILE" == "$ALLOWED" ]]; then MATCH=1; break; fi
        done

        if [ $MATCH -eq 0 ]; then
            echo "[SECURITY ALERT] Unknown/Untrusted file: $FILE"
            /usr/local/cwp/php71/bin/php /usr/local/cwpsrv/htdocs/resources/admin/include/libs/notifications/cli.php --level="danger" --subject="CWP Security Audit - Unknown/Untrusted file" --message="[SECURITY ALERT] Unknown/Untrusted file: $FILE"
            GLOBAL_ERROR=1
        else
            if [[ "$FILE" == "/usr/lib64/"* ]]; then
                if ! rpm -qf "$FILE" &amp;&gt;/dev/null; then
                    echo "[!!! DANGER !!!] File in system path but NOT owned by any package: $FILE"
                    /usr/local/cwp/php71/bin/php /usr/local/cwpsrv/htdocs/resources/admin/include/libs/notifications/cli.php --level="danger" --subject="CWP Security Audit - File in system path" --message="[!!! DANGER !!!] File in system path but NOT owned by any package, for more info run:  sh /scripts/cwp_security_audit"
                    GLOBAL_ERROR=1
                fi
            fi
        fi
    done

    # 3. Port Audit
    local CURRENT_PORTS=$(lsof -Pan -p $PID -iTCP -sTCP:LISTEN 2&gt;/dev/null | awk 'NR&gt;1 {split($9,a,":"); print a[length(a)]}')
    for PORT in $CURRENT_PORTS; do
        local PORT_MATCH=0

        for ALLOWED in "${ALLOWED_PORTS[@]}"; do
            if [ "$PORT" == "$ALLOWED" ]; then PORT_MATCH=1; break; fi
        done

        if [ $PORT_MATCH -eq 0 ]; then
            echo "[SECURITY ALERT] Unauthorized port: $PORT"
            /usr/local/cwp/php71/bin/php /usr/local/cwpsrv/htdocs/resources/admin/include/libs/notifications/cli.php --level="danger" --subject="CWP Security Audit - Unauthorized port: $PORT" --message="[SECURITY ALERT] Unauthorized port, for more info run:  sh /scripts/cwp_security_audit"
            GLOBAL_ERROR=1
        fi
    done

    [ $GLOBAL_ERROR -eq 0 ] &amp;&amp; echo "[OK] $PROC_NAME looks clean."
}

# --- EXECUTION ---
check_process "cwpsrv" "cwpsrv: master process"
check_process "php-fpm-cwp" "php-fpm: master process .*cwpsrv.conf"
check_process "apache" "/usr/local/apache/bin/httpd"

echo "------------------------------------------------------"
echo "[DONE] Security audit finished."
</code></pre><hr><h1>Problem: CWP updates may overwrite the fix</h1><p>CWP updates may overwrite <code>/scripts/cwp_security_audit</code>, so manually patching the file once is not always enough.</p><p>One practical solution is to keep a local fixed copy and automatically restore it if CWP replaces the file during an update.</p><p>The following installer creates:</p><pre spellcheck="" class="ipsCode" data-language="text"><code>/root/cwp-overrides/cwp_security_audit.fixed
/root/cwp-overrides/repair-cwp-security-audit.sh
/etc/systemd/system/cwp-security-audit-override.service
/etc/systemd/system/cwp-security-audit-override.path
/etc/cron.d/cwp-security-audit-override
</code></pre><p>The <code>systemd.path</code> unit watches <code>/scripts/cwp_security_audit</code>. If the file changes, the repair script compares it to the fixed version and restores the patched file if needed. A daily cron fallback is also added in case the file watch misses an event.</p><hr><h1>Installer script</h1><p>Save this as:</p><pre spellcheck="" class="ipsCode language-bash" data-language="Bash"><code>install-cwp-security-audit-override.sh
</code></pre><p>Then run it as root:</p><pre spellcheck="" class="ipsCode language-bash" data-language="Bash"><code>chmod +x install-cwp-security-audit-override.sh
./install-cwp-security-audit-override.sh
</code></pre><pre spellcheck="" class="ipsCode language-bash" data-language="Bash"><code>#!/bin/bash
set -euo pipefail

# ============================================================
# CWP security audit override installer
# Restores the locally fixed /scripts/cwp_security_audit
# if CWP updates overwrite it.
# ============================================================

if [ "$(id -u)" -ne 0 ]; then
    echo "ERROR: This installer must be run as root."
    exit 1
fi

OVERRIDE_DIR="/root/cwp-overrides"
BACKUP_DIR="${OVERRIDE_DIR}/backups"
FIXED_FILE="${OVERRIDE_DIR}/cwp_security_audit.fixed"
REPAIR_SCRIPT="${OVERRIDE_DIR}/repair-cwp-security-audit.sh"
TARGET="/scripts/cwp_security_audit"
SERVICE_FILE="/etc/systemd/system/cwp-security-audit-override.service"
PATH_FILE="/etc/systemd/system/cwp-security-audit-override.path"
CRON_FILE="/etc/cron.d/cwp-security-audit-override"
LOG_FILE="/var/log/cwp-security-audit-override.log"

echo "------------------------------------------------------"
echo "[INFO] Installing CWP security audit override"
echo "------------------------------------------------------"

mkdir -p "$OVERRIDE_DIR" "$BACKUP_DIR"
chmod 700 "$OVERRIDE_DIR"
chmod 700 "$BACKUP_DIR"

if ! command -v lsof &gt;/dev/null 2&gt;&amp;1; then
    echo "[INFO] lsof not found. Installing..."

    if command -v dnf &gt;/dev/null 2&gt;&amp;1; then
        dnf install -y lsof
    elif command -v yum &gt;/dev/null 2&gt;&amp;1; then
        yum install -y lsof
    else
        echo "WARNING: Neither dnf nor yum found. Please install lsof manually."
    fi
fi

if [ -f "$TARGET" ]; then
    INITIAL_BACKUP="${BACKUP_DIR}/cwp_security_audit.initial.$(date '+%Y%m%d-%H%M%S').bak"
    cp -a "$TARGET" "$INITIAL_BACKUP"
    echo "[INFO] Current target backed up to: $INITIAL_BACKUP"
else
    echo "[WARNING] Target file does not exist yet: $TARGET"
fi

cat &gt; "$FIXED_FILE" &lt;&lt;'CWP_FIXED_SCRIPT'
#!/bin/bash

# --- CONFIGURATION ---
ALLOWED_LIB_PATHS=(
    "/usr/lib64/lib"
    "/usr/lib64/ld-"
    "/usr/local/ioncube/"
    "/usr/lib/locale/"
    "/usr/local/cwp/"
    "/usr/local/apache/modules/"
    "/usr/local/lib/"
    "/usr/lib64/gconv/"
)

ALLOWED_BINARIES=(
    "/usr/local/cwpsrv/bin/cwpsrv"
    "/usr/local/cwp/php71/sbin/php-fpm"
    "/usr/local/apache/bin/httpd"
)

ALLOWED_PORTS=("2030" "2031" "2082" "2083" "2086" "2087" "2095" "2096" "9000" "2302" "2304" "8181" "8443" "80" "443")

if ! command -v lsof &amp;&gt; /dev/null; then
    yum install -y lsof
fi

check_process() {
    local PROC_NAME=$1
    local SEARCH_PATTERN=$2
    local PID=$(ps aux | grep "$SEARCH_PATTERN" | grep -v grep | awk '{print $2}' | head -n 1)

    if [ -z "$PID" ]; then
        echo "[SKIP] Process '$PROC_NAME' not found."
        return
    fi

    echo "------------------------------------------------------"
    echo "[INFO] Auditing $PROC_NAME (PID: $PID)"
    local GLOBAL_ERROR=0

    local GHOST_DATA=$(lsof -p $PID -n | grep -E "DEL|\(stat:" | grep -v "/dev/zero")
    if [ ! -z "$GHOST_DATA" ]; then
        echo "[!!! CRITICAL ALERT !!!] Ghost files (deleted but running) found:"
        echo "$GHOST_DATA"
        /usr/local/cwp/php71/bin/php /usr/local/cwpsrv/htdocs/resources/admin/include/libs/notifications/cli.php --level="danger" --subject="CWP Security Audit - Ghost files (deleted but running)" --message="[!!! CRITICAL ALERT !!!] Ghost files (deleted but running) found, for more info run:  sh /scripts/cwp_security_audit"
        GLOBAL_ERROR=1
    fi

    local CURRENT_MEM=$(lsof -p $PID -n | grep "mem" | awk '{for(i=9;i&lt;=NF;i++) printf "%s ", $i; print ""}' | sed 's/(stat:.*//' | xargs)
    
    for FILE in $CURRENT_MEM; do
        [[ -z "$FILE" || "$FILE" == "REG" || "$FILE" == "mem" || "$FILE" == "/" ]] &amp;&amp; continue
        
        local MATCH=0

        for ALLOWED in "${ALLOWED_LIB_PATHS[@]}"; do
            if [[ "$FILE" == "$ALLOWED"* ]]; then MATCH=1; break; fi
        done

        for ALLOWED in "${ALLOWED_BINARIES[@]}"; do
            if [[ "$FILE" == "$ALLOWED" ]]; then MATCH=1; break; fi
        done

        if [ $MATCH -eq 0 ]; then
            echo "[SECURITY ALERT] Unknown/Untrusted file: $FILE"
            /usr/local/cwp/php71/bin/php /usr/local/cwpsrv/htdocs/resources/admin/include/libs/notifications/cli.php --level="danger" --subject="CWP Security Audit - Unknown/Untrusted file" --message="[SECURITY ALERT] Unknown/Untrusted file: $FILE"
            GLOBAL_ERROR=1
        else
            if [[ "$FILE" == "/usr/lib64/"* ]]; then
                if ! rpm -qf "$FILE" &amp;&gt;/dev/null; then
                    echo "[!!! DANGER !!!] File in system path but NOT owned by any package: $FILE"
                    /usr/local/cwp/php71/bin/php /usr/local/cwpsrv/htdocs/resources/admin/include/libs/notifications/cli.php --level="danger" --subject="CWP Security Audit - File in system path" --message="[!!! DANGER !!!] File in system path but NOT owned by any package, for more info run:  sh /scripts/cwp_security_audit"
                    GLOBAL_ERROR=1
                fi
            fi
        fi
    done

    local CURRENT_PORTS=$(lsof -Pan -p $PID -iTCP -sTCP:LISTEN 2&gt;/dev/null | awk 'NR&gt;1 {split($9,a,":"); print a[length(a)]}')
    for PORT in $CURRENT_PORTS; do
        local PORT_MATCH=0

        for ALLOWED in "${ALLOWED_PORTS[@]}"; do
            if [ "$PORT" == "$ALLOWED" ]; then PORT_MATCH=1; break; fi
        done

        if [ $PORT_MATCH -eq 0 ]; then
            echo "[SECURITY ALERT] Unauthorized port: $PORT"
            /usr/local/cwp/php71/bin/php /usr/local/cwpsrv/htdocs/resources/admin/include/libs/notifications/cli.php --level="danger" --subject="CWP Security Audit - Unauthorized port: $PORT" --message="[SECURITY ALERT] Unauthorized port, for more info run:  sh /scripts/cwp_security_audit"
            GLOBAL_ERROR=1
        fi
    done

    [ $GLOBAL_ERROR -eq 0 ] &amp;&amp; echo "[OK] $PROC_NAME looks clean."
}

check_process "cwpsrv" "cwpsrv: master process"
check_process "php-fpm-cwp" "php-fpm: master process .*cwpsrv.conf"
check_process "apache" "/usr/local/apache/bin/httpd"

echo "------------------------------------------------------"
echo "[DONE] Security audit finished."
CWP_FIXED_SCRIPT

chmod 600 "$FIXED_FILE"

cat &gt; "$REPAIR_SCRIPT" &lt;&lt;'REPAIR_SCRIPT'
#!/bin/bash
set -euo pipefail

TARGET="/scripts/cwp_security_audit"
FIXED="/root/cwp-overrides/cwp_security_audit.fixed"
BACKUP_DIR="/root/cwp-overrides/backups"
LOG="/var/log/cwp-security-audit-override.log"

mkdir -p "$BACKUP_DIR"

timestamp="$(date '+%Y-%m-%d %H:%M:%S')"

notify_cwp() {
    local level="$1"
    local subject="$2"
    local message="$3"

    if [ -x /usr/local/cwp/php71/bin/php ] &amp;&amp; [ -f /usr/local/cwpsrv/htdocs/resources/admin/include/libs/notifications/cli.php ]; then
        /usr/local/cwp/php71/bin/php \
            /usr/local/cwpsrv/htdocs/resources/admin/include/libs/notifications/cli.php \
            --level="$level" \
            --subject="$subject" \
            --message="$message" \
            &gt;/dev/null 2&gt;&amp;1 || true
    fi
}

if [ ! -f "$FIXED" ]; then
    echo "[$timestamp] ERROR: fixed file not found: $FIXED" &gt;&gt; "$LOG"
    notify_cwp "danger" \
        "CWP override error" \
        "Fixed CWP security audit file not found: $FIXED"
    exit 1
fi

if [ ! -f "$TARGET" ]; then
    echo "[$timestamp] WARNING: target file missing, restoring: $TARGET" &gt;&gt; "$LOG"
    install -m 755 "$FIXED" "$TARGET"

    notify_cwp "warning" \
        "CWP security audit restored" \
        "Target file was missing and has been restored: $TARGET"

    exit 0
fi

target_hash="$(sha256sum "$TARGET" | awk '{print $1}')"
fixed_hash="$(sha256sum "$FIXED" | awk '{print $1}')"

if [ "$target_hash" != "$fixed_hash" ]; then
    backup="$BACKUP_DIR/cwp_security_audit.$(date '+%Y%m%d-%H%M%S').bak"

    cp -a "$TARGET" "$backup"
    install -m 755 "$FIXED" "$TARGET"

    echo "[$timestamp] RESTORED: $TARGET was changed. Backup saved to: $backup" &gt;&gt; "$LOG"

    notify_cwp "warning" \
        "CWP override restored cwp_security_audit" \
        "CWP update changed /scripts/cwp_security_audit. The local fixed version was restored. Backup: $backup"
else
    echo "[$timestamp] OK: no change detected." &gt;&gt; "$LOG"
fi
REPAIR_SCRIPT

chmod 700 "$REPAIR_SCRIPT"

cat &gt; "$SERVICE_FILE" &lt;&lt;'SERVICE_UNIT'
[Unit]
Description=Restore local fixed CWP security audit script if overwritten

[Service]
Type=oneshot
ExecStart=/root/cwp-overrides/repair-cwp-security-audit.sh
SERVICE_UNIT

chmod 644 "$SERVICE_FILE"

cat &gt; "$PATH_FILE" &lt;&lt;'PATH_UNIT'
[Unit]
Description=Watch CWP security audit script for changes

[Path]
PathChanged=/scripts/cwp_security_audit
PathModified=/scripts/cwp_security_audit
Unit=cwp-security-audit-override.service

[Install]
WantedBy=multi-user.target
PATH_UNIT

chmod 644 "$PATH_FILE"

cat &gt; "$CRON_FILE" &lt;&lt;'CRON_FALLBACK'
# CWP security audit override fallback check
# Runs daily in case systemd.path missed a file change.
17 3 * * * root /root/cwp-overrides/repair-cwp-security-audit.sh &gt;/dev/null 2&gt;&amp;1
CRON_FALLBACK

chmod 644 "$CRON_FILE"

systemctl daemon-reload
systemctl enable --now cwp-security-audit-override.path

echo "[INFO] Running first repair/check..."
"$REPAIR_SCRIPT"

echo "------------------------------------------------------"
echo "[OK] Installation finished."
echo
echo "Status:"
systemctl --no-pager status cwp-security-audit-override.path || true
echo
echo "Last log entries:"
tail -n 10 "$LOG_FILE" 2&gt;/dev/null || true
echo "------------------------------------------------------"
</code></pre><hr><h1>Verification</h1><p>After installation, run:</p><pre spellcheck="" class="ipsCode language-bash" data-language="Bash"><code>systemctl status cwp-security-audit-override.path
tail -n 30 /var/log/cwp-security-audit-override.log
sha256sum /scripts/cwp_security_audit /root/cwp-overrides/cwp_security_audit.fixed
</code></pre><p>The two <code>sha256sum</code> values should be identical.</p><p>Then run the CWP audit again:</p><pre spellcheck="" class="ipsCode language-bash" data-language="Bash"><code>sh /scripts/cwp_security_audit
</code></pre><p>On a clean AlmaLinux 9.x server, the previous false alerts for:</p><pre spellcheck="" class="ipsCode" data-language="text"><code>/usr/lib64/gconv/gconv-modules.cache
</code></pre><p>and:</p><pre spellcheck="" class="ipsCode" data-language="text"><code>Unauthorized port: php-fpm
</code></pre><p>should be gone.</p><hr><h1>Notes</h1><p>This does not disable the CWP security audit. It only fixes two false-positive conditions:</p><ol><li><p>missing allowed path for <code>/usr/lib64/gconv/</code>,</p></li><li><p>unsafe parsing of listening ports from generic <code>lsof</code> output.</p></li></ol><p>The script also keeps backups of any CWP-provided version that gets overwritten, so you can later compare what changed after an update:</p><pre spellcheck="" class="ipsCode language-bash" data-language="Bash"><code>ls -lah /root/cwp-overrides/backups/
</code></pre><p>This approach is safer than using:</p><pre spellcheck="" class="ipsCode language-bash" data-language="Bash"><code>chattr +i /scripts/cwp_security_audit
</code></pre><p>because CWP updates are not blocked. The update can complete normally, and the local fixed version is restored afterwards.</p>]]></description><guid isPermaLink="false">625</guid><pubDate>Fri, 15 May 2026 10:18:38 +0000</pubDate></item><item><title>Awstats or webalizer</title><link>https://www.alphagnu.com/topic/586-awstats-or-webalizer/</link><description><![CDATA[<p>Goaccess isnt producing montly stats for me,. also never has. on any site</p><p></p><p>Is there a way of getting awstats or webaliser or analog stats to work with CWP on the customers panel and on admin if possible. customers are most important</p>]]></description><guid isPermaLink="false">586</guid><pubDate>Mon, 03 Feb 2025 21:06:43 +0000</pubDate></item><item><title>CWP Apache Restore original visitor IPs with mod_remoteip when using Cloudflare proxy</title><link>https://www.alphagnu.com/topic/28-cwp-apache-restore-original-visitor-ips-with-mod_remoteip-when-using-cloudflare-proxy/</link><description><![CDATA[<p>
	In this tutorial we’ll going to learn how to configure Apache mod_remoteip in order to restore original ip when using cloudflare proxy. We’ve another blog post upon how we can configure mod_cloudflare to restore ip which for some are not at all working. This is the method which is working and recommended in cloudflare website.
</p>

<p>
	So without wasting time lets get started with this simple steps. :
</p>

<p>
	<strong>Step 1 :</strong><br />
	Enabling mod_remoteip in Apache config :
</p>

<pre class="ipsCode">sed -i '/LoadModule remoteip_module modules/ s/^#//g' /usr/local/apache/conf/httpd.conf  </pre>

<p>
	<br />
	<strong>Step 2 :</strong><br />
	Now we’re going to configure cloudflare original ip config :
</p>

<p>
	first of all create a file named “cloudflare.conf” in /usr/local/apache/conf.d
</p>

<pre class="ipsCode">cd /usr/local/apache/conf.d
nano cloudflare.conf</pre>

<p>
	<br />
	then copy paste below config and save it :
</p>

<pre class="ipsCode">#LogFormat "%a %l %u %t \"%r\" %&gt;s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
RemoteIPHeader CF-Connecting-IP
RemoteIPTrustedProxy 173.245.48.0/20
RemoteIPTrustedProxy 103.21.244.0/22
RemoteIPTrustedProxy 103.22.200.0/22
RemoteIPTrustedProxy 103.31.4.0/22
RemoteIPTrustedProxy 141.101.64.0/18
RemoteIPTrustedProxy 108.162.192.0/18
RemoteIPTrustedProxy 190.93.240.0/20
RemoteIPTrustedProxy 188.114.96.0/20
RemoteIPTrustedProxy 197.234.240.0/22
RemoteIPTrustedProxy 198.41.128.0/17
RemoteIPTrustedProxy 162.158.0.0/15
RemoteIPTrustedProxy 104.16.0.0/12
RemoteIPTrustedProxy 172.64.0.0/13
RemoteIPTrustedProxy 131.0.72.0/22
RemoteIPTrustedProxy 2400:cb00::/32
RemoteIPTrustedProxy 2606:4700::/32
RemoteIPTrustedProxy 2803:f800::/32
RemoteIPTrustedProxy 2405:b500::/32
RemoteIPTrustedProxy 2405:8100::/32
RemoteIPTrustedProxy 2a06:98c0::/29
RemoteIPTrustedProxy 2c0f:f248::/32</pre>

<p>
	<br />
	*you can remove “#” uncomment from in front of LogFormat for customized log format.
</p>

<p>
	Step 3 :<br />
	Restart Apache webserver and done :
</p>

<pre class="ipsCode">systemctl restart httpd</pre>

<p>
	 
</p>
]]></description><guid isPermaLink="false">28</guid><pubDate>Sat, 03 Jun 2023 17:14:33 +0000</pubDate></item><item><title>Getting a [!!! CRITICAL ALERT !!!] Ghost files (deleted but running) found in NEW CWP install</title><link>https://www.alphagnu.com/topic/621-getting-a-critical-alert-ghost-files-deleted-but-running-found-in-new-cwp-install/</link><description><![CDATA[<p>Posted in the CWP forums but there is not much going on there figure might get some help here..</p><p>New CWP install on Alma 8. On a private IP with no ports forwarded just doing the updates and such.</p><p>Ran some updates and. got the popup in the webpage ran and got this.</p><p>No idea? Is it serious or just a false positive on something.<br><br>sh /scripts/cwp_security_audit<br>------------------------------------------------------<br>[INFO] Auditing cwpsrv (PID: 156548)<br>[OK] cwpsrv looks clean.<br>------------------------------------------------------<br>[INFO] Auditing php-fpm-cwp (PID: 1086)<br>[!!! CRITICAL ALERT !!!] Ghost files (deleted but running) found:<br><strong>php-fpm 1086 root  DEL       REG              253,0             1837740 /usr/local/ioncube/ioncube_loader_lin_</strong><a rel="external nofollow" href="https://7.2.so"><strong>7.2.so</strong></a><br>Error:Can't add notification!------------------------------------------------------<br>[INFO] Auditing apache (PID: 157091)<br>[OK] apache looks clean.<br>------------------------------------------------------</p>]]></description><guid isPermaLink="false">621</guid><pubDate>Sat, 21 Feb 2026 05:39:07 +0000</pubDate></item><item><title>Update phpMyAdmin to latest (currently 5.2.1)?</title><link>https://www.alphagnu.com/topic/525-update-phpmyadmin-to-latest-currently-521/</link><description><![CDATA[<p>
	Is there a way besides the script in the /scripts folder to update phpMyAdmin?
</p>

<p>
	The script in the directory say it has the latest, but is running 5.1.1, and the current version (as of 2024-06-07) is 5.2.1.
</p>

<p>
	 
</p>

<p>
	Thanks
</p>
]]></description><guid isPermaLink="false">525</guid><pubDate>Fri, 07 Jun 2024 11:03:45 +0000</pubDate></item><item><title>Upgrade MariaDB 10.11 In CWP Centos 7 Centos 8 stream AlmaLinux 7/8 RockyLinux 7/8</title><link>https://www.alphagnu.com/topic/23-upgrade-mariadb-1011-in-cwp-centos-7-centos-8-stream-almalinux-78-rockylinux-78/</link><description><![CDATA[<p>MariaDB 10.11 is now very stable and many features have been added and improved in this version You can check all the lists of changes here</p><p>I’ve checked MariaDB 10.11 with WordPress, Joomla, xenforo, IPS forum and some more PHP scripts which depends on MySQL DB are working fine with this version hence it is safe to upgrade to this version.</p><p>Short description about MariaDB :</p><p>MariaDB is designed as a drop-in replacement of MySQL with more features, new storage engines, fewer bugs, and better performance. MariaDB is developed by many of the original developers of MySQL who now work for the MariaDB Foundation and the MariaDB Corporation, and by many people in the community.</p><p><strong>Step 1 :</strong><br>Remove MariaDB 10.0/10.1/10.2/10.3/10.x<br>To upgrade Mariadb 10.11 in Centos 7/CWP do this :<br>Before installing it is recommended to backup your databases, although it is not necessary if you followed this steps carefully.</p><p>First, backup your current my.cnf config :</p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>cp /etc/my.cnf /etc/my.cnf.bak</code></pre><p><br>Remove MariaDB 10.0/10.1/10.2/10.3/10.xx :</p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>systemctl stop mariadb mysql mysqld
systemctl disable mariadb
rpm -e --nodeps $(rpm -qa | grep -i mariadb)
rpm -e --nodeps mysql-common mysql-libs mysql-devel
rpm --nodeps -ev MariaDB-server</code></pre><p><br>At this point, MariaDB 10.0/10.1/10.2/10.3.10.xx will be removed completely, but the databases are not removed, so you don’t need to worry.</p><p>Then Install MariaDB 10.11 :</p><p><strong>Step 2 :</strong><br>Installation/Updating from MariaDB 10.0/10.1/10.2/10.3/10.xx to MariaDB 10.11</p><p><br><strong>To upgrade Mariadb to 10.11 in Centos 7 CWP do this :</strong><br>Install/enable the Official repo for mariadb 10.11:</p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>yum install nano epel-release -y</code></pre><p><br>Now edit/create the Repo file :</p><p>Ensure you don’t have any other MariaDB repo file in /etc/yum.repos.d If it exists, delete or backup the existing repo file :</p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>mv /etc/yum.repos.d/mariadb.repo /etc/yum.repos.d/mariadb.repo.bak
nano /etc/yum.repos.d/mariadb.repo</code></pre><p><br>Then paste these lines and save them:<br>to install Mariadb 10.11</p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>[mariadb]
name = MariaDB
baseurl = https://rpm.mariadb.org/10.11/centos/$releasever/$basearch
module_hotfixes = 1
gpgkey = https://rpm.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck = 1</code></pre><p><br>After that, we’ll install MariaDB 10.11 :</p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>yum clean all
yum install MariaDB-server MariaDB-client MariaDB-devel MariaDB-shared net-snmp perl-DBD-MySQL -y
yum update -y</code></pre><p><br><strong>To upgrade Mariadb 10.11 in CentOS 8 stream/AlmaLinux 8/rockylinux 8, do this :</strong></p><p>Check this reply if the upgrade is failing : <br><a rel="" href="https://www.alphagnu.com/topic/23-upgrade-mariadb-1011-in-cwp-centos-7-centos-8-stream-almalinux-78-rockylinux-78/#findComment-1302">https://www.alphagnu.com/topic/23-upgrade-mariadb-1011-in-cwp-centos-7-centos-8-stream-almalinux-78-rockylinux-78/#findComment-1302</a><br><br>Now edit/create the Repo file :</p><p>Ensure you don’t have any other MariaDB repo file in /etc/yum.repos.d If it exists, delete or backup the existing repo file :</p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>mv /etc/yum.repos.d/mariadb.repo /etc/yum.repos.d/mariadb.repo.bak
nano /etc/yum.repos.d/mariadb.repo</code></pre><p><br>Add these lines and save them:</p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>[mariadb]
name = MariaDB
baseurl = https://rpm.mariadb.org/10.11/centos/$releasever/$basearch
module_hotfixes = 1
gpgkey = https://rpm.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck = 1</code></pre><p><br>After that, update Mariadb 10.11 :</p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>yum clean all
yum install MariaDB-server MariaDB-client MariaDB-devel MariaDB-shared net-snmp perl-DBD-MySQL -y
yum update -y</code></pre><p><br><strong>Step 3 :</strong><br>Restore the my.cnf file :</p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>rm -rf /etc/my.cnf
cp /etc/my.cnf.bak /etc/my.cnf</code></pre><p><br>Then enable MariaDB to start on boot and start the service :</p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>systemctl enable mariadb
service mariadb start</code></pre><p><br><strong>Step 4 :</strong><br>After Installation, we need to upgrade the current databases with this command :</p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>mysql_upgrade --force</code></pre><p><br>that’s it you’ve successfully upgraded MariaDB 10.0/10.1/10.2/10.3/10.xx to MariaDB 10.11.</p><p>You can confirm the version by running this command from the terminal: ssh:</p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>mysql -V</code></pre><p> </p>]]></description><guid isPermaLink="false">23</guid><pubDate>Fri, 02 Jun 2023 14:42:16 +0000</pubDate></item><item><title>Updated Dovecot 2.4 conf file</title><link>https://www.alphagnu.com/topic/623-updated-dovecot-24-conf-file/</link><description><![CDATA[<p>Doesn't anyone have an updated dovecot.conf for Dovecot 2.4 that is working correctly?</p><p>There have been changes from 2.3 -&gt; 2.4</p><p>We fix one or 2 lines, but then get another error.<br>Was wondering if anyone had it working fully?</p><p></p><p>Thanks</p>]]></description><guid isPermaLink="false">623</guid><pubDate>Tue, 03 Mar 2026 02:24:15 +0000</pubDate></item><item><title>Policyd (cbpolicyd) Failure After upgrading MariaDB on AlmaLinux 8 / 9 with CWP</title><link>https://www.alphagnu.com/topic/620-policyd-cbpolicyd-failure-after-upgrading-mariadb-on-almalinux-8-9-with-cwp/</link><description><![CDATA[<h2>This phenomenon typically occurs after a MariaDB upgrade.</h2><p>Typical log fragments in the maillog:</p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>warning: connect to 127.0.0.1:10031: Connection timed out
warning: problem talking to server 127.0.0.1:10031
451 4.3.5 Recipient address rejected: Server configuration problem
install_driver(mysql) failed: Can't locate DBD/mysql.pm</code></pre><p>This indicates that <strong>cbpolicyd (Cluebringer)</strong> cannot load the required Perl database driver.</p><h3>Root Cause</h3><p>Policyd relies on a Perl DBI driver to connect to its MariaDB/MySQL backend. If the <code>DBD::mysql</code> module is removed or mismatched, Policyd child processes exit with status 2, and Postfix rejects all RCPT requests due to policy service timeout.</p><h2>AlmaLinux 8 vs AlmaLinux 9 Behavior</h2><h3>AlmaLinux 8 (EL8)</h3><ul><li><p>Policyd requires:<br><code>perl-DBD-MySQL</code></p></li><li><p>The configuration remains in /etc/cbpolicyd/cbpolicyd.conf </p></li></ul><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>DSN=DBI:mysql:database=postfix_policyd;host=localhost</code></pre><p>Installing <code>perl-DBD-MySQL</code> resolves the issue.</p><hr><h3>AlmaLinux 9 (EL9)</h3><p>EL9 introduces a packaging change where installing <code>perl-DBD-MySQL</code> may attempt to pull MySQL 8 libraries that conflict with MariaDB.</p><p>Instead, install:</p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>dnf install perl-DBD-MariaDB</code></pre><p>Then <strong>update the Policyd configuration</strong>:</p><p>Edit:</p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>/etc/cbpolicyd/cbpolicyd.conf</code></pre><p>Replace:</p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>DSN=DBI:mysql:database=postfix_policyd;host=localhost</code></pre><p>With:</p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>DSN=DBI:MariaDB:database=postfix_policyd;host=localhost</code></pre><p>This forces Policyd to load the <code>DBD::MariaDB</code> driver instead of <code>DBD::mysql</code>.</p><p>After modification:</p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>systemctl restart cbpolicyd
systemctl restart postfix</code></pre><h2>Key Takeaway</h2><ul><li><p>EL8 → install <code>perl-DBD-MySQL</code></p></li><li><p>EL9 → install <code>perl-DBD-MariaDB</code> <strong>and change the DSN driver in </strong><code>/etc/cbpolicyd/cbpolicyd.conf</code></p></li></ul><p>Failure to update the DSN on EL9 will cause continuous Policyd crashes and complete mail flow disruption.</p><p>This distinction is critical for maintaining stable CWP mail servers after MariaDB upgrades or package maintenance.</p><p></p>]]></description><guid isPermaLink="false">620</guid><pubDate>Fri, 20 Feb 2026 16:24:27 +0000</pubDate></item><item><title>Install latest version of php 8.4 PHP switcher in CWP- Control web panel - EL8/9 AlmaLinux 8/9</title><link>https://www.alphagnu.com/topic/615-install-latest-version-of-php-84-php-switcher-in-cwp-control-web-panel-el89-almalinux-89/</link><description><![CDATA[<p>This is a tutorial for PHP 8.4 installation in CWP PHP Switcher</p><p>I've switched to direct compiler environment variables that pass flags straight to gcc, g++, and ld - eliminating pkg-config dependency that was failing across servers.</p><p>Old Method (Unstable):</p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>pkg-config → generates flags → gcc/g++/ld
↓
Breaks when pkg-config .pc files missing/corrupted/version mismatch</code></pre><p>New Method (Stable):</p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>CFLAGS/CXXFLAGS/LDFLAGS → gcc/g++/ld directly
↓
No pkg-config intermediary = consistent builds everywhere</code></pre><p>Install dependencies :</p><pre spellcheck="" class="ipsCode language-bash" data-language="Bash"><code># For el9 only : 
dnf config-manager --set-enabled crb

# run these for el8 and el9
dnf groupinstall "Development Tools"
dnf install glibc-devel elfutils-libelf-devel
dnf install git make gcc gcc-c++ binutils glibc-devel autoconf libtool bison re2c automake libxml2-devel openssl-devel sqlite-devel bzip2-devel libcurl-devel libpng-devel libavif-devel libwebp-devel libjpeg-devel libXpm-devel freetype-devel gmp-devel libicu-devel openldap-devel oniguruma-devel libargon2-devel libtidy-devel libxslt-devel </code></pre><p>Build PHP 8.4 switcher :</p><pre spellcheck="" class="ipsCode language-bash" data-language="Bash"><code>rm -rf /usr/local/php-84
mkdir -p /usr/local/php-84
cd /usr/local/php-84
wget http://php.net/distributions/php-8.4.15.tar.gz
tar zxvf php-8.4.15.tar.gz
cd php-8.4.15
./configure --with-config-file-path=/usr/local/php --enable-cgi --with-config-file-scan-dir=/usr/local/php/php.d --with-zlib=/usr --enable-mbstring --with-zip --enable-bcmath --enable-pcntl --enable-ftp --enable-exif --enable-calendar --enable-sysvmsg --enable-sysvsem --enable-sysvshm --with-tidy --with-curl --with-iconv --with-gmp --enable-gd --with-avif --with-jpeg --with-freetype --enable-gd-jis-conv --with-webp --with-xpm --with-openssl --with-pdo-mysql=mysqlnd --with-gettext=/usr --with-bz2=/usr --with-mysqli --enable-soap --enable-phar --with-xsl --enable-posix --enable-sockets --with-external-pcre --with-libdir=lib64 --with-mysql-sock=/var/lib/mysql/mysql.sock --enable-intl --with-password-argon2 --enable-litespeed --with-ldap=/usr --with-ldap-sasl=/usr 
export CFLAGS="-O2 -fPIE -DPIC"
export CXXFLAGS="-O2 -fPIE -DPIC"
export LDFLAGS="-pie -Wl,--as-needed"
make -j$(nproc)
make install</code></pre><p>After that, PHP 8.4 will be installed. You can check via the php -v command :</p><pre spellcheck="" class="ipsCode language-bash" data-language="Bash"><code>[root@alma]# php -v
PHP 8.4.15 (cli) (built: Dec  3 2025 01:45:34) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.4.15, Copyright (c) Zend Technologies</code></pre>]]></description><guid isPermaLink="false">615</guid><pubDate>Wed, 03 Dec 2025 01:48:43 +0000</pubDate></item><item><title>TLSA DNS Record</title><link>https://www.alphagnu.com/topic/617-tlsa-dns-record/</link><description><![CDATA[<p><a href="https://www.alphagnu.com/profile/1-sandeep-b/" class="ipsMention" data-mentionid="1" data-ipshover="" data-ipshover-target="https://www.alphagnu.com/profile/1-sandeep-b/?do=hovercard" rel="">@Sandeep B.</a>  or Anyone have an idea how to create a TLSA DNS record on AlmaLinux 9 with CWP?</p><p></p><p>Thanks</p>]]></description><guid isPermaLink="false">617</guid><pubDate>Wed, 21 Jan 2026 13:46:30 +0000</pubDate></item><item><title>CWP DNS Auditing, Automation for CoudFlare DNS Synchronization, and Gmail (Email) Deliverability</title><link>https://www.alphagnu.com/topic/619-cwp-dns-auditing-automation-for-coudflare-dns-synchronization-and-gmail-email-deliverability/</link><description><![CDATA[<p>Over the years I made some sloppy edits and god knows what tech support might have done DNS records. </p><p>I used Gemini's cli tools to do an audit of the DNS and email Deliverability. This saved me soooo much time and frustration. </p><p>The following is published here "<a rel="external nofollow" href="https://i-cloud.ltd/cwp-dns-manual/">https://i-cloud.ltd/cwp-dns-manual/</a>" and you can get the script and manual for this </p><p><a rel="external nofollow" href="https://i-cloud.ltd/cwp-dns-manual/manual.txt"><strong>Download Manual (TXT)</strong></a><strong> &amp; </strong><a rel="external nofollow" href="https://i-cloud.ltd/cwp-dns-manual/sync_cloudflare_dns.py"><strong>Download Sync Script (Python)</strong></a></p><p></p><p><strong>CWP DNS Auditing, Automation for CoudFlare DNS Synchronization, and Gmail (Email) Deliverability Manual</strong></p><p><strong>Authoritative Synchronization between CWP Control Web Panel and Cloudflare</strong></p><p><em>Contributor Attribution: J:Mc @ i-cloud.ltd</em></p><h2>1. Introduction</h2><p>Managing DNS records across multiple domains is one of the most critical yet error-prone tasks for a system administrator. While CentOS Web Panel (CWP) provides a robust environment for local mail and web hosting, maintaining consistency with external DNS providers like Cloudflare often requires tedious manual entry.</p><p>Small discrepancies such as a mismatched DKIM key or malformed SPF records can instantly degrade a domain's sender reputation, causing legitimate emails to be flagged as spam or rejected entirely by providers like Gmail and Outlook. This manual outlines a standardized, CLI-driven workflow to automate the synchronization of local server records with Cloudflare, ensuring 100% compliance with modern email deliverability standards.</p><h2>2. Core Purpose &amp; Strategic Value</h2><p>The primary objective of this automation is to ensure that the "local reality" of the server (the keys and IPs actually in use) is perfectly reflected in the "public reality" of the global DNS.</p><h3>Key Use Cases:</h3><ul><li><p><strong>Production Environment Drift:</strong> Over time, manual edits or CWP updates can lead to duplicate SPF records or redundant MX entries. This process identifies and prunes those errors automatically.</p></li><li><p><strong>Server Migration Scenarios:</strong> When moving domains to a new server or a new IP address, the ability to bulk-update records across dozens of zones via the CLI saves hours of manual UI work.</p></li><li><p><strong>New Server Provisioning:</strong> During initial builds, the workflow allows you to generate keys locally and "push" them to Cloudflare in seconds.</p></li><li><p><strong>Automated "Overwrite" Logic:</strong> Our CLI approach performs a true "diff," deleting stale records and updating active ones to ensure a clean, authoritative state.</p></li></ul><p><strong>Associated Files:</strong><a rel="external nofollow" href="https://i-cloud.ltd/cwp-dns-manual/manual.txt"><strong>Download Manual (TXT)</strong></a><a rel="external nofollow" href="https://i-cloud.ltd/cwp-dns-manual/sync_cloudflare_dns.py"><strong>Download Sync Script (Python)</strong></a></p><h2>3. Preliminary Configuration</h2><h3>Cloudflare API Integration</h3><p>Security is paramount. Create a scoped token in the Cloudflare Dashboard with <code>Zone - DNS - Edit</code> and <code>Zone - Zone - Read</code> permissions. Use IP filtering to restrict the token to your server's IPv4 address.</p><h3>Server-Side Preparation</h3><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code># Initialize a isolated environment
python3 -m venv venv
source venv/bin/activate

# Install required dependencies
pip install cloudflare httpx</code></pre><h2>4. Local BIND Audit &amp; Correction</h2><p>Before syncing, the local BIND zone files (<code>/var/named/*.db</code>) must be syntactically correct.</p><ul><li><p><strong>Quoting TXT Records:</strong> Ensure all TXT values, particularly DMARC and SPF, are enclosed in double quotes.</p></li><li><p><strong>SPF Optimization:</strong> Use a clean IP-based string: <code>"v=spf1 +a +mx +ip4:YOUR_SERVER_IP ~all"</code></p></li><li><p><strong>Zone Reloading:</strong> <code>sudo rndc reload domain.com</code></p></li></ul><h2>5. Executing the Synchronization</h2><p>We utilize the <code>sync_cloudflare_dns.py</code> script to perform the synchronization.</p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code># 1. Export Token
export CLOUDFLARE_API_TOKEN='your_secret_token'

# 2. Validation (Dry-Run)
python3 sync_cloudflare_dns.py domain.com local_template.txt

# 3. Execution
python3 sync_cloudflare_dns.py domain.com local_template.txt --run</code></pre><h2>6. Global Deliverability Checklist</h2><ul><li><p><strong>SPF:</strong> Single, valid record including your server's IPv4.</p></li><li><p><strong>DKIM:</strong> Public key in Cloudflare must exactly match the server key.</p></li><li><p><strong>DMARC:</strong> A policy of at least <code>p=none</code>; <code>p=quarantine</code> is recommended.</p></li><li><p><strong>Network Protocol:</strong> Force mail traffic over IPv4 if IPv6 PTR is missing: <code>sudo postconf -e "inet_protocols = ipv4" &amp;&amp; sudo systemctl restart postfix</code></p></li></ul><p></p><p>I hope this is useful to you. </p>]]></description><guid isPermaLink="false">619</guid><pubDate>Sun, 01 Feb 2026 22:02:45 +0000</pubDate></item><item><title>ImageMagick install script for AlmaLinux 9.x and CWP</title><link>https://www.alphagnu.com/topic/618-imagemagick-install-script-for-almalinux-9x-and-cwp/</link><description><![CDATA[<p>There was some change in the availability of ImageMagick, so the PHP 8.4 and 8.5 installation script needed to be corrected.</p><pre spellcheck="" class="ipsCode language-bash" data-language="Bash"><code>#!/bin/bash

# Detect PHP FPM version
PHPFPM="/opt/alt/php-fpm84"
if [ ! -e "${PHPFPM}/usr/bin/php-config" ]; then
    PHPFPM="/opt/alt/php-fpm85"
fi

PHPBIN="${PHPFPM}/usr/bin/php"
PHPCONFIG="${PHPFPM}/usr/bin/php-config"
PHPINIDIR="${PHPFPM}/usr/php/php.d"

if [ ! -x "${PHPCONFIG}" ]; then
    echo "Skipping Imagick: php-config not found (${PHPCONFIG})"
    exit 0
fi

echo "Installing prerequisites..."
dnf -y install ImageMagick ImageMagick-devel ImageMagick-perl pkgconfig

cd /usr/local/src
rm -rf imagick-*

echo "Downloading imagick-3.8.1..."
wget https://pecl.php.net/get/imagick -O imagick.tgz
tar -xf imagick.tgz
cd imagick-*

echo "phpize..."
${PHPFPM}/usr/bin/phpize

echo "Configuring..."
./configure --with-php-config=${PHPCONFIG}

echo "Compiling..."
make -j"$(nproc)" &amp;&amp; make install

EXTDIR="$(${PHPCONFIG} --extension-dir)"

if [ -e "${EXTDIR}/imagick.so" ]; then
    echo "Creating imagick.ini"
    echo "extension=imagick.so" &gt; "${PHPINIDIR}/imagick.ini"
    echo "Imagick installation OK."
else
    echo "ERROR: imagick.so missing: ${EXTDIR}/imagick.so"
fi
</code></pre><p>The place of the script is:</p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>/usr/local/cwpsrv/htdocs/resources/conf/el9/php-fpm_selector/external_modules/8.4</code></pre><p></p>]]></description><guid isPermaLink="false">618</guid><pubDate>Wed, 21 Jan 2026 16:27:24 +0000</pubDate></item><item><title>Install latest version of php 8.5 PHP switcher in CWP- Control web panel - EL8/9 AlmaLinux 8/9</title><link>https://www.alphagnu.com/topic/616-install-latest-version-of-php-85-php-switcher-in-cwp-control-web-panel-el89-almalinux-89/</link><description><![CDATA[<p>This is a tutorial for PHP 8.5 installation in CWP PHP Switcher</p><p>I've switched to direct compiler environment variables that pass flags straight to gcc, g++, and ld - eliminating pkg-config dependency that was failing across servers.</p><p>Old Method (Unstable):</p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>pkg-config → generates flags → gcc/g++/ld
↓
Breaks when pkg-config .pc files missing/corrupted/version mismatch</code></pre><p>New Method (Stable):</p><pre spellcheck="" class="ipsCode language-plaintext" data-language="Plain Text"><code>CFLAGS/CXXFLAGS/LDFLAGS → gcc/g++/ld directly
↓
No pkg-config intermediary = consistent builds everywhere</code></pre><p>Install dependencies :</p><pre spellcheck="" class="ipsCode language-bash" data-language="Bash"><code># For el9 only : 
dnf config-manager --set-enabled crb

# run these for el8 and el9
dnf groupinstall "Development Tools"
dnf install glibc-devel elfutils-libelf-devel
dnf install git make gcc gcc-c++ binutils glibc-devel autoconf libtool bison re2c automake libxml2-devel openssl-devel sqlite-devel bzip2-devel libcurl-devel libpng-devel libavif-devel libwebp-devel libjpeg-devel libXpm-devel freetype-devel gmp-devel libicu-devel openldap-devel oniguruma-devel libargon2-devel libtidy-devel libxslt-devel </code></pre><p>Build PHP 8.5 switcher :</p><pre spellcheck="" class="ipsCode language-bash" data-language="Bash"><code>rm -rf /usr/local/php-85
mkdir -p /usr/local/php-85
cd /usr/local/php-85
wget http://php.net/distributions/php-8.5.0.tar.gz
tar zxvf php-8.5.0.tar.gz
cd php-8.5.0
./configure --with-config-file-path=/usr/local/php --enable-cgi --with-config-file-scan-dir=/usr/local/php/php.d --with-zlib=/usr --enable-mbstring --with-zip --enable-bcmath --enable-pcntl --enable-ftp --enable-exif --enable-calendar --enable-sysvmsg --enable-sysvsem --enable-sysvshm --with-tidy --with-curl --with-iconv --with-gmp --enable-gd --with-avif --with-jpeg --with-freetype --enable-gd-jis-conv --with-webp --with-xpm --with-openssl --with-pdo-mysql=mysqlnd --with-gettext=/usr --with-bz2=/usr --with-mysqli --enable-soap --enable-phar --with-xsl --enable-posix --enable-sockets --with-external-pcre --with-libdir=lib64 --with-mysql-sock=/var/lib/mysql/mysql.sock --enable-intl --with-password-argon2 --enable-litespeed --with-ldap=/usr --with-ldap-sasl=/usr 
export CFLAGS="-O2 -fPIE -DPIC"
export CXXFLAGS="-O2 -fPIE -DPIC"
export LDFLAGS="-pie -Wl,--as-needed"
make -j$(nproc)
make install</code></pre><p>After that, PHP 8.5 will be installed. You can check via the php -v command :</p><pre spellcheck="" class="ipsCode language-bash" data-language="Bash"><code>[root@alma]# php -v
PHP 8.5.0 (cli) (built: Dec  3 2025 01:59:52) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.5.0, Copyright (c) Zend Technologies
    with Zend OPcache v8.5.0, Copyright (c), by Zend Technologies</code></pre>]]></description><guid isPermaLink="false">616</guid><pubDate>Wed, 03 Dec 2025 02:01:01 +0000</pubDate></item><item><title>Manual update of PHP in CWP</title><link>https://www.alphagnu.com/topic/605-manual-update-of-php-in-cwp/</link><description><![CDATA[<p><a href="https://www.alphagnu.com/profile/1-sandeep-b/" class="ipsMention" data-mentionid="1" data-ipshover="" data-ipshover-target="https://www.alphagnu.com/profile/1-sandeep-b/?&amp;do=hovercard" rel="">@Sandeep B.</a> </p><p>Since CWP is now 2 versions behind the current versions, was wondering if you could post how to manually update PHP and PHP-FPM?</p><p>Along with the options for ionCube, LDAP, and mailparse.</p><p></p><p>Thanks</p>]]></description><guid isPermaLink="false">605</guid><pubDate>Fri, 25 Jul 2025 18:04:37 +0000</pubDate></item><item><title>Time to fully integrate the New Backup Beta</title><link>https://www.alphagnu.com/topic/595-time-to-fully-integrate-the-new-backup-beta/</link><description><![CDATA[<p>Hi Sandeep</p><p>As I found out a long time ago, the New Backup Beta in CWP works so much better than the standard backup which is completely obsolete now.</p><p>So time to integrate it fully into the MMI in the main page and drop the currently linked standard backup completely.</p><p>Also a kind of persistent annoyance when the MMI says backup is switched off even when the new backup beta is enabled and running. There have been numerous events now when I switched it on occasionally and only having two backups running in paralell and eating up my disk space quickly.</p><p>I think there is no one out there who still uses the standad backup anymore when the new backup beta runs flawlessly since years. Sure this is for beaty right now but we should keep CWP in a deflated and disk efficient status, and for you this would be a nobrainer to be integrated in less than 5 minutes I guess.</p><p>Keep it up man</p><p></p>]]></description><guid isPermaLink="false">595</guid><pubDate>Sun, 16 Mar 2025 08:09:40 +0000</pubDate></item><item><title>CSF replacements needs</title><link>https://www.alphagnu.com/topic/607-csf-replacements-needs/</link><description><![CDATA[<p>The CSF project is abandoned, and newly installed CWP Pro already has several issues during installation. <br>Here is the topic: <a rel="external nofollow" href="https://www.jaspreet.net/2025/09/06/3180/how-to-fix-csf-firewall-error-oops-unable-to-download-no-host-option-provided/">https://www.jaspreet.net/2025/09/06/3180/how-to-fix-csf-firewall-error-oops-unable-to-download-no-host-option-provided/</a></p><p><a href="https://www.alphagnu.com/profile/1-sandeep-b/" class="ipsMention" data-mentionid="1" data-ipshover="" data-ipshover-target="https://www.alphagnu.com/profile/1-sandeep-b/?&amp;do=hovercard" rel="">@Sandeep B.</a> Do you have any idea how to replace CSF in CWP Pro servers?</p>]]></description><guid isPermaLink="false">607</guid><pubDate>Wed, 01 Oct 2025 17:43:05 +0000</pubDate></item></channel></rss>
