nginx开启pagespeed和sdpy

nginx 1.4.0已经增加了sdpy协议的支持。所以只需要简单的编译即可。另外这段时间炒的很热的google pagespeed模块也出了一个beta版本。pagespeed编译后实在是比之前大了太多,表示有点难以接受。
1.编译安装新版的openssl,因为debian stable带的openssl版本太老不支持NPN
wget http://www.openssl.org/source/openssl-1.0.1e.tar.gz && tar zxvf openssl-1.0.1e.tar.gz
cd openssl-1.0.1e && ./Configure –prefix=/opt/openssl
再修改一下Makefile:INSTALL_PREFIX=/opt/openssl
make && make install
1.下载好nginx
[bash]
wget http://nginx.org/download/nginx-1.4.0.tar.gz && tar zxvf nginx-1.4.0.tar.gz
[/bash]
2.下载pagespeed包
[bash]
wget https://github.com/pagespeed/ngx_pagespeed/archive/release-1.5.27.2-beta.zip && unzip release-1.5.27.2-beta.zip
cd ngx_pagespeed-release-1.5.27.2-beta/
wget https://dl.google.com/dl/page-speed/psol/1.5.27.2.tar.gz && tar -xzvf 1.5.27.2.tar.gz
[/bash]
3.编译nginx
[bash]
./configure –prefix=/usr/share/nginx1.4 –conf-path=/etc/nginx/nginx.conf –error-log-path=/var/log/nginx/error.log –http-client-body-temp-path=/var/lib/nginx/body –http-fastcgi-temp-path=/var/lib/nginx/fastcgi –http-log-path=/var/log/nginx/access.log –http-proxy-temp-path=/var/lib/nginx/proxy –http-scgi-temp-path=/var/lib/nginx/scgi –http-uwsgi-temp-path=/var/lib/nginx/uwsgi –lock-path=/var/lock/nginx.lock –pid-path=/var/run/nginx.pid –with-pcre-jit –with-debug –with-file-aio –with-http_addition_module –with-http_dav_module –with-http_gzip_static_module –with-http_secure_link_module –with-http_stub_status_module –with-http_ssl_module –with-http_sub_module –with-http_xslt_module –with-ipv6 –with-openssl=/opt/openssl/usr/local/ssl/ –add-module=/root/soft/ngx_pagespeed-release-1.5.27.2-beta –with-http_spdy_module
需要注意得修改一下objs/Makefile里的东西,把.openssl都删除掉
[/bash]

4.配置nginx
主要是参考
http://nginx.org/en/docs/http/ngx_http_spdy_module.html 配置spdy
https://github.com/pagespeed/ngx_pagespeed 配置pagespeed

====
编译了pagespeed模块的nginx会接近100M,表示不可接受我就把这个模块去掉了。。只单独编译了一个支持sdpy模块的nginx。

此条目发表在nginx分类目录。将固定链接加入收藏夹。

发表评论