HTTPd: Cannot load into server: undefined symbol: ap_copy_scoreboard_worker

Red Hat Enterprise Linux has published a new advisory on July 23rd, RHSA-2014:0920-1. This involves a security update for the Apache2 webserver for configurations that use mod_status in combination with ITK. CentOS then mirrored this update to their repositories as well.

However, if you execute the update, your previous configs may be broken due to the following error.

~# service httpd start
Starting httpd: httpd.itk: Syntax error on line 60 of /etc/httpd/conf/httpd.conf: 
Cannot load /etc/httpd/modules/ into server:
/etc/httpd/modules/ undefined symbol: ap_copy_scoreboard_worker


Read more ›

Posted in Devops, Webdevelopment

PHP-FPM environment variables are limited to 1024 chars

Here's something I didn't know: environment variables passed via PHP-FPM to PHP code, are hard-limited to 1024 characters. Not a very big problem per se, but if your environment variables pass the length of 1024 characters, you'll find yourself scratching your head why the PHP-FPM pool won't start. Read more ›

Posted in Devops, php

CVE-2014-0185: PHP-FPM sockets unavailable after updating PHP

Reference: CVE-2014-0185 Read more ›

Tagged with:
Posted in php, Security

OpenSSL: validate that certificate matches / signs the private key

You could probably just try to install your new certificate and private key, reload your webserver config, and see if it works. But that's not very convenient if you want to validate your private key and certificate beforehand.

So, how do you verify that a private key matches your certificate and that they're valid?

Calculate MD5 hash of private key

$ openssl rsa -noout -modulus -in /path/to/your/private.key  2> /dev/null | openssl md5
(stdin)= 3a5a1682678d243b6b8337360b55ff10

Calculate MD5 hash of certificate

$ openssl x509 -noout -modulus -in /path/to/your/certificate.crt 2> /dev/null | openssl md5
(stdin)= 3a5a1682678d243b6b8337360b55ff10

Check if they match

The MD5 hash from the private key and the certificate should be the exact same. If they're not, the private key can not be used together with the certificate and something in the CSR process has probably gone wrong. This can mean a wrong CSR was used, a wrong private key was stored, ... Up to you to find out. ;-)

Tagged with:
Posted in Security

Whois at the CLI: get all IP ranges from an AS number

Just a note to my future self, in case I ever need it again. All you need is the AS number.

$ whois -h -- '-i origin AS1234' | grep 'route:'

For instance, all Facebook's IP addresses in use.

$ whois -h -- '-i origin AS32934' | grep 'route:'

Or all their IPv6 ranges.

$ whois -h -- '-i origin AS32934' | grep 'route6:'
route6:     2620:0:1c00::/40
route6:     2a03:2880::/32

Very useful if you want to write scripts that use these IP ranges as filters. Think of scripts to quickly ban all Facebook traffic (you know, in case the Facebook content scrapers are performing a DoS on your site, for instance), check Google IP ranges vs. the User-Agent in your logs, ...

Tagged with:
Posted in Technology