Not Found Apache server with mod_pagespeed error

1,816 views
Skip to first unread message

iwek

unread,
Nov 18, 2011, 5:11:16 PM11/18/11
to mod-pagespeed-discuss
Hi,

I have seen this type of 404 error happening intermittently:

<html>
<head>
<title>Not Found</title>
</head>
<body>
<h1>Apache server with mod_pagespeed</h1>
OK
<hr>
NOT FOUND:http://mikewills.me/blog/links-for-2011-02-24/
wp-content/themes/richardshepherd-TwentyTenFive-a8f2860
/style.css.pagespeed.ce.pAcUzu9T3K.css
</body>
</html>

Can you give me any more information on what this means? Does it mean
it cannot find a file in cache or anything more specific?

Joshua Marantz

unread,
Nov 18, 2011, 5:31:13 PM11/18/11
to mod-pagesp...@googlegroups.com
I'm not sure where the "Apache server with mod_pagespeed" string comes from.

The URL reported as not-found is definitely generated by mod_pagespeed.  The first possibility that comes to mind is that you have a multi-server system and not every server has mod_pagespeed installed.  Is that a possibility?  In that case, mod_pagespeed might rewrite HTML and change references to URLs (e..g style.css) to a cache-extended version.  If the browser's ensuing request for  the CSS file winds up a on a different server than the HTML file, and that server does not have mod_pagespeed installed, then it won't be able to decode the resource name to find the CSS file.

Is that a possibility?
-Josh

iwek

unread,
Dec 21, 2011, 5:21:46 PM12/21/11
to mod-pagespeed-discuss
That is not it, I do not have a multi-server system. I am running
0.10.19.5 and this is only happening to me on https pages, I do have
this directive:

ModPagespeedMapOriginDomain http://www.domain.com https://www.domain.com

and my experience with https pages is that they usually need a couple
refreshes to finish optimizing the resources but sometimes a resource
will throw a 404 and when I open it up I get that special
mod_pagespeed 404 message. I do see it in the code here:

http://www.google.com/codesearch#kGe7pYmmq7E/trunk/src/net/instaweb/apache/instaweb_handler.cc&q=%22Apache%20server%20with%20mod_pagespeed%22%20package:http://modpagespeed%5C.googlecode%5C.com&l=95

Any other ideas?

Miguel Gómez

unread,
Aug 6, 2013, 11:53:49 AM8/6/13
to mod-pagesp...@googlegroups.com
+1 for this old thread... this is still happening with current mod_pagespeed installed in Apache server... there is random 404 errors when loading images and javascript files... very weird

Joshua Marantz

unread,
Aug 6, 2013, 12:12:52 PM8/6/13
to mod-pagespeed-discuss
What's your URL?
What version of mod_pagespeed?
How did you configure it?
Anything interesting showing up in your Apache error log?

-Josh



--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-di...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Callum Macdonald

unread,
Nov 29, 2013, 11:12:05 AM11/29/13
to mod-pagesp...@googlegroups.com
We're having similar issues. Through checking the logs, it turns out that some requests arriving on port 80 are incorrectly modified to port 443 by (I'm assuming) mod_rpaf which we're also running. This in turn means that mod_pagespeed fails to find the resources because it treats the url like it were https:// instead of http://. The appearance is intermittent 404s, but the apache error log shows requests with https:// when in fact the original request was http://.

I'm guessing it's related to mod_rpaf. I've tried disabling (but not uninstalling) mod_pagespeed and the problem continued. It only happens on our production server, not on our staging server, despite identical setups (mod_rpaf versions, mod_pagespeed versions, apache versions, config, etc...).

I'll try to post back when I find a solution.

Cheers - Callum.

Callum Macdonald

unread,
Dec 27, 2013, 11:51:00 AM12/27/13
to mod-pagesp...@googlegroups.com
Our issue turned out to be this https://github.com/gnif/mod_rpaf/issues/12

In a nutsheel, mod_rpaf can't properly rewrite the port. There is a workaround, which we're now using. I guess there's something in mod_pagespeed about requests on port 443 being served over HTTP causing an issue.

Cheers - Callum.

Miguel Gómez

unread,
Mar 6, 2014, 8:14:31 PM3/6/14
to mod-pagesp...@googlegroups.com
This issue seems to be already alive. I guess that i'm suffering this on my server. I've mod_rpaf installed and latest mod_pagespeed. So, there is no fix already for this? There are another alternatives to mod_rpaf that solves this issue??

Biomedicus

unread,
Sep 30, 2018, 3:48:16 PM9/30/18
to mod-pagespeed-discuss
hi my friend i am not sure if this is still alive  
my url  is https://www.biomedicus.gr   

this is the log error

X’’filename’’.jpg:0: Resource based on https://www.’mysite’.gr/wp-content/uploads/2018/09/’filename’.jpg but cannot access the original

[Sun Sep 30 15:07:40.907169 2018] [pagespeed:warn] [pid 9315:tid 140625047205632] [mod_pagespeed 1.13.35.2-0 @9315] [0930/150740:WARNING:resource_fetch.cc(195)] Fetch failed for resource url https://www.mysite.gr/wp-content/uploads/2018/09/’’filename’’.jpg.pagespeed.ic.Y281WFqmAM.webp

[Sun Sep 30 15:07:40.908504 2018] [pagespeed:warn] [pid 9315:tid 140625517197056] [mod_pagespeed 1.13.35.2-0 @9315] Fetch failed for https://www.’’mysite’.gr/wp-content/uploads/2018/09/x’filename’.jpg.pagespeed.ic.Y281WFqmAM.webp, status=404



it seems that the mod rewrites the images i upload but then cannot find them.  i am not sure  what the solution to this is? 

any help will be appreciated

To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsub...@googlegroups.com.

Joshua Marantz

unread,
Sep 30, 2018, 5:44:35 PM9/30/18
to mod-pagespeed-discuss
Hi -- it seems like you've been reporting the same in a number of different contexts. It probably makes sense to try something really simple.

If you make a simple test web page with a single image, does mod_pagespeed successfully rewrite that image's URL and serve it? If not, let's get that to work.  It might be worth reading the FAQ and also the https support doc pages.


To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-di...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-di...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mod-pagespeed-discuss/0c7b9e03-acfc-48d0-8e91-a99431bd9409%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Biomedicus

unread,
Sep 30, 2018, 6:44:36 PM9/30/18
to mod-pagespeed-discuss
it seems that no one can help us.. the images arent served correctly not sure why, after 2 days they disappear. i dont have the knowledge to debug it even if i read the faq file.  
the only option i read is to deactivate mod rewrite images but it affects the site speed i believe
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsub...@googlegroups.com.

Otto van der Schaaf

unread,
Oct 1, 2018, 4:29:50 AM10/1/18
to mod-pagesp...@googlegroups.com
It sounds like the module has trouble fetching its input resources (css / js / images). 
Reading up over at the pages Josh linked earlier should help.

To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-di...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-di...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-di...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mod-pagespeed-discuss/cd380bd7-3b9f-4f0b-b655-28e33306a5f3%40googlegroups.com.

Biomedicus

unread,
Oct 1, 2018, 5:55:30 AM10/1/18
to mod-pagespeed-discuss
i removed the rewrite_ image filter  but still some pictures are vanishing    

if you visit  in incognito  in the homepage  there is a photo down missing https://www.biomedicus.gr
does this filter removal from pagespeed affect the loading time ?
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsub...@googlegroups.com.

Biomedicus

unread,
Oct 1, 2018, 5:58:43 AM10/1/18
to mod-pagespeed-discuss
i also tried to put  RewriteCond %{REQUEST_URI} !pagespeed   in my .htaccess file but still no luck.   i have removed the rewrite_image filter but still getting some trouble
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsub...@googlegroups.com.

Longinos

unread,
Oct 1, 2018, 6:54:11 AM10/1/18
to mod-pagespeed-discuss
Hi Biomedicus

I find that you have some problem w/ cherry-framework. You had enabled the inline_css filter, when I disable it, all images se rewrited and loaded.
I have tried https://www.biomedicus.gr/?PageSpeedFilters=-inline_css,+rewrite_images. -inline_css to disable this filter and +rewrite_images to enable that because you don´t have enabled it.

Biomedicus

unread,
Oct 1, 2018, 7:12:49 AM10/1/18
to mod-pagespeed-discuss
thank you for your reply, so i go to pagespeed.conf  and you want me 
1. to disable the inline_css filter  in the pagespeed.conf
2. to enable to rewrite images filter in the pagespeed.conf

is that correct?? 

p.s. i disabled the rewrite image because it caused me too much trouble and i saw it as the only way out.  
i use smush plugin and fast velocity minify. can these cause any trouble? 

Biomedicus

unread,
Oct 1, 2018, 7:15:53 AM10/1/18
to mod-pagespeed-discuss





inline fast velocity plugin.JPG


i have these settings there too. do you want me to untick them?
inline fast velocity plugin.JPG

Longinos

unread,
Oct 1, 2018, 7:26:18 AM10/1/18
to mod-pagespeed-discuss


El lunes, 1 de octubre de 2018, 13:12:49 (UTC+2), Biomedicus escribió:
thank you for your reply, so i go to pagespeed.conf  and you want me 
1. to disable the inline_css filter  in the pagespeed.conf
2. to enable to rewrite images filter in the pagespeed.conf

is that correct?? 

Yes. I found that disabling inline_css filter the rewrite_image filter work. I think you don´t touch any other plugins/setting and try only these 2 things. When you have the site working w/ pagespeed module, you can try other config, like disabling the plugin and trying others pagespeed filters.

Biomedicus

unread,
Oct 1, 2018, 7:52:10 AM10/1/18
to mod-pagespeed-discuss
i applied your  suggestions longinos  not sure if it works or not because pic vanish after 2 days .  
right now seems to be running smoothly.   


nevertheless i own you big if it works. it had caused me a headache for days.  
send me your email at biomed...@gmail.com  . i want to say you something personal.  

Longinos

unread,
Oct 1, 2018, 8:09:18 AM10/1/18
to mod-pagespeed-discuss
As far I can see, no images are getting the 404 code error, and in chrome all are converted to webp format..... thus I think the pagespeed module is working.
You can send a private message through this page. In the rigth upper corner you have a Respond privately to the author option.

Message has been deleted

Joshua Marantz

unread,
Oct 1, 2018, 5:44:37 PM10/1/18
to mod-pagespeed-discuss
Hi -- I think you need to start simple and see if things are working, then add in the complexity of your site and environment. It will make debugging much easier.

Can you, temporarily, turn off the whatever other tool you have that's optimizing your site? Two reasons:
  • the functions that you showed in the screenshot of the settings dialog are all covered by PageSpeed as well.
  • multiple tools that alter your web page to make it faster may get into each other's way, even if each one works by itself. 
Also, as I suggested earlier, I'd start by writing a very simple web page with one image in it and make sure that works with mod_pagespeed. Then move on to complex functionality like uploading photos.

On Mon, Oct 1, 2018 at 5:06 PM Biomedicus <biomed...@gmail.com> wrote:

hi again, unfortunately all the photos from my home page vanished, they give 404 , the only thing i did is to publish a post. 

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-di...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mod-pagespeed-discuss/14799840-5ef5-499e-877b-0b4985965d57%40googlegroups.com.

Biomedicus

unread,
Oct 1, 2018, 5:51:02 PM10/1/18
to mod-pagesp...@googlegroups.com
Hi again my friend  

i search the whole pagespeed.conf  and i found this code  ModPagespeedImagePreserveURLs on     
i made it on and everything appeared again. 
i am not sure for how long.  do you think this can help?


For more options, visit https://groups.google.com/d/optout.


--
Με Εκτίμηση,

Biomedicus
2118008585
6981114915

Biomedicus

unread,
Oct 1, 2018, 5:52:14 PM10/1/18
to mod-pagesp...@googlegroups.com
or it was a lucky shot for a while?

Joshua Marantz

unread,
Oct 1, 2018, 5:55:55 PM10/1/18
to mod-pagespeed-discuss
That is likely to be easier to integrate for you, yes. It will not optimize as much.  More generally, see 


By using the option you found, you limit the ability of PageSpeed to optimize images for the size at which they will be displayed, but it will still optimize them and even transcode them to webp. So it's probably a good compromise given that you have a lot of complicated things going on on your site, in particular other optimization engines.


Biomedicus

unread,
Oct 1, 2018, 6:06:03 PM10/1/18
to mod-pagesp...@googlegroups.com
i am so tired with this thing, every 10 hours everything disappears... 
1. you said before to post one picture to see if its rewritten correctly . how do i check if something is rewritten correctly?

2. do you think i loose too much with this new  preserve url??

3. can  i now enable the inline_css . does it help somewhere?


For more options, visit https://groups.google.com/d/optout.

Longinos

unread,
Oct 2, 2018, 3:28:40 AM10/2/18
to mod-pagespeed-discuss

Hi Biomedicus.
Can you try to disable the Performance Score Booster plugin v1.9.2.1?
Can you attach here the whole pagepeed conf you use?

Biomedicus

unread,
Oct 2, 2018, 6:13:34 AM10/2/18
to mod-pagesp...@googlegroups.com
goodmorning, 

i disable and deleted the plugin you told me.  last night i was playing around with some filters and i took out the inline_image. worked for a while and then boom again 

the gmetrix gives this error 

There are 9 requests that are 404 Not Found



here is the  pagespeed.conf 
# Attempt to load mod_version if it wasn't loaded or compiled in (eg on Debian)
<IfModule !mod_version.c>
  LoadModule version_module /opt/bitnami/apache2/modules/mod_version.so
</IfModule>

<IfVersion < 2.4>
  LoadModule pagespeed_module /opt/bitnami/apache2/modules/mod_pagespeed.so
</IfVersion>
<IfVersion >= 2.4.2>
  # As default pagespeed.conf configuration uses old-style ACLs using
  # 'allow' and 'deny', we load mod_access_compat in Apache 2.4. If that's a
  # problem, the blocks using that can be converted to the newer 'Require'
  # syntax.
  <IfModule !access_compat_module>
    LoadModule access_compat_module /opt/bitnami/apache2/modules/mod_access_compat.so
  </IfModule>

  LoadModule pagespeed_module /opt/bitnami/apache2/modules/mod_pagespeed_ap24.so
</IfVersion>

# Only attempt to load mod_deflate if it hasn't been loaded already.
<IfModule !mod_deflate.c>
 LoadModule deflate_module /opt/bitnami/apache2/modules/mod_deflate.so
</IfModule>
<IfModule pagespeed_module>
    # Turn on mod_pagespeed. To completely disable mod_pagespeed, you
    # can set this to "off".
ModPagespeed on
ModPagespeedLazyloadImagesAfterOnload off

    # Direct Apache to send all HTML output to the mod_pagespeed
    # output handler.
    AddOutputFilterByType MOD_PAGESPEED_OUTPUT_FILTER text/html

    # If you want mod_pagespeed process XHTML as well, please uncomment this
    # line.
    # AddOutputFilterByType MOD_PAGESPEED_OUTPUT_FILTER application/xhtml+xml

    # The ModPagespeedFileCachePath directory must exist and be writable
    # by the apache user (as specified by the User directive).
    ModPagespeedFileCachePath            "/opt/bitnami/apache2/var/cache/mod_pagespeed/"

    # LogDir is needed to store various logs, including the statistics log
    # required for the console.
    ModPagespeedLogDir "/opt/bitnami/apache2/logs/pagespeed_log"

    # The locations of SSL Certificates is distribution-dependent.
    ModPagespeedSslCertDirectory "/opt/bitnami/common/openssl/certs"
    

    # If you want, you can use one or more memcached servers as the store for
    # the mod_pagespeed cache.
    # ModPagespeedMemcachedServers localhost:11211

    # A portion of the cache can be kept in memory only, to reduce load on disk
    # (or memcached) from many small files.
    # ModPagespeedCreateSharedMemoryMetadataCache "/opt/bitnami/apache2/var/cache/mod_pagespeed/" 51200

    # Override the mod_pagespeed 'rewrite level'. The default level
    # "CoreFilters" uses a set of rewrite filters that are generally
    # safe for most web pages. Most sites should not need to change
    # this value and can instead fine-tune the configuration using the
    # ModPagespeedDisableFilters and ModPagespeedEnableFilters
    # directives, below. Valid values for ModPagespeedRewriteLevel are
    # PassThrough, CoreFilters and TestingCoreFilters.
    #
    # ModPagespeedRewriteLevel PassThrough

    # Explicitly disables specific filters. This is useful in
    # conjuction with ModPagespeedRewriteLevel. For instance, if one
    # of the filters in the CoreFilters needs to be disabled for a
    # site, that filter can be added to
    # ModPagespeedDisableFilters. This directive contains a
    # comma-separated list of filter names, and can be repeated.
    #
    #ModPagespeedDisableFilters rewrite_images
ModPagespeedDisableFilters inline_images

    # Explicitly enables specific filters. This is useful in
    # conjuction with ModPagespeedRewriteLevel. For instance, filters
    # not included in the CoreFilters may be enabled using this
    # directive. This directive contains a comma-separated list of
    # filter names, and can be repeated.
    #

#ModPagespeedEnableFilters inline_images,combine_css,combine_javascript,rewrite_javascript,rewrite_css,inline_css

ModPagespeedEnableFilters combine_css,combine_javascript,rewrite_javascript,rewrite_css,inline_css

    # ModPagespeedEnableFilters collapse_whitespace,elide_attributes

    # Explicitly forbids the enabling of specific filters using either query
    # parameters or request headers. This is useful, for example, when we do
    # not want the filter to run for performance or security reasons. This
    # directive contains a comma-separated list of filter names, and can be
    # repeated.
    #
    #ModPagespeedForbidFilters rewrite_images
    #ModPagespeedForbidFilters inline_css

    # How long mod_pagespeed will wait to return an optimized resource
    # (per flush window) on first request before giving up and returning the
    # original (unoptimized) resource. After this deadline is exceeded the
    # original resource is returned and the optimization is pushed to the
    # background to be completed for future requests. Increasing this value will
    # increase page latency, but might reduce load time (for instance on a
    # bandwidth-constrained link where it's worth waiting for image
    # compression to complete). If the value is less than or equal to zero
    # mod_pagespeed will wait indefinitely for the rewrite to complete before
    # returning.
    #
    # ModPagespeedRewriteDeadlinePerFlushMs 10

    # ModPagespeedDomain
    # authorizes rewriting of JS, CSS, and Image files found in this
    # domain. By default only resources with the same origin as the
    # HTML file are rewritten. For example:
    #
    #   ModPagespeedDomain cdn.myhost.com
    #
    # This will allow resources found on http://cdn.myhost.com to be
    # rewritten in addition to those in the same domain as the HTML.
    #
    # Other domain-related directives (like ModPagespeedMapRewriteDomain
    # and ModPagespeedMapOriginDomain) can also authorize domains.
    #
    # Wildcards (* and ?) are allowed in the domain specification. Be
    # careful when using them as if you rewrite domains that do not
    # send you traffic, then the site receiving the traffic will not
    # know how to serve the rewritten content.

    # If you use downstream caches such as varnish or proxy_cache for caching
    # HTML, you can configure pagespeed to work with these caches correctly
    # using the following directives. Note that the values for
    # ModPagespeedDownstreamCachePurgeLocationPrefix and
    # ModPagespeedDownstreamCacheRebeaconingKey are deliberately left empty here
    # in order to force the webmaster to choose appropriate value for these.
    #
    # ModPagespeedDownstreamCachePurgeLocationPrefix
    # ModPagespeedDownstreamCachePurgeMethod PURGE
    # ModPagespeedDownstreamCacheRewrittenPercentageThreshold 95
    # ModPagespeedDownstreamCacheRebeaconingKey

    # Other defaults (cache sizes and thresholds):
    #
    # ModPagespeedFileCacheSizeKb          102400
    # ModPagespeedFileCacheCleanIntervalMs 3600000
    # ModPagespeedLRUCacheKbPerProcess     1024
    # ModPagespeedLRUCacheByteLimit        16384
    # ModPagespeedCssFlattenMaxBytes       102400
    # ModPagespeedCssInlineMaxBytes        2048
    # ModPagespeedCssImageInlineMaxBytes   0
    # ModPagespeedImageInlineMaxBytes      3072
    # ModPagespeedJsInlineMaxBytes         2048
    # ModPagespeedCssOutlineMinBytes       3000
    # ModPagespeedJsOutlineMinBytes        3000
    # ModPagespeedMaxCombinedCssBytes      -1
    # ModPagespeedMaxCombinedJsBytes       92160

    # Limit the number of inodes in the file cache. Set to 0 for no limit.
    # The default value if this paramater is not specified is 0 (no limit).
    ModPagespeedFileCacheInodeLimit        500000

    # Bound the number of images that can be rewritten at any one time; this
    # avoids overloading the CPU.  Set this to -1 to remove the bound.
    #
    # ModPagespeedImageMaxRewritesAtOnce      8

    # You can also customize the number of threads per Apache process
    # mod_pagespeed will use to do resource optimization. Plain
    # "rewrite threads" are used to do short, latency-sensitive work,
    # while "expensive rewrite threads" are used for actual optimization
    # work that's more computationally expensive. If you live these unset,
    # or use values <= 0 the defaults will be used, which is 1 for both
    # values when using non-threaded MPMs (e.g. prefork) and 4 for both
    # on threaded MPMs (e.g. worker and event). These settings can only
    # be changed globally, and not per virtual host.
    #
    # ModPagespeedNumRewriteThreads 4
    # ModPagespeedNumExpensiveRewriteThreads 4

    # Randomly drop rewrites (*) to increase the chance of optimizing
    # frequently fetched resources and decrease the chance of optimizing
    # infrequently fetched resources. This can reduce CPU load. The default
    # value of this parameter is 0 (no drops).  90 means that a resourced
    # fetched once has a 10% probability of being optimized while a resource
    # that is fetched 50 times has a 99.65% probability of being optimized.
    #
    # (*) Currently only CSS files and images are randomly dropped.  Images
    # within CSS files are not randomly dropped.
    #
    # ModPagespeedRewriteRandomDropPercentage 90

    # Many filters modify the URLs of resources in HTML files. This is typically
    # harmless but pages whose Javascript expects to read or modify the original
    # URLs may break. The following parameters prevent filters from modifying
    # URLs of their respective types.
    #
    # ModPagespeedJsPreserveURLs on
    
    # ModPagespeedImagePreserveURLs on
    # ModPagespeedImagePreserveURLs on
    # ModPagespeedCssPreserveURLs on

    # When PreserveURLs is on, it is still possible to enable browser-specific
    # optimizations (for example, webp images can be served to browsers that
    # will accept them).  They'll be served with Vary: Accept or Vary:
    # User-Agent headers as appropriate.  Note that this may require configuring
    # reverse proxy caches such as varnish to handle these headers properly.
    #
    # ModPagespeedEnableFilters in_place_optimize_for_browser

    # Internet Explorer has difficulty caching resources with Vary: headers.
    # They will either be uncached (older IE) or require revalidation.  See:
    # As a result we serve them as Cache-Control: private instead by default.
    # If you are using a reverse proxy or CDN configured to cache content with
    # the Vary: Accept header you should turn this setting off.
    #
    # ModPagespeedPrivateNotVaryForIE on

    # Settings for image optimization:
    #
    # Lossy image recompression quality (0 to 100, -1 just strips metadata):
    # ModPagespeedImageRecompressionQuality 85
    #
    # Jpeg recompression quality (0 to 100, -1 uses ImageRecompressionQuality):
    # ModPagespeedJpegRecompressionQuality -1
    # ModPagespeedJpegRecompressionQualityForSmallScreens 70
    #
    # WebP recompression quality (0 to 100, -1 uses ImageRecompressionQuality):
    # ModPagespeedWebpRecompressionQuality 80
    # ModPagespeedWebpRecompressionQualityForSmallScreens 70
    #
    # Timeout for conversions to WebP format, in
    # milliseconds. Negative values mean no timeout is applied. The
    # default value is -1:
    # ModPagespeedWebpTimeoutMs 10000
    #
    # Percent of original image size below which optimized images are retained:
    # ModPagespeedImageLimitOptimizedPercent 100
    #
    # Percent of original image area below which image resizing will be
    # attempted:
    # ModPagespeedImageLimitResizeAreaPercent 100

    # Settings for inline preview images
    #
    # Setting this to n restricts preview images to the first n images found on
    # the page.  The default of -1 means preview images can appear anywhere on
    # the page (if those images appear above the fold).
    # ModPagespeedMaxInlinedPreviewImagesIndex -1

    # Sets the minimum size in bytes of any image for which a low quality image
    # is generated.
    # ModPagespeedMinImageSizeLowResolutionBytes 3072

    # The maximum URL size is generally limited to about 2k characters
    # Apache servers by default impose a further limitation of about
    # 250 characters per URL segment (text between slashes).
    # mod_pagespeed circumvents this limitation, but if you employ
    # proxy servers in your path you may need to re-impose it by
    # overriding the setting here.  The default setting is 1024
    # characters.
    #
    # ModPagespeedMaxSegmentLength 250

    # Uncomment this if you want to prevent mod_pagespeed from combining files
    # (e.g. CSS files) across paths
    #
    # ModPagespeedCombineAcrossPaths off

    # Renaming JavaScript URLs can sometimes break them.  With this
    # option enabled, mod_pagespeed uses a simple heuristic to decide
    # not to rename JavaScript that it thinks is introspective.
    #
    # You can uncomment this to let mod_pagespeed rename all JS files.
    #
    # ModPagespeedAvoidRenamingIntrospectiveJavascript off

    # Certain common JavaScript libraries are available from Google, which acts
    # as a CDN and allows you to benefit from browser caching if a new visitor
    # to your site previously visited another site that makes use of the same
    # libraries as you do.  Enable the following filter to turn on this feature.
    #
    # ModPagespeedEnableFilters canonicalize_javascript_libraries

    # The following line configures a library that is recognized by
    # canonicalize_javascript_libraries.  This will have no effect unless you
    # enable this filter (generally by uncommenting the last line in the
    # previous stanza).  The format is:
    #    ModPagespeedLibrary bytes md5 canonical_url
    # Where bytes and md5 are with respect to the *minified* JS; use
    # js_minify --print_size_and_hash to obtain this data.
    # Note that we can register multiple hashes for the same canonical url;
    # we do this if there are versions available that have already been minified
    # with more sophisticated tools.
    #
    # Additional library configuration can be found in
    # pagespeed_libraries.conf included in the distribution.  You should add
    # new entries here, though, so that file can be automatically upgraded.
    # ModPagespeedLibrary 43 1o978_K0_LNE5_ystNklf http://www.modpagespeed.com/rewrite_javascript.js

    # Explicitly tell mod_pagespeed to load some resources from disk.
    # This will speed up load time and update frequency.
    #
    # This should only be used for static resources which do not need
    # specific headers set or other processing by Apache.
    #
    # Both URL and filesystem path should specify directories and
    # filesystem path must be absolute (for now).
    #
    # ModPagespeedLoadFromFile "http://example.com/static/" "/var/www/static/"


    # Enables server-side instrumentation and statistics.  If this rewriter is
    # enabled, then each rewritten HTML page will have instrumentation javacript
    # added that sends latency beacons to /mod_pagespeed_beacon.  These
    # statistics can be accessed at /mod_pagespeed_statistics.  You must also
    # enable the mod_pagespeed_statistics and mod_pagespeed_beacon handlers
    # below.
    #
    # ModPagespeedEnableFilters add_instrumentation

    # The add_instrumentation filter sends a beacon after the page onload
    # handler is called. The user might navigate to a new URL before this. If
    # you enable the following directive, the beacon is sent as part of an
    # onbeforeunload handler, for pages where navigation happens before the
    # onload event.
    #
    # ModPagespeedReportUnloadTime on

    # Uncomment the following line so that ModPagespeed will not cache or
    # rewrite resources with Vary: in the header, e.g. Vary: User-Agent.
    # Note that ModPagespeed always respects Vary: headers on html content.
    # ModPagespeedRespectVary on

    # Uncomment the following line if you want to disable statistics entirely.
    #
    # ModPagespeedStatistics off

    # These handlers are central entry-points into the admin pages.
    # By default, pagespeed_admin and pagespeed_global_admin present
    # the same data, and differ only when
    # ModPagespeedUsePerVHostStatistics is enabled.  In that case,
    # /pagespeed_global_admin sees aggregated data across all vhosts,
    # and the /pagespeed_admin sees data only for a particular vhost.
    #
    # You may insert other "Allow from" lines to add hosts you want to
    # allow to look at generated statistics.  Another possibility is
    # to comment out the "Order" and "Allow" options from the config
    # file, to allow any client that can reach your server to access
    # and change server state, such as statistics, caches, and
    # messages.  This might be appropriate in an experimental setup.
    <Location /pagespeed_admin>
        Order allow,deny
        Allow from localhost
        Allow from 127.0.0.1
        SetHandler pagespeed_admin
    </Location>
    <Location /pagespeed_global_admin>
        Order allow,deny
        Allow from localhost
        Allow from 127.0.0.1
        SetHandler pagespeed_global_admin
    </Location>

    # Enable logging of mod_pagespeed statistics, needed for the console.
    ModPagespeedStatisticsLogging on

    # Page /mod_pagespeed_message lets you view the latest messages from
    # mod_pagespeed, regardless of log-level in your httpd.conf
    # ModPagespeedMessageBufferSize is the maximum number of bytes you would
    # like to dump to your /mod_pagespeed_message page at one time,
    # its default value is 100k bytes.
    # Set it to 0 if you want to disable this feature.
    ModPagespeedMessageBufferSize 100000
</IfModule>


--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-di...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Joshua Marantz

unread,
Oct 2, 2018, 8:00:29 AM10/2/18
to mod-pagespeed-discuss
Hi -- it sounds like there may be a problem fetching resources over HTTPS in your setup. Making sure you've configured HTTPS fetching properly is the next step.  Can you look over https://www.modpagespeed.com/doc/https_support and make sure that's working?

By 'check that it's working' I mean that a page that contains one image appears correctly in the browser, and has its HTML (use browser's View->Source command) has the rewritten image URL with ".pagespeed." in the name, and that it gets served without a 404. I'd check that in your browser with (e.g.) Chrome developer Tools.

I'd also look in the apache error.log to see if PageSpeed is complaining about anything when viewing that page.


However, I think it also makes sense for you to try OptimizeForBandwidth and see how it goes. That may meet your needs without you having to poke around the system as I've suggested.

-Josh

Longinos

unread,
Oct 2, 2018, 9:19:41 AM10/2/18
to mod-pagespeed-discuss
Hi Biomedicus
Near this line:

    # The locations of SSL Certificates is distribution-dependent.
    ModPagespeedSslCertDirectory "/opt/bitnami/common/openssl/certs"
    
Add this:
   ModPagespeedFetchHttps enable
ModPagespeedSslCertFile file
ModPagespeedDomain http*://*.biomedicus.gr

where file is a cert.pem usually in /opt/bitnami/common/openssl/certs

This is needed by pagespeed to fecht resources in https.
You can use this too:

ModPagespeedLoadFromFile "https://www.biomedicus.gr" "/var/www/example/"
ModPagespeedLoadFromFileRuleMatch Disallow *
ModPagespeedLoadFromFileRuleMatch allow \.(js|css|jpg|jpeg|png|pdf|gif)(\?.*)?$

This can load static files from disc w/o fecht it by https.
/var/www/example must be your root directory and js,css,...etc must be the file extension you will load directly from disc.


   

Joshua Marantz

unread,
Oct 2, 2018, 9:25:33 AM10/2/18
to mod-pagespeed-discuss
Thanks Longinos. Biomedicus, I agree that looks like the right next step. PageSpeed will be much more effective if it can pull your resources, and HTTPS fetching needs to be configured as Longinos describes in order to work.



--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-di...@googlegroups.com.

Biomedicus

unread,
Oct 2, 2018, 10:20:26 AM10/2/18
to mod-pagespeed-discuss
hi josh and longinos 

i think somewhere here is the solution.   i read that pagespeed server by default from http  


i followed some hours ago the faq document and  put   this in pagespeed 

ModPagespeedMapOriginDomain "http://localhost" "https://www.example.com"
the photos appeared again but dont know for how long that is why i am not celebrating anything.   
should i put in pagespeed.conf also what longinos is proposing?




Τη Τρίτη, 2 Οκτωβρίου 2018 - 4:25:33 μ.μ. UTC+3, ο χρήστης jmarantz έγραψε:
Thanks Longinos. Biomedicus, I agree that looks like the right next step. PageSpeed will be much more effective if it can pull your resources, and HTTPS fetching needs to be configured as Longinos describes in order to work.



On Tue, Oct 2, 2018 at 9:19 AM Longinos <longinos.int...@gmail.com> wrote:
Hi Biomedicus
Near this line:

    # The locations of SSL Certificates is distribution-dependent.
    ModPagespeedSslCertDirectory "/opt/bitnami/common/openssl/certs"
    
Add this:
   ModPagespeedFetchHttps enable
ModPagespeedSslCertFile file
ModPagespeedDomain http*://*.biomedicus.gr

where file is a cert.pem usually in /opt/bitnami/common/openssl/certs

This is needed by pagespeed to fecht resources in https.
You can use this too:

ModPagespeedLoadFromFile "https://www.biomedicus.gr" "/var/www/example/"
ModPagespeedLoadFromFileRuleMatch Disallow *
ModPagespeedLoadFromFileRuleMatch allow \.(js|css|jpg|jpeg|png|pdf|gif)(\?.*)?$

This can load static files from disc w/o fecht it by https.
/var/www/example must be your root directory and js,css,...etc must be the file extension you will load directly from disc.


   

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsub...@googlegroups.com.

Longinos

unread,
Oct 2, 2018, 11:37:05 AM10/2/18
to mod-pagespeed-discuss
Hi
This
ModPagespeedMapOriginDomain "http://localhost" "https://www.example.com"

can be set if you have a web server in http://localhost and need to respond as https://www.example.com.

And, yes, you need to complete, all most, the https config, as far as your config is incomplete.
Pagespeed on default work on http so you need to configure it for https. Think in the certificate file and directory same as a browser, if don´t have certificates
configured on browser cannot reach https sites.
And you need to authorize the https domain, because if not, pagespeed only fecht http resources.

The LoadFromFile is to bypass https fecht on static resources like js,css or image files. If the disc system has a good response time is better than fechting
resources via https request.

Biomedicus

unread,
Oct 2, 2018, 11:40:28 AM10/2/18
to mod-pagesp...@googlegroups.com
hi longinos , 

do you want me to apply the other suggestion as well? 
that means do you want me to apply 

Near this line:

    # The locations of SSL Certificates is distribution-dependent.
    ModPagespeedSslCertDirectory "/opt/bitnami/common/openssl/certs"
    
Add this:
   ModPagespeedFetchHttps enable
ModPagespeedSslCertFile file
ModPagespeedDomain http*://*.biomedicus.gr

where file is a cert.pem usually in /opt/bitnami/common/openssl/certs  ????


i have only added  the ModPagespeedMapOriginDomain "http://localhost" "https://www.example.com"  but the load time is slightly slow, but the photos are still here. we need this to confirm tomorrow

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-di...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mod-pagespeed-discuss/01a5051e-ebca-4edf-a219-b79cd1621e9f%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Longinos

unread,
Oct 2, 2018, 11:56:15 AM10/2/18
to mod-pagespeed-discuss
Yes, I suggest you to do that. Your https config is not complete.
You need enable the https fecht => ModPagespeedFetchHttps enable
You need a vertificate file => ModPagespeedSslCertFile file. You had configured a path, but not a file name.
You need authorize the https domain, pagespeed by default only auth the http domain => ModPagespeedDomain http*://*.biomedicus.gr
In this form you have auth the http,https and all subdomains in both protocols.
All these directives are a must have, is a complete config.

With the LoadFromFile part, well is animprovement that you can use or not, but if you have a fast disk is better.
.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsub...@googlegroups.com.

Biomedicus

unread,
Oct 2, 2018, 12:34:57 PM10/2/18
to mod-pagespeed-discuss
hi longinos , 

i insteted in pagespeed.conf 

ModPagespeedFetchHttps enable
ModPagespeedSslCertFile
/opt/bitnami/common/openssl/certs
ModPagespeedDomain http*://*.biomedicus.gr

 


i changed the language of the site and it broke again ,  then i entered all the above and it showed the photos again , not sure for how long this time.  


2.  how can i use loadfromfile??   the code in faqs is like this 

ModPagespeedLoadFromFile "https://www.example.com" "/var/www/example/static/";
so i change it to this and enter in pagespeed.conf ???
ModPagespeedLoadFromFile "https://www.biomedicus.gr" "/var/www/biomedicus/static/";  
??

Biomedicus

unread,
Oct 2, 2018, 12:49:41 PM10/2/18
to mod-pagespeed-discuss
hi longinos 

i used your code for loadfromfile 

ModPagespeedLoadFromFile "https://www.biomedicus.gr" "/opt/bitnami/apps/wordpress/htdocs/"

ModPagespeedLoadFromFileRuleMatch  Disallow *
ModPagespeedLoadFromFileRuleMatch allow  \.(js|css|jpg|jpeg|png|pdf|gif)(\?.*)?$

but i get a syntax error from apache  

third_party/re2/src/re2/re2.cc:194: Error parsing '*': no argument for repetition operator: *
AH00526: Syntax error on line 325 of /opt/bitnami/apache2/conf/pagespeed.conf:
no argument for repetition operator: *
apache config test fails, aborting
/opt/bitnami/php/scripts/ctl.sh : php-fpm stopped
/opt/bitnami/mysql/scripts/ctl.sh : mysql stopped
/opt/bitnami/mysql/scripts/ctl.sh : mysql  started at port 3306
/opt/bitnami/php/scripts/ctl.sh : php-fpm started
third_party/re2/src/re2/re2.cc:194: Error parsing '*': no argument for repetition operator: *
AH00526: Syntax error on line 325 of /opt/bitnami/apache2/conf/pagespeed.conf:
no argument for repetition operator: *
apache config test fails, aborting

Biomedicus

unread,
Oct 2, 2018, 1:39:05 PM10/2/18
to mod-pagespeed-discuss
could that Disallow need a dot like Disallow .* ?

Longinos

unread,
Oct 2, 2018, 1:47:04 PM10/2/18
to mod-pagespeed-discuss
Sorry
The syntax is:

ModPagespeedLoadFromFileRuleMatch disallow .*

I firgot the dot.
Reply all
Reply to author
Forward
0 new messages