$ # check http://nginx.org/en/download.html for the latest version
$ wget http://nginx.org/download/nginx-1.4.0.tar.gz
$ tar -xvzf nginx-1.4.0.tar.gz
$ cd nginx-1.4.0/
$./configure --add-module=$HOME/ngx_pagespeed-alpha-r2748 \--user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-ipv6
$ make
$mv /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.old
$ cp -r objs/nginx /usr/local/nginx/sbin/nginx
$ kill -USR2 `cat /usr/local/nginx/logs/nginx.pid`
$ kill -QUIT `cat /usr/local/nginx/logs/nginx.pid.oldbin`
$ /usr/local/nginx/sbin/nginx -t
$ /etc/init.d/nginx restart
$ /usr/local/nginx/sbin/nginx -v
修改nginx配置
nginx.conf
在http{}添加
# PageSpeed
pagespeed on;
# let's speed up PageSpeed by storing it in the super duper fast memcached
pagespeed MemcachedThreads 20;
pagespeed MemcachedServers "localhost:11211";
# needs to exist and be writable by nginx
pagespeed FileCachePath /var/ngx_pagespeed_cache;