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/mod_status.so into server:
/etc/httpd/modules/mod_status.so: undefined symbol: ap_copy_scoreboard_worker
Read more ›
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 ›
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
Calculate MD5 hash of certificate
$ openssl x509 -noout -modulus -in /path/to/your/certificate.crt 2> /dev/null | openssl md5
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: openssl
Posted in Security
Just a note to my future self, in case I ever need it again. All you need is the AS number.
$ whois -h whois.radb.net -- '-i origin AS1234' | grep 'route:'
For instance, all Facebook's IP addresses in use.
$ whois -h whois.radb.net -- '-i origin AS32934' | grep 'route:'
Or all their IPv6 ranges.
$ whois -h whois.radb.net -- '-i origin AS32934' | grep 'route6:'
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: whois
Posted in Technology