Mod_pagespeed works with ip but not domain

Keywords: LAMP/MAMP/WAMP - AWS - Technical issue - Plugins installation/configuration

bnsupport ID: f790eee9-1b58-1798-ffcd-4b4c200aa5fe

bndiagnostic output:

? Apache: Found possible issues
? Resources: Found possible issues

bndiagnostic failure reason: The tool could not find any issue

I am trying to enable mod_pagespeed, but the files are only being cached when visiting the site by ip. When visiting the site by the actual domain no files are cached.
I believe it is related to SSL but I have tried every possible path for “ModPagespeedSslCertDirectory” in the pagespeed.conf.

I have my letsencrypt SSL´s located in:

Any help would be appreciated.

Hello @steve_san,

Could you please take a look at this previous case:

I hope it helps

Hi David, thank you for your reply.

Yes i have read that thread, but he had another problem with cached files showing “http” instead of “https”. My problem is that files are not being cached at all on https.

I tested a little bit more after i wrote this thread and I turned of https for the domain temporarily and then “pagespeed_mod” worked, it also worked when i turned on https again until i flushed the cache. Then it didnt generate new files until switching off https again.

I have an older bitnami instance running as well where the Pagespeed SSL directory is pointed to a folder with a ca-bundle-file. On that server the pagespeed works. On the newer instances it is not clear which is the right ssl-folder and bundle file.

Hello @steve_san,

Looking at your instance’s config, it seems you have your certificates at opt/bitnami/apps/letsencrypt instead of /opt/bitnami/letsencrypt/. I’m not sure why this is, are you using an old version of our bncert-tool or have you copied the files from your old instance? Regardless of why, the issue should be coming from the symlink used to make a copy of the SSL files pointing to the wrong path:

ls -la /opt/bitnami/apache/conf

lrwxrwxrwx  1 root    root        54 Jan  3 00:32 -> /opt/bitnami/letsencrypt/certificates/
lrwxrwxrwx  1 root    root        54 Jan  3 00:32 -> /opt/bitnami/letsencrypt/certificates/

To solve this, you just need to remove the current symlink and create a new one using the correct path:

cd /opt/bitnami/apache/conf
ln -sf /opt/bitnami/letsencrypt/apps/certificates/
ln -sf /opt/bitnami/letsencrypt/apps/certificates/
sudo /opt/bitnami/ restart apache

Also, going by PageSpeed documentation, HTTPS fetching is enabled by default and no other config is necessary. If the issue persists you can try removing from the config file both the ModPagespeedDomain and ModPagespeedMapOriginDomain options?

Francisco de Paz

Hi Fdepaz, thank you for your reply.

The folder:
/opt/bitnami/letsencrypt/apps/certificates/ does not exist on my server.
The certificates are in the " /opt/bitnami/letsencrypt/" and was generated with the bncert-tool.

ModPagespeedDomain and ModPagespeedMapOriginDomain were disabled by default, I tried to enable them temporarily to solve the problem, but had no success and disabled them again.

Correct, there is a typo in @fdepaz commands and your certificates are in the correct place.

cd /opt/bitnami/apache/conf
ln -sf /opt/bitnami/letsencrypt/certificates/
ln -sf /opt/bitnami/letsencrypt/certificates/
sudo /opt/bitnami/ restart apache

How are you testing that? I just accessed your site and it’s correctly using https. However, I can’t review the Pagespeed response because it’s disabled

#Include conf/pagespeed.conf
#Include conf/pagespeed_libraries.conf

Hi Jota, thank you for getting back to me.

The pagespeed is on in /opt/bitnami/apache2/conf. It might have been off when creating the support id. But it has been on since then.

Im getting alot of errors in my error log, saying:

[mod_pagespeed @548] PageSpeed Serf fetch failure rate extremely high; only 17 of 55

Hi @steve_san

There are 2 reasons why you can get those errors:

  • The first one is the lack of available RAM memory in the instance which seems not to be your case
  • The second one is the incompatibilities with your application. There may be scenarios in which Pagespeed doesn’t work well with the resources of the app and it’s better to disable it.

Hi Jota, thank you for your reply.

Yes, but the thing is that everything is working fine on http, it just doesnt work under https, even though its a default Letsencrypt SSL created with config tool.

Hi @steve_san,

Please take a look at the Pagespeed’s documentation to know more about how to use Pagespeed and HTTPS

You can also ask the Pagespeed developers to know how to configure it.


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.