Step by Step Guide on How To Install mod_pagespeed on Rackspace Cloud Server Running Ubuntu 13.10 plus Add On Tips to Configure Cloud Files. Basically for non-WordPress websites there is no advantage with Rackspace Cloud Server Performance Flavor (1 GB + 1 GB MySQL), with Redis Cache; page will load within 1-2 seconds. But, with the current development
of W3 Total Cache type of Plugins with Self Promotive Dashboard, probably it is better to rely on Apache2. Since reveal of PRISM and NSA Spyware activities, it is not very safe to install anything related to Google, still; with our setup ( read Full step by step guide to Install WordPress on Ubuntu 13.10 on Rackspace ) it is improbable to collect much data, yes; technically data collection is possible. It is a kind of trade about Privacy with W3 Total Cache and mod_pagespeed. Furthermore, we will suggest to use Firewall and close the ports and to use another Server for MySQL. That second server will have all ports closed except to connect for MySQL server. On your first server, you can stop MySQL server. PHPMyAdmin has replication function, you can use it. For now, for this guide; Full step by step guide to Install WordPress on Ubuntu 13.10 on Rackspace is the standard as we do not have 2 server setup guide published, yet.
How To Install mod_pagespeed on Rackspace Cloud Server : Things To Know
How To Install mod_pagespeed on Rackspace Cloud Server describes only the method to install mod_pagespeed and keep yourself secured from Google’s spyware activities. But, you have to read the individual tweak from here :
1 | https://developers.google.com/speed/pagespeed/module/using |
As we are using (and that is our recommended usage) one / two servers for one website; we will work on mod_pagespeed from /etc/apache2/mods-available/pagespeed.conf
.
---
The Add On Tips to Configure Cloud Files is that : there is a comment on the config file to mention the CDN url. You will use one Container’s URL after uploading everything to that CDN.
mod_pagespeed
itself can not do any magic on Rackspace Cloud Server, default configuration will fail to improve performance. We basically need to force to collapse white space, minify, push CSS, Js in the way the page loads faster. Sub standard server users will report default config to be great. Actually we enjoy HTTP caching at DNS level. So, hardly 0.5 seconds improvement can be expected with the default settings.
If things break, you can stop it, read here :
1 | https://developers.google.com/speed/pagespeed/module/experiment |
Actually you will understand the links after reading the paragraph below!
How To Install mod_pagespeed on Rackspace Cloud Server : Steps
We are using 64 bit system. This is the full copy paste from command line :
1 | root@my-server:~# wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_amd64.deb |
Response :
1 2 3 4 5 6 7 8 9 10 | --2014-04-08 08:33:12-- https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_amd64.deb Resolving dl-ssl.google.com (dl-ssl.google.com)... 2607:f8b0:400d:c04::5d, 74.125.29.93, 74.125.29.136, ... Connecting to dl-ssl.google.com (dl-ssl.google.com)|2607:f8b0:400d:c04::5d|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 5290788 (5.0M) [application/x-debian-package] Saving to: ˜mod-pagespeed-stable_current_amd64.deb™ 100%[======================================>] 5,290,788 4.54MB/s in 1.1s 2014-04-08 08:33:13 (4.54 MB/s) - ˜mod-pagespeed-stable_current_amd64.deb™ saved [5290788/5290788] |
Let us install :
1 | root@my-server:~# sudo dpkg -i mod-pagespeed-*.deb |
Output :
1 2 3 4 5 6 7 | Selecting previously unselected package mod-pagespeed-stable. (Reading database ... 117537 files and directories currently installed.) Unpacking mod-pagespeed-stable (from mod-pagespeed-stable_current_amd64.deb) ... Setting up mod-pagespeed-stable (1.7.30.4-r3847) ... Enabling module pagespeed. To activate the new configuration, you need to run: service apache2 restart |
Delete the executable :
1 2 3 4 5 | root@my-server:~# rm mod-pagespeed-*.deb Now restart Apache : <pre>root@my-server:~# service apache2 restart |
Output :
1 | * Restarting web server apache2 [ OK ] |
Go to mods-available directory :
1 | root@my-server:~# cd /etc/apache2/mods-available/ |
List your files and you’ll see the name of page speed :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | root@my-server:/etc/apache2/mods-available# ls access_compat.load dump_io.load proxy.conf actions.conf echo.load proxy_connect.load actions.load env.load proxy_express.load alias.conf expires.load proxy_fcgi.load alias.load ext_filter.load proxy_fdpass.load allowmethods.load fcgid.conf proxy_ftp.conf asis.load fcgid.load proxy_ftp.load auth_basic.load file_cache.load proxy_html.load auth_digest.load filter.load proxy_http.load auth_form.load headers.load proxy.load authn_anon.load heartbeat.load proxy_scgi.load authn_core.load heartmonitor.load proxy_wstunnel.load authn_dbd.load include.load ratelimit.load authn_dbm.load info.conf reflector.load authn_file.load info.load remoteip.load authn_socache.load lbmethod_bybusyness.load reqtimeout.conf authnz_ldap.load lbmethod_byrequests.load reqtimeout.load authz_core.load lbmethod_bytraffic.load request.load authz_dbd.load lbmethod_heartbeat.load rewrite.load authz_dbm.load ldap.conf sed.load authz_groupfile.load ldap.load session_cookie.load authz_host.load log_debug.load session_crypto.load authz_owner.load log_forensic.load session_dbd.load authz_user.load lua.load session.load autoindex.conf macro.load setenvif.conf autoindex.load mime.conf setenvif.load buffer.load mime.load slotmem_plain.load cache_disk.conf mime_magic.conf slotmem_shm.load cache_disk.load mime_magic.load socache_dbm.load cache.load mpm_event.conf socache_memcache.load cache_socache.load mpm_event.load socache_shmcb.load cgid.conf mpm_itk.conf speling.load cgid.load mpm_itk.load ssl.conf cgi.load mpm_prefork.conf ssl.load charset_lite.load mpm_prefork.load status.conf data.load mpm_worker.conf status.load dav_fs.conf mpm_worker.load substitute.load dav_fs.load negotiation.conf suexec.load dav.load negotiation.load unique_id.load dav_lock.load pagespeed.conf userdir.conf dbd.load pagespeed.load userdir.load deflate.conf php5.conf usertrack.load deflate.load php5.load vhost_alias.load dialup.load proxy_ajp.load xml2enc.load dir.conf proxy_balancer.conf dir. load proxy_balancer.load |
Now, we have to activate each desired mods or rather tweaks by editing the conf file :
1 | root@my-server:~# nano /etc/apache2/mods-available/pagespeed.conf |
We can not say which will be the right settings for you. But restart Apache each time you change something :
1 2 | root@my-server:~# service apache2 restart * Restarting web server apache2 [ OK ] |
Now the Permission Part. /var/cache/mod_pagespeed
is not of Apache in our setup. To make it Writable we will do these :
1 2 3 | root@my-server:~# sudo chown root:www-data /var/cache/mod_pagespeed -R root@my-server:~# sudo chmod g+w /var/cache/mod_pagespeed -R root@my-server:~# sudo chirp -R www-data /var/cache/mod_pagespeed |
Otherwise cache will not be writable. Restart Apache :
1 2 3 | root@my-server:~# service apache2 restart * Restarting web server apache2 [ OK ] root@my-server:~# |
As we have shown a kind of LIVE copy paste from command line we kept the root@my-server:~#
part. One must not include that part of command but what starts after the hash ( # ) sign. Obviously, this was a test server which runs 24×7 for our experiments.