Technical Lead based in Manchester, UK
npm install : Killed (Ubuntu 16.04)
While installing packages via npm, it failed with just the message “Killed”. Automatically this triggers me to believe it is memory related. I was after all running the VM with only 1G memory.
Fix npm install Killed
So to resolve this, you need to create and extend a swap file.
You can do this in Ubuntu 14.04 and 16.04 with the following commands:
sudo fallocate -l 1G /swapfile sudo chmod 600 /swapfile sudo mkswap /swapfile sudo swapon /swapfile sudo swapon –show sudo cp /etc/fstab /etc/fstab.bak echo ‘/swapfile none swap sw 0 0’ | sudo tee -a /etc/fstab sudo sysctl vm.swappiness=10 echo ‘vm.swappiness=10’ | sudo tee -a /etc/sysctl.conf sudo sysctl vm.vfs_cache_pressure=50 echo ‘vm.vfs_cache_pressure=50’ | sudo tee -a /etc/sysctl.conf
…cPanel Error:The system experienced the following error when it attempted to install the “OWASP ModSecurity Core Rule Set V3.0” vendor
I’ve noticed that since upgrading cPanel to v68.0.28 our ModSecurity Vendors have dropped off, and no longer available in the interface, and the rules are no longer available for Apache.
When trying to add the OWASP Ruleset (Vendor) back, I get the following error message.
Error:The system experienced the following error when it attempted to install the “OWASP ModSecurity Core Rule Set V3.0” vendor: API failure: The system could not validate the new Apache configuration because httpd exited with a nonzero value. Apache produced the following error: httpd: Syntax error on line 208 of /etc/apache2/conf/httpd.conf: Syntax error on line 32 of /etc/apache2/conf.d/modsec2.conf: Syntax error on line 29 of /etc/apache2/conf.d/modsec/modsec2.cpanel.conf: Could not open configuration file /etc/apache2/conf.d/modsec_vendor_configs/OWASP/modsecurity_crs_10_setup.conf: No such file or directory
…Install PHP 5.6 on CentOS/RHEL 7 via YUM (Webtatic and IUS)
Again, another brain dump for future use. A stock installation of CentOS 7 will be packaged with PHP 5.4 which is now end of life. This is how to install PHP 5.6, which is currently only receiving security updates.
Side note: These commands install the basic PHP requirements for Magento.
Installing PHP 5.6 on CentOS 7 via Webtatic
$ rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
$ rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
$ yum install php56w php56w-opcache php56w-xml php56w-mcrypt php56w-gd php56w-devel php56w-mysql php56w-intl php56w-mbstring php56w-bcmath php56w-soap
Installing PHP 5.6 on CentOS 7 via IUS
$ yum -y install epel-release
$ wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
$ wget https://centos6.iuscommunity.org/ius-release.rpm
$ rpm -Uvh ius-release*.rpm yum -y update yum -y install php56u php56u-opcache php56u-xml php56u-mcrypt php56u-gd php56u-devel php56u-mysql php56u-intl php56u-mbstring php56u-bcmath php56u-soap
You can also install php-fpm via these repositories. For example: yum install php56w-fpm (webtatic) or yum install php56u-fpm (ius)
…Centovacast - Getting Listener Statistics via MySQL
We ran into a little issue with our Centovacast installation last month. It turns out, that if you have a few large radio stations using the same server, the MySQL Database tables get rather full (20 million rows), and when trying to pull the data back into the Centovacast interface was causing some issues (timeout and 500 errors etc). Which ultimately meant our customers could not retrieve the statistics they needed.
…Meltdown and Spectre : Patching Linux
Here’s a quick guide on how to patch some of the many Linux distros against the Meltdown and Spectre vulnerabilities! After spending the week monitoring each distribution, and deciding the best time to patch (after waiting for results).
Don’t forget to reboot your machine/server after applying the updates!
CentOS 7
x86_64
$ sudo yum clean all && yum install kernel-3.10.0-693.11.6.el7.x86_64 $ sudo reboot
Patched Kernel : kernel-3.10.0-693.11.6.el7.x86_64
Source: https://lists.centos.org/pipermail/centos-announce/2018-January/022696.html
CentOS 6
x86_64
$ sudo yum clean all && yum install kernel-2.6.32-696.18.7.el6.x86_64 $ sudo reboot
…OpenVZ - Hostnames & Systemd (ovzhostname.service)
The problem?
For weeks, I’ve been battling with an issue with a new CentOS 7 template for cPanel and Plesk, I built for the OpenVZ hypervisor. Even when setting the HOSTNAME=<hostname> in the /etc/vz/<CTID>.conf the container still rebooted with the hostname which was used when the template was created. Meaning the new and correct hostname would never be remembered. Causing various issues with BIND, Apache etc.
Even trying to set the hostname with the following failed!
…Comodo WAF: mod_security2: Failed to write to DBM file "/var/cache/modsecurity/ip": Invalid argument
After seeing apache using all it’s threads, and connections not timing out as they should, I looked at the apache error_log and found the following error.
Message: collection_store: Failed to write to DBM file “/var/cache/modsecurity/ip”: Invalid argument
I not only saw this on cPanel servers, but on Plesk and plain LAMP (with mod_security and comodo waf installed).
It looks like Comodo somehow released a broken update, that caused the /var/cache/modsecurity/ip.pag to corrupt (that’s my guess).
…Dovecot modseq_hdr.log_offset too large (Plesk)
Another quick fix post!
Problem
A mailbox for a specific user was not receiving mail on a postfix & dovecot on a Plesk server which I managed. The following error messages were being shown in the mail log:
$ tail -f /var/log/maillog Apr 25 15:04:34 server01 dovecot: service=imap, [email protected], ip=[192.168.0.1]. Error: /var/qmail/mailnames/exampledomain.com/dan/Maildir/dovecot.index: modseq_hdr.log_offset too large
As you can see the the error is: “modseq_hdr.log_offset too large”.
I’m not sure what caused this (I think it’s related to the dovecot.index file becoming corrupted - but not 100% sure), but this quick solution fixed it.
…Basic Steam RCON Example (Rust)
After spending time over Christmas coding a tool to query Steam servers for information. I’ve now been taking the next steps… Sending data to a Steam server!
For this example, I’m going to be using a Rust Dedicated Server, to send a simple command, then in future posts show how I sent scheduled commands (such as adverts, messages and other routine tasks which you would expect a Rust server to run).
…Plesk "The component was not installed" for all services.
This is a really small blog post, but it’s an issue I wanted to share - so hopefully anyone who comes across this issue themselves can avoid the mistake I made!
Basically, we noticed that one of our older Plesk servers seemed to have lost basic functionality like editing DNS zones, or accessing PHPMyAdmin or Webmail.
When going to Tools & Settings > Server Components we noticed that next to all the services (components), there was the message “The component was not installed”. 