0

I am trying to install mod_pagespeed for my Apache2 server that I have serving up my Django application. I am using Webfaction as a hosting service, and am in the apache2 directory. I am trying to figure out how to install Apache2 modules as I haven't done a lot of server configuration in the past, but all the tutorials I'm seeing use sudo and I don't have root access to use sudo, and all the tutorials I'm reading have installations for Ubuntu and Fedora with extensions of .rpm, and .deb but all the modules in my apache2 modules directory have an extension of .so . Does this mean I have to use a different installation method ? What is the command to install mod_pagespeed in linux ?

TJB
  • 3,706
  • 9
  • 51
  • 102
  • What are the permissions on this directory where the Apache modules are located? Use ls -l to show them. If you don't have permission to write there or restart Apache you can't proceed. – roktechie Sep 15 '17 at 01:30
  • -rwxr-xr-x 1 doc4design doc4design 13621 Apr 1 2016. I know for sure I have permissions to restart Apache – TJB Sep 15 '17 at 01:31
  • Looks like you have permissions. What is the distribution of Linux? Do you want to compile this module from source or use a prebuilt binary package? Rpm is suitable for Red Hat and CentOS while deb is for Debian and Ubuntu. Those packages will contain the .so file. If you lack a binary, you'll need to source build. Let me know this info so I can provide an answer! – roktechie Sep 15 '17 at 01:35
  • I don't know if this helps, but heres some information about the distribution of Linux I'm using: ***Linux version 3.10.0-514.16.1.el7.x86_64 (builder@kbuilder.dev.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-11) (GCC) ) #1 SMP Wed Apr 12 15:04:24 UTC 2017*** – TJB Sep 15 '17 at 01:44
  • The default Webfaction apache has mod_pagespeed set up: https://blog.webfaction.com/2010/11/speed-up-your-pages-with-mod_pagespeed/ – will_in_wi Sep 15 '17 at 01:54
  • I don't see it in "webapps/django_2016/apache2/modules" – TJB Sep 15 '17 at 01:57

1 Answers1

1
wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_x86_64.rpm
rpm -U mod-pagespeed-*.rpm

Configure and restart Apache per your usual process. I'm assuming this system already has at installed. If you encounter permission errors during the rpm step, you'll need to extract the contents and install them manually. Edit: your copy of tar seems too old to understand rpm format. Use this command instead.

rpm2cpio mod-pagespeed-*.rpm | cpio -idmv

Then copy the .so file to the proper location and do a LoadModule declaration in your Apache config to load it upon restart.

Source: https://www.digitalocean.com/community/tutorials/how-to-get-started-with-mod_pagespeed-with-apache-on-a-centos-and-fedora-cloud-server

roktechie
  • 1,345
  • 1
  • 10
  • 15
  • Do I need to run this command from any specific directory, or does it not matter ? – TJB Sep 15 '17 at 01:53
  • I can see that there is a mod_pagespeed rpm files in my modules directory now, but when I try to extract the contents and install them manually, because I did face permissions issues, I get this error: **tar: This does not look like a tar archive tar: Skipping to next header tar: Exiting with failure status due to previous errors** – TJB Sep 15 '17 at 02:12
  • Delete any rpm files in your Apache modules directory, then type in cd and hit enter. You'll be in your home directory. Re-download the rpm file and try extracting there. Then use rpm2cpio mod-pagespeed-*.rpm | cpio -idmv to perform the extraction. Then move the files over to the Apache modules directory. – roktechie Sep 15 '17 at 02:40
  • Woot that works ! Thanks roktechie, I really have to brush up on my linux administration, and overall general linux knowledge. Now all I have to do is read how to configure my apache2 httpd file to load that page_speed module ^^ – TJB Sep 15 '17 at 03:01
  • Sorry, one last thing. I noticed that there is mod_pagespeed.so installed and mod_pagespeed_ap24.so as well. Do I need to move both modules over and load them both in my Apache2 httpd file ? I ask because after I loaded just mod_pagespeed.so into my Apache2 httpd file I get this error **"Cannot load modules/mod_pagespeed.so into server: /home/doc4design/webapps/django_2016/apache2/modules/mod_pagespeed.so: undefined symbol: unixd_config"** – TJB Sep 15 '17 at 03:16