Advertisement
Guest User

Untitled

a guest
Feb 14th, 2014
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Attempt to load mod_version if it wasn't loaded or compiled in (eg on Debian)
  2. <IfModule !mod_version.c>
  3.   LoadModule version_module /usr/lib64/httpd/modules/mod_version.so
  4. </IfModule>
  5.  
  6. <IfVersion < 2.4>
  7.   LoadModule pagespeed_module /usr/lib64/httpd/modules/mod_pagespeed.so
  8. </IfVersion>
  9. <IfVersion >= 2.4.2>
  10.   LoadModule pagespeed_module /usr/lib64/httpd/modules/mod_pagespeed_ap24.so
  11. </IfVersion>
  12.  
  13. # Only attempt to load mod_deflate if it hasn't been loaded already.
  14. <IfModule !mod_deflate.c>
  15.  LoadModule deflate_module /usr/lib64/httpd/modules/mod_deflate.so
  16. </IfModule>
  17. <IfModule pagespeed_module>
  18.     # Turn on mod_pagespeed. To completely disable mod_pagespeed, you
  19.     # can set this to "off".
  20.     ModPagespeed on
  21.    
  22.     ModPagespeedMapOriginDomain http://localhost //server.example.com
  23.  
  24.     # We want VHosts to inherit global configuration.
  25.     # If this is not included, they'll be independent (except for inherently
  26.     # global options), at least for backwards compatibility.
  27.     ModPagespeedInheritVHostConfig on
  28.  
  29.     # Direct Apache to send all HTML output to the mod_pagespeed
  30.     # output handler.
  31.     AddOutputFilterByType MOD_PAGESPEED_OUTPUT_FILTER text/html
  32.  
  33.     # If you want mod_pagespeed process XHTML as well, please uncomment this
  34.     # line.
  35.     # AddOutputFilterByType MOD_PAGESPEED_OUTPUT_FILTER application/xhtml+xml
  36.  
  37.     # The ModPagespeedFileCachePath directory must exist and be writable
  38.     # by the apache user (as specified by the User directive).
  39.     ModPagespeedFileCachePath            "/var/cache/mod_pagespeed/"
  40.  
  41.     # LogDir is needed to store various logs, including the statistics log
  42.     # required for the console.
  43.     ModPagespeedLogDir "/var/log/pagespeed"
  44.  
  45.     # If you want, you can use one or more memcached servers as the store for
  46.     # the mod_pagespeed cache.
  47.     # ModPagespeedMemcachedServers localhost:11211
  48.  
  49.     # A portion of the cache can be kept in memory only, to reduce load on disk
  50.     # (or memcached) from many small files.
  51.     # ModPagespeedCreateSharedMemoryMetadataCache "/var/cache/mod_pagespeed/" 51200
  52.  
  53.     # Override the mod_pagespeed 'rewrite level'. The default level
  54.     # "CoreFilters" uses a set of rewrite filters that are generally
  55.     # safe for most web pages. Most sites should not need to change
  56.     # this value and can instead fine-tune the configuration using the
  57.     # ModPagespeedDisableFilters and ModPagespeedEnableFilters
  58.     # directives, below. Valid values for ModPagespeedRewriteLevel are
  59.     # PassThrough, CoreFilters and TestingCoreFilters.
  60.     #
  61.     # ModPagespeedRewriteLevel PassThrough
  62.    
  63.     ModPagespeedRewriteLevel CoreFilters
  64.  
  65.     # Explicitly disables specific filters. This is useful in
  66.     # conjuction with ModPagespeedRewriteLevel. For instance, if one
  67.     # of the filters in the CoreFilters needs to be disabled for a
  68.     # site, that filter can be added to
  69.     # ModPagespeedDisableFilters. This directive contains a
  70.     # comma-separated list of filter names, and can be repeated.
  71.     #
  72.     # ModPagespeedDisableFilters rewrite_images
  73.  
  74.     # Explicitly enables specific filters. This is useful in
  75.     # conjuction with ModPagespeedRewriteLevel. For instance, filters
  76.     # not included in the CoreFilters may be enabled using this
  77.     # directive. This directive contains a comma-separated list of
  78.     # filter names, and can be repeated.
  79.     #
  80.     # ModPagespeedEnableFilters rewrite_javascript,rewrite_css
  81.     # ModPagespeedEnableFilters collapse_whitespace,elide_attributes
  82.    
  83.     ModPagespeedEnableFilters collapse_whitespace
  84.    
  85.     # Explicitly forbids the enabling of specific filters using either query
  86.     # parameters or request headers. This is useful, for example, when we do
  87.     # not want the filter to run for performance or security reasons. This
  88.     # directive contains a comma-separated list of filter names, and can be
  89.     # repeated.
  90.     #
  91.     # ModPagespeedForbidFilters rewrite_images
  92.  
  93.     # How long mod_pagespeed will wait to return an optimized resource
  94.     # (per flush window) on first request before giving up and returning the
  95.     # original (unoptimized) resource. After this deadline is exceeded the
  96.     # original resource is returned and the optimization is pushed to the
  97.     # background to be completed for future requests. Increasing this value will
  98.     # increase page latency, but might reduce load time (for instance on a
  99.     # bandwidth-constrained link where it's worth waiting for image
  100.     # compression to complete). If the value is less than or equal to zero
  101.     # mod_pagespeed will wait indefinitely for the rewrite to complete before
  102.     # returning.
  103.     #
  104.     # ModPagespeedRewriteDeadlinePerFlushMs 10
  105.  
  106.     # ModPagespeedDomain
  107.     # authorizes rewriting of JS, CSS, and Image files found in this
  108.     # domain. By default only resources with the same origin as the
  109.     # HTML file are rewritten. For example:
  110.     #
  111.     #   ModPagespeedDomain cdn.myhost.com
  112.     #
  113.     # This will allow resources found on http://cdn.myhost.com to be
  114.     # rewritten in addition to those in the same domain as the HTML.
  115.     #
  116.     # Wildcards (* and ?) are allowed in the domain specification. Be
  117.     # careful when using them as if you rewrite domains that do not
  118.     # send you traffic, then the site receiving the traffic will not
  119.     # know how to serve the rewritten content.
  120.  
  121.     # Other defaults (cache sizes and thresholds):
  122.     #
  123.     # ModPagespeedFileCacheSizeKb          102400
  124.     # ModPagespeedFileCacheCleanIntervalMs 3600000
  125.     # ModPagespeedLRUCacheKbPerProcess     1024
  126.     # ModPagespeedLRUCacheByteLimit        16384
  127.     # ModPagespeedCssFlattenMaxBytes       2048
  128.     # ModPagespeedCssInlineMaxBytes        2048
  129.     # ModPagespeedCssImageInlineMaxBytes   0
  130.     # ModPagespeedImageInlineMaxBytes      3072
  131.     # ModPagespeedJsInlineMaxBytes         2048
  132.     # ModPagespeedCssOutlineMinBytes       3000
  133.     # ModPagespeedJsOutlineMinBytes        3000
  134.  
  135.     # Limit the number of inodes in the file cache. Set to 0 for no limit.
  136.     # The default value if this paramater is not specified is 0 (no limit).
  137.     ModPagespeedFileCacheInodeLimit        500000
  138.  
  139.     # Bound the number of images that can be rewritten at any one time; this
  140.     # avoids overloading the CPU.  Set this to 0 to remove the bound.
  141.     #
  142.     # ModPagespeedImageMaxRewritesAtOnce      8
  143.  
  144.     # You can also customize the number of threads per Apache process
  145.     # mod_pagespeed will use to do resource optimization. Plain
  146.     # "rewrite threads" are used to do short, latency-sensitive work,
  147.     # while "expensive rewrite threads" are used for actual optimization
  148.     # work that's more computationally expensive. If you live these unset,
  149.     # or use values <= 0 the defaults will be used, which is 1 for both
  150.     # values when using non-threaded MPMs (e.g. prefork) and 4 for both
  151.     # on threaded MPMs (e.g. worker and event). These settings can only
  152.     # be changed globally, and not per virtual host.
  153.     #
  154.     # ModPagespeedNumRewriteThreads 4
  155.     # ModPagespeedNumExpensiveRewriteThreads 4
  156.  
  157.     # Randomly drop rewrites (*) to increase the chance of optimizing
  158.     # frequently fetched resources and decrease the chance of optimizing
  159.     # infrequently fetched resources. This can reduce CPU load. The default
  160.     # value of this parameter is 0 (no drops).  90 means that a resourced
  161.     # fetched once has a 10% probability of being optimized while a resource
  162.     # that is fetched 50 times has a 99.65% probability of being optimized.
  163.     #
  164.     # (*) Currently only CSS files and images are randomly dropped.  Images
  165.     # within CSS files are not randomly dropped.
  166.     #
  167.     # ModPagespeedRewriteRandomDropPercentage 90
  168.  
  169.     # Many filters modify the URLs of resources in HTML files. This is typically
  170.     # harmless but pages whose Javascript expects to read or modify the original
  171.     # URLs may break. The following parameters prevent filters from modifying
  172.     # URLs of their respective types.
  173.     #
  174.     # ModPagespeedJsPreserveURLs on
  175.     # ModPagespeedImagePreserveURLs on
  176.     # ModPagespeedCssPreserveURLs on
  177.  
  178.     # Settings for image optimization:
  179.     #
  180.     # Lossy image recompression quality (0 to 100, -1 just strips metadata):
  181.     # ModPagespeedImageRecompressionQuality 85
  182.     #
  183.     # Jpeg recompression quality (0 to 100, -1 uses ImageRecompressionQuality):
  184.     # ModPagespeedJpegRecompressionQuality -1
  185.     # ModPagespeedJpegRecompressionQualityForSmallScreens 70
  186.     #
  187.     # WebP recompression quality (0 to 100, -1 uses ImageRecompressionQuality):
  188.     # ModPagespeedImageWebpRecompressionQuality 80
  189.     # ModPagespeedImageWebpRecompressionQualityForSmallScreens 70
  190.     #
  191.     # Timeout for conversions to WebP format, in
  192.     # milliseconds. Negative values mean no timeout is applied. The
  193.     # default value is -1:
  194.     # ModPagespeedImageWebpTimeoutMs 5000
  195.     #
  196.     # Percent of original image size below which optimized images are retained:
  197.     # ModPagespeedImageLimitOptimizedPercent 100
  198.     #
  199.     # Percent of original image area below which image resizing will be
  200.     # attempted:
  201.     # ModPagespeedImageLimitResizeAreaPercent 100
  202.  
  203.     # Settings for inline preview images
  204.     #
  205.     # Setting this to n restricts preview images to the first n images found on
  206.     # the page.  The default of -1 means preview images can appear anywhere on
  207.     # the page (if those images appear above the fold).
  208.     # ModPagespeedMaxInlinedPreviewImagesIndex -1
  209.  
  210.     # Sets the minimum size in bytes of any image for which a low quality image
  211.     # is generated.
  212.     # ModPagespeedMinImageSizeLowResolutionBytes 3072
  213.  
  214.     # The maximum URL size is generally limited to about 2k characters
  215.     # due to IE: See http://support.microsoft.com/kb/208427/EN-US.
  216.     # Apache servers by default impose a further limitation of about
  217.     # 250 characters per URL segment (text between slashes).
  218.     # mod_pagespeed circumvents this limitation, but if you employ
  219.     # proxy servers in your path you may need to re-impose it by
  220.     # overriding the setting here.  The default setting is 1024
  221.     # characters.
  222.     #
  223.     # ModPagespeedMaxSegmentLength 250
  224.  
  225.     # Uncomment this if you want to prevent mod_pagespeed from combining files
  226.     # (e.g. CSS files) across paths
  227.     #
  228.     # ModPagespeedCombineAcrossPaths off
  229.  
  230.     # Renaming JavaScript URLs can sometimes break them.  With this
  231.     # option enabled, mod_pagespeed uses a simple heuristic to decide
  232.     # not to rename JavaScript that it thinks is introspective.
  233.     #
  234.     # You can uncomment this to let mod_pagespeed rename all JS files.
  235.     #
  236.     # ModPagespeedAvoidRenamingIntrospectiveJavascript off
  237.  
  238.     # Certain common JavaScript libraries are available from Google, which acts
  239.     # as a CDN and allows you to benefit from browser caching if a new visitor
  240.     # to your site previously visited another site that makes use of the same
  241.     # libraries as you do.  Enable the following filter to turn on this feature.
  242.     #
  243.     # ModPagespeedEnableFilters canonicalize_javascript_libraries
  244.  
  245.     # The following line configures a library that is recognized by
  246.     # canonicalize_javascript_libraries.  This will have no effect unless you
  247.     # enable this filter (generally by uncommenting the last line in the
  248.     # previous stanza).  The format is:
  249.     #    ModPagespeedLibrary bytes md5 canonical_url
  250.     # Where bytes and md5 are with respect to the *minified* JS; use
  251.     # js_minify --print_size_and_hash to obtain this data.
  252.     # Note that we can register multiple hashes for the same canonical url;
  253.     # we do this if there are versions available that have already been minified
  254.     # with more sophisticated tools.
  255.     #
  256.     # Additional library configuration can be found in
  257.     # pagespeed_libraries.conf included in the distribution.  You should add
  258.     # new entries here, though, so that file can be automatically upgraded.
  259.     # ModPagespeedLibrary 43 1o978_K0_LNE5_ystNklf http://www.modpagespeed.com/rewrite_javascript.js
  260.  
  261.     # Explicitly tell mod_pagespeed to load some resources from disk.
  262.     # This will speed up load time and update frequency.
  263.     #
  264.     # This should only be used for static resources which do not need
  265.     # specific headers set or other processing by Apache.
  266.     #
  267.     # Both URL and filesystem path should specify directories and
  268.     # filesystem path must be absolute (for now).
  269.     #
  270.     # ModPagespeedLoadFromFile "http://example.com/static/" "/var/www/static/"
  271.  
  272.  
  273.     # Enables server-side instrumentation and statistics.  If this rewriter is
  274.     # enabled, then each rewritten HTML page will have instrumentation javacript
  275.     # added that sends latency beacons to /mod_pagespeed_beacon.  These
  276.     # statistics can be accessed at /mod_pagespeed_statistics.  You must also
  277.     # enable the mod_pagespeed_statistics and mod_pagespeed_beacon handlers
  278.     # below.
  279.     #
  280.     # ModPagespeedEnableFilters add_instrumentation
  281.  
  282.     # The add_instrumentation filter sends a beacon after the page onload
  283.     # handler is called. The user might navigate to a new URL before this. If
  284.     # you enable the following directive, the beacon is sent as part of an
  285.     # onbeforeunload handler, for pages where navigation happens before the
  286.     # onload event.
  287.     #
  288.     # ModPagespeedReportUnloadTime on
  289.  
  290.     # Uncomment the following line so that ModPagespeed will not cache or
  291.     # rewrite resources with Vary: in the header, e.g. Vary: User-Agent.
  292.     # Note that ModPagespeed always respects Vary: headers on html content.
  293.     # ModPagespeedRespectVary on
  294.  
  295.     # Uncomment the following line if you want to disable statistics entirely.
  296.     #
  297.     # ModPagespeedStatistics off
  298.    
  299.     ModPagespeedFetchHttps enable,allow_self_signed
  300.  
  301.     # This page lets you view statistics about the mod_pagespeed module.
  302.     <Location /mod_pagespeed_statistics>
  303.         Order allow,deny
  304.         # You may insert other "Allow from" lines to add hosts you want to
  305.         # allow to look at generated statistics.  Another possibility is
  306.         # to comment out the "Order" and "Allow" options from the config
  307.         # file, to allow any client that can reach your server to examine
  308.         # statistics.  This might be appropriate in an experimental setup or
  309.         # if the Apache server is protected by a reverse proxy that will
  310.         # filter URLs in some fashion.
  311.         Allow from localhost
  312.         Allow from 127.0.0.1
  313.         SetHandler mod_pagespeed_statistics
  314.     </Location>
  315.  
  316.     # Enable logging of mod_pagespeed statistics, needed for the console.
  317.     ModPagespeedStatisticsLogging on
  318.  
  319.     <Location /pagespeed_console>
  320.         Order allow,deny
  321.         Allow from localhost
  322.         Allow from 127.0.0.1
  323.         SetHandler pagespeed_console
  324.     </Location>
  325.  
  326.     # Page /mod_pagespeed_message lets you view the latest messages from
  327.     # mod_pagespeed, regardless of log-level in your httpd.conf
  328.     # ModPagespeedMessageBufferSize is the maximum number of bytes you would
  329.     # like to dump to your /mod_pagespeed_message page at one time,
  330.     # its default value is 100k bytes.
  331.     # Set it to 0 if you want to disable this feature.
  332.     ModPagespeedMessageBufferSize 100000
  333.  
  334.     <Location /mod_pagespeed_message>
  335.         Order allow,deny
  336.         Allow from localhost
  337.         Allow from 127.0.0.1
  338.         SetHandler mod_pagespeed_message
  339.     </Location>
  340. </IfModule>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement