PHP script to monitor exim mail queue

When you run exim mail server, it is good to keep an eye on number of emails in mail queue. here is a PHP script that will check number of emails in queue, if it exceed pre-set number, it will email you.

Create file

Add following content.

In this case, if mails in queue exceeded 100, you get email.

You can change 100 to whatever number you need.

Replace [email protected] with your email address.

Set script to run every 10 minutes using cronjob

centovacast

Install SSL on Centova Cast

centovacast

Edit file

Find

Add below

Restart Centova Cast

At this point, you will be able to access Centova Cast on port 80 at

To install LetsEncrypt Free SSL certificate, run

Restart Centova Cast

Now you will be able to access Centova Cast using HTTPS.

VestaCP Free Hosting Control Panel

VestaCP Installer Compromised

VestaCP Free Hosting control panel compromised again. Hackers where able to get access to VestaCP infrastcuture server, allowing them to modify installation script, so it sent root password of servers to hacker.

Here is post from VestaCP on their forum

I’m sorry about inactivity in this post from our side. It was a complex issue and we were not sure we understand the whole picture. Leak in the installer is just one piece of the puzzle. All pieces together lead to cumulative effect.

The issue number one

Our infrastructure server was hacked. Presumably using API bug in the release 0.9.8-20. The hackers then changed all installation scripts to log admin password and ip as addition to the distro name we used to collect stats.

Please check if your server IP here

http://vestacp.com/test/?ip=127.0.0.1

If it’s there you should change admin passwords as soon as possible. Also please make sure there is no /usr/bin/dhcprenew binary installed on your server. This binary is some sort of trojan that is able to launch remote DDoS attack or open shell to your server

For more information, see

https://forum.vestacp.com/viewtopic.php?f=10&t=17641&start=180#p73907

Plesk Change PHP version

Change PHP version for a site in Plesk Command line

To change PHP version for a site, first find available PHP handlers, this can be done with command

Plesk Change PHP version

You need to find the id for the PHP handler. For PHP 5.6 fpm, it is “plesk-php56-fpm”.

To change a sites PHP version to PHP 5.6, run

Example

Plesk change PHP handler

error: ‘x264_bit_depth’ undeclared (first use in this function)

When installing ffmpeg, i get error

This is due to incompatability with ffmpeg and x264.

What you can do is try another version of x264. You will be able to download older version of x264 from

ftp://ftp.videolan.org/pub/x264/snapshots

On 2018-08-14, it failed with latest stable snapshot. So i tried 14 days old stable snapshot

This worked with ffmpeg.

Solution here is to try latet version first, if it did not work, try older version, say try 1 month old version, if that did not work, go back 2 months, see if that works.

Now install ffmpeg with

Zend OPcache in phpinfo

Enable Zend OPcache in PHP

To enable Zend OPCache in PHP, edit php.ini add following to end of the file

Now you may need to adjust some settings, in php.ini uncomment following, change values as needed.

Verify it with

Restart web server. If you using php-fpm or fcgi, you need to restart the process.

phpinfo() will show

Zend OPcache in phpinfo

phpinfo redis

Install Redis PHP Module from source

To install Redis PHP module from source, run

Once installed, edit your php.ini file, add following below extension_dir line

Verify redis is installed with php -m

Now restart web server

phpinfo() will show following

phpinfo redis