Apache搭建的SPDY服务器(Linux Mint + Apache2.2搭建SSL/HTTPS/SPDY服务器 http://www.linuxidc.com/Linux/2014-03/98122.htm)很不爽,因为Apache只能用2.2版本,SPDY也只支持到3,不支持3.1。所以用Nginx好些。
用以下脚本安装:
wget http://nginx.org/download/nginx-1.5.11.tar.gz
tar jxvf nginx-1.5.11.tar.gz
wget http://zlib.net/zlib-1.2.8.tar.gz
tar jxvf zlib-1.2.8.tar.gz
cd nginx-1.5.11
./configure --with-http_ssl_module --with-zlib=../zlib-1.2.8 --with-http_spdy_module
sudo make install
然后打开/usr/local/nginx/conf/nginx.conf
搜索HTTPS server,把下面的行全部取消注释,并为listen参数加上spdy,SSL证书可以填Apache的,或者自己创建。为了让Wireshark能截包,ssl_ciphers可以改成RSA。
# HTTPS server
#
server {
listen 443 ssl spdy;
server_name localhost;
ssl_certificate /etc/ssl/certs/ssl-cert-snakeoil.pem;
ssl_certificate_key /etc/ssl/private/ssl-cert-snakeoil.key;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;
#ssl_ciphers HIGH:!aNULL:!MD5;
ssl_ciphers RSA;
ssl_prefer_server_ciphers on;
location / {
root /home/liuhx/xtp/writable/www;
index index.html index.htm;
}
}
启动:
sudo /usr/local/nginx/sbin/nginx
参考:
http://nginx.org/en/docs/http/ngx_http_spdy_module.html
http://nginx.org/en/docs/configure.html
Nginx 的详细介绍:请点这里
Nginx 的下载地址:请点这里
相关阅读:
CentOS 6.2实战部署Nginx+MySQL+PHP http://www.linuxidc.com/Linux/2013-09/90020.htm
使用Nginx搭建WEB服务器 http://www.linuxidc.com/Linux/2013-09/89768.htm
搭建基于Linux6.3+Nginx1.2+PHP5+MySQL5.5的Web服务器全过程 http://www.linuxidc.com/Linux/2013-09/89692.htm
CentOS 6.3下Nginx性能调优 http://www.linuxidc.com/Linux/2013-09/89656.htm
CentOS 6.3下配置Nginx加载ngx_pagespeed模块 http://www.linuxidc.com/Linux/2013-09/89657.htm
CentOS 6.4安装配置Nginx+Pcre+php-fpm http://www.linuxidc.com/Linux/2013-08/88984.htm
