我在Centas 7上通过Cpanel服务器上的Apache编译了pagespeed 1.11.33.4-0。
编译并创建rpm后,我已经安装了rpm模块并创建了dir / var / mod_pagespeed / cache /并获得了apache的权限。
如果test localhost工作正常,几乎如果尝试使用curl验证
curl -I localhost
HTTP/1.1 200 OK
Date: Thu, 27 Apr 2017 06:14:45 GMT
Server: Apache
Accept-Ranges: bytes
X-Mod-Pagespeed: 1.11.33.4-0
Vary: Accept-Encoding
Cache-Control: max-age=0, no-cache
Content-Length: 111
Connection: close
Content-Type: text/html
如果尝试任何虚拟主机不起作用。
curl -I tamainut.com
HTTP/1.1 301 Moved Permanently
Date: Thu, 27 Apr 2017 06:12:51 GMT
Server: Apache
Location: https://tamainut.com/
Cache-Control: max-age=0, public
Expires: Thu, 27 Apr 2017 06:12:51 GMT
Vary: User-Agent
P3P: policyref="/w3c/p3p.xml", CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"
Connection: close
Content-Type: text/html; charset=UTF-8
在Apache2 httpd.conf
上Include /etc/apache2/conf.modules.d/*
在/etc/apache2/conf.modules.d/456_pagespeed.conf
<IfModule !mod_version.c>
LoadModule version_module modules/mod_version.so
</IfModule>
<IfVersion < 2.4>
LoadModule pagespeed_module modules/mod_pagespeed.so
</IfVersion>
<IfVersion >= 2.4.2>
LoadModule pagespeed_module modules/mod_pagespeed_ap24.so
</IfVersion>
<IfModule pagespeed_module>
ModPagespeed on
ModPagespeedInheritVHostConfig on
AddOutputFilterByType MOD_PAGESPEED_OUTPUT_FILTER text/html
ModPagespeedFileCachePath "/var/mod_pagespeed/cache/"
<Location /mod_pagespeed_beacon>
SetHandler mod_pagespeed_beacon
</Location>
<Location /mod_pagespeed_statistics>
Order allow,deny
Allow from localhost
SetHandler mod_pagespeed_statistics
</Location>
</IfModule>
我不明白我能纠正这个问题,在日志上我什么都看不到。