我在 centOS 上为 httpd 安装了 pagespeed 模块,终于让它与 http 一起工作了,但我仍然无法让它指导 ssl,我添加了 ssl 证书目录路径和 .pem 路径,据我所知,其他一切都写对了。我包括了 ModPagespeed 3 次,其中两次是在 pagespeed.conf 文件中,一次是在顶部,另一次是在稍下方。然后是在 vhost.conf 的顶部。
真正的设置是在vhost.conf文件中设置的,这是错误的吗?
我有一台托管几个网站的服务器,HTTP 网站可以运行,但不能运行 HTTPS 网站。
看一看:
ModPagespeed on
# Attempt to load mod_version if it wasn't loaded or compiled in (eg on Debian)
<IfModule !mod_version.c>
LoadModule version_module /usr/lib64/httpd/modules/mod_version.so
</IfModule>
<IfVersion < 2.4>
LoadModule pagespeed_module /usr/lib64/httpd/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 /usr/lib64/httpd/modules/mod_access_compat.$
</IfModule>
LoadModule pagespeed_module /usr/lib64/httpd/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 /usr/lib64/httpd/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
ModPagespeed on
ModPagespeedInheritVHostConfig on
ModPagespeedFileCachePath "/var/cache/mod_pagespeed/"
# Image Filters
ModPagespeedEnableFilters rewrite_images,insert_image_dimensions,inline_images,$
# CSS Filters
ModPagespeedEnableFilters rewrite_css,move_css_above_scripts,combine_css,inline$
# JS Filters
ModPagespeedEnableFilters rewrite_javascript,canonicalize_javascript_libraries,$
# Misc Filters
ModPagespeedEnableFilters collapse_whitespace,trim_urls,remove_quotes,insert_dn$
# Direct Apache to send all HTML output to the mod_pagespeed
# output handler.
AddOutputFilterByType MOD_PAGESPEED_OUTPUT_FILTER text/html
ModPagespeedPreserveUrlRelativity on
ModPagespeedFetchHttps enable
ModPagespeedSslCertDirectory /etc/pki/tls/certs
ModPagespeedSslCertFile /etc/pki/tls/cert.pem
<VirtualHost *:80>
ServerName default:80
ServerAdmin [email protected]
DocumentRoot /var/www/html
</VirtualHost>
ModPagespeedMapOriginDomain "http://myleisure.com.au" "https://www.myleisure.co$
<VirtualHost *:80>
ServerName myleisure.com.au
ServerAlias myleisure.com.au
DocumentRoot /var/www/html/myleisure.com.au
Redirect permanent / https