Mod_SPDY with Ubuntu 14.04 x64 and Apache 2.4

Since MOD_SPDY was packaged (deb/rpm) up to Apache 2.2, you’ll have to compile from source in order to enable it in Apache 2.4.X.

After several tries, this gentleman here nailed it:

$ cd /tmp
$ sudo apt-get -y install git g++ libapr1-dev libaprutil1-dev curl patch binutils make devscripts
$ git clone https://github.com/eousphoros/mod-spdy.git
$ cd mod-spdy/src
$ ./build_modssl_with_npn.sh
$ chmod +x ./build/gyp_chromium
$ make BUILDTYPE=Release
$ service apache2 stop
$ cd /usr/lib/apache2/modules
$ mv mod_ssl.so mod_ssl.so.bak
$ cd /tmp/mod-spdy/src
$ sudo cp mod_ssl.so /usr/lib/apache2/modules
$ service apache2 start
$ sudo a2enmod ssl
$ service apache2 restart
$ sudo cp out/Release/libmod_spdy.so /usr/lib/apache2/modules/mod_spdy.so
$ echo "LoadModule spdy_module /usr/lib/apache2/modules/mod_spdy.so" | sudo tee /etc/apache2/mods-available/spdy.load
$ echo "SpdyEnabled on" | sudo tee /etc/apache2/mods-available/spdy.conf
$ sudo a2enmod spdy
$ service apache2 restart

PS: don’t use mod_php with SPDY!


Michael writes

Also, I needed to install libpcre3 and libpcre3-dev to get past the “Configuring Apache mod_ssl” in the ./build_modssl_with_npn.sh script (pcre-config for libpcre was not found).

You feedback is continuously appreciated.

Advertisements

MariaDB installation problem in Ubuntu 14.04 LTS x64

If you ever get strucked by

/var/lib/dpkg/info/mysql-server-5.5.postinst: line 236: logger: command not found
dpkg: error processing package mysql-server-5.5 (--configure):

while trying to install MariaDB 5.5 on Ubuntu 14.04 x64, here’s the solution:

  1. aptitude reinstall bsdutils OR apt-get –reinstall install bsdutils

2. locale-gen en_US en_US.UTF-8 && dpkg-reconfigure locales

PHP search array in array

Sometimes PHP can be such an old fart. Ever wanted to search for $haystack in an $array which is an array in another array without writing more than one line of code?

One liner for a simple $array – classic:

$bool = in_array($anything, $array);

One liner for multidimensional array for PHP >= 5.5.0

$array = array_search($anything, array_column($array, 'column_key'));

One liner for multidimensional array for PHP < 5.5.0: https://github.com/ramsey/array_column

You’ll have to use Composer, good luck! :-)