CentOS에 mod_pagespeed(Apache 모듈) 설치

CentOS에 mod_pagespeed(Apache 모듈) 설치

이미 Apache(2.2.3)가 설치된 CentOS(5.7 최종) 시스템이 있습니다.

다음 지침에 따라 mod_pagespeed를 설치했습니다.http://code.google.com/speed/page-speed/download.html설치하는 동안 다음을 얻었습니다.

# rpm -U mod-pagespeed-*.rpm
warning: mod-pagespeed-beta_current_x86_64.rpm: Header V4 DSA signature: NOKEY, key ID 7fac5991
[  OK  ] atd: [  OK  ]

제대로 설치된 것 같습니다.

# apachectl -t -D DUMP_MODULES
Loaded Modules:
...
 pagespeed_module (shared)

그리고 /etc/httpd/conf.d/pagespeed.conf에서 다음과 같이 변경했습니다.

추가됨:

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에서 다음 줄을 주석 처리했습니다.

<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이 필요하지 않다고 확신하기 때문에 내 서버에서 wget을 업데이트하는 것을 반대합니다.

./system_test.sh www.domain.com
You have the wrong version of wget. 1.12 is required.

답변1

CentOS 시스템에 mod_pagespeed를 설치할 때 설치 후 작동이 거부되는 문제가 발생했습니다.

특정 폴더에 대한 권한/소유권 액세스 문제가 있는 것으로 나타났습니다.

/var/www/에는 다음이 존재합니다.

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

권한을 다음으로 변경했습니다.

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

로그는 다음과 같습니다.

...
[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)
...

그 후에는 잘 작동했습니다.

관련 정보