Category Archives: apache

Gentoo apache 2.4 and Google’s mod_pagespeed

Here’s how you can get mod_pagespeed on your gentoo box running apache 2.4

emerge rpm
mkdir ~/src
wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_x86_64.rpm -O ~/src/mod-pagespeed-stable_current_x86_64.rpm  
cd ~/src
cpio ~/src/mod-pagespeed-stable_current_x86_64.rpm | cpio -idmv
cp ~/src/usr/lib64/httpd/modules/mod_pagespeed_ap24.so /usr/lib64/apache2/modules/
cp ~/src/etc/httpd/conf.d/pagespeed.conf /etc/apache2/modules.d/80_mod_pagespeed.conf
cp ~/src/etc/httpd/conf.d/pagespeed_libraries.conf /etc/apache2/modules.d/
mkdir /var/cache/mod_pagespeed/ -p
chown -R apache:apache /var/cache/mod_pagespeed/
# You'll need to have mod_version installed or you'll have to manually set the LoadModule to use the 24.so one.
# You'll also have to replace /usr/lib64/httpd with /usr/lib64/apache2
sed -i 's/\/usr\/lib64\/httpd/\/usr\/lib64\/apache2/' /etc/apache2/modules.d/80_mod_pagespeed.conf 
# Replace the Order and Allow lines with 'Require all granted'
/etc/init.d/apache2 restart

Many thanks go to tantruminv.comfor providing the initial info.