首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在mod_pagespeed上安装CentOS (Apache模块)

在mod_pagespeed上安装CentOS (Apache模块)
EN

Server Fault用户
提问于 2011-11-24 12:57:33
回答 1查看 2.4K关注 0票数 0

我有一个CentOS (5.7Final)系统,我已经安装了Apache2.2.3。

我按照关于: mod_pagespeed的说明安装了http://code.google.com/speed/page-speed/download.html,并在安装时获得了以下信息:

代码语言:javascript
复制
# rpm -U mod-pagespeed-*.rpm
warning: mod-pagespeed-beta_current_x86_64.rpm: Header V4 DSA signature: NOKEY, key ID 7fac5991
[  OK  ] atd: [  OK  ]

它似乎确实安装得很好:

代码语言:javascript
复制
# apachectl -t -D DUMP_MODULES
Loaded Modules:
...
 pagespeed_module (shared)

并且我在/etc/httpd/con.d/pagspeed.conf中做了以下修改

添加:

代码语言:javascript
复制
ModPagespeedEnableFilters collapse_whitespace,elide_attributes
ModPagespeedEnableFilters combine_css,rewrite_css,move_css_to_head,inline_css
ModPagespeedEnableFilters rewrite_javascript,inline_javascript
ModPagespeedEnableFilters rewrite_images,insert_img_dimensions
ModPagespeedEnableFilters extend_cache
ModPagespeedEnableFilters remove_quotes,remove_comments

ModPagespeedEnableFilters add_instrumentation

在mod_pagespeed_statistics中注释掉下列行

代码语言:javascript
复制
<Location /mod_pagespeed_statistics>
    **# Order allow,deny**
    # 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 examine
    # statistics.  This might be appropriate in an experimental setup or
    # if the Apache server is protected by a reverse proxy that will
    # filter URLs in some fashion.
    **# Allow from localhost**
    **# Allow from 127.0.0.1**
    SetHandler mod_pagespeed_statistics
</Location>

作为一个单独的注意,我试图运行指定的系统测试谷歌的网站,但它提供了以下错误。我不喜欢更新服务器上的wget,因为我确信没有必要让实际模块正常工作。

代码语言:javascript
复制
./system_test.sh www.domain.com
You have the wrong version of wget. 1.12 is required.
EN

回答 1

Server Fault用户

回答已采纳

发布于 2011-12-21 02:13:20

我在一个mod_pagespeed系统上安装CentOS时遇到了一个问题,它只是在安装后拒绝工作。

事实证明,特定文件夹存在权限/所有权访问问题(S)。

在/var/www/中存在:

代码语言:javascript
复制
drwxr-xr-x  4 root      root   4096 Dec  8 12:02 mod_pagespeed
drwxr-xr-x  2 root      root   4096 Dec  8 12:03 mod_pagespeedcache

我将权限更改为:

代码语言:javascript
复制
drwxr-xr-x  4 apache    apache 4096 Dec  8 12:02 mod_pagespeed
drwxr-xr-x  4 apache    apache 4096 Dec 10 13:10 mod_pagespeedcache

日志显示:

代码语言:javascript
复制
...
[Sat Dec 10 13:08:43 2011] [error] [mod_pagespeed 0.10.19.4-1209 @30739] /var/www/mod_pagespeedcache/XAM3DOzfwmGm-DkPVUC7.outputlock:0: creating dir (code=13 Permission denied)
...

在那之后工作得很好。

票数 0
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/334469

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档