How to upgrade Virtualmin scripts when PHP version checks fail

When things have been running for long enough various updates and configuration changes start adding up with leftovers bound to cause an issue sooner or later.
With Virtualmin, one such issue is the system’s inability to automatically update its scripts to newer versions based on the incorrect detection that an older PHP version is running on the server instead of the actual one.

Automatically restart Webmin/Virtualmin in case of failure

Running out of memory sometimes happens on swap-less VPSes, and it seems Webmin (together with its twin, Virtualmin) are among the first processes to die in out-of-memory cases.

Setting up a little script to check for and restart Webmin if it is no longer running is a pretty simple (workaround) solution – but should never replace the proper procedure of adjusting the settings or upgrading the VPS to avoid running out of memory in the future.

Bash script to monitor and (re)start Webmin

Webmin (Virtualmin) has great service monitoring capabilities, restarting any failed services that it detects. Unfortunately, it cannot and does not monitor or restart itself it it crashes.

Still, since on (most) Linux systems it comes with a service manager, this can be used to check its status. The included bash script does this and restarts it if necessary…

Make Virtualmin 4 correctly display available memory on OpenVZ

Virtualmin displayed wrong amount of available memory on OpenVZ systems for a while (displaying either the guaranteed RAM instead of the burst or some random smaller value).

After the update to Virtualmin 4.02, the available RAM graph completely vanished from the system information page. To fix this…

Unable to login to FTP on CentOS 6 VPS with Virtualmin / ProFTPD?

Does the login to your newly installed CentOS 6 VPS using Virtualmin and ProFTPD fail?

Check your /var/log/secure for errors such as this :
proftpd: PAM unable to dlopen(/lib64/security/pam_stack.so): /lib64/security/pam_stack.so: cannot open shared object file: No such file or directory
proftpd: PAM adding faulty module: /lib64/security/pam_stack.so

If you are logging the above error your /etc/pam.d/proftpd was updated (incorrectly)…