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 -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/ /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 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.

Leave a Reply

Your email address will not be published. Required fields are marked *