当前位置: > Linux发行版 > Linux Mint >

Linux Mint + Nginx 1.5.11搭建SSL/HTTPS/SPDY服务器

时间:2016-04-03 21:38来源:linux.it.net.cn 作者:IT

Apache搭建的SPDY服务器(Linux Mint + Apache2.2搭建SSL/HTTPS/SPDY服务器)很不爽,因为Apache只能用2.2版本,SPDY也只支持到3,不支持3.1。所以用Nginx好些。

用以下脚本安装:

 

 
  1. sudo apt-get install openssl libssl-dev  
  2. wget http://nginx.org/download/nginx-1.5.11.tar.gz  
  3. tar zxvf nginx-1.5.11.tar.gz  
  4. wget http://zlib.net/zlib-1.2.8.tar.gz  
  5. tar zxvf zlib-1.2.8.tar.gz  
  6. cd nginx-1.5.11  
  7. ./configure --with-http_ssl_module --with-zlib=../zlib-1.2.8 --with-http_spdy_module  
  8. sudo make install  

然后打开/usr/local/nginx/conf/nginx.conf

 

搜索HTTPS server,把下面的行全部取消注释,并为listen参数加上spdy,SSL证书可以填Apache的,或者自己创建。为了让Wireshark能截包,ssl_ciphers可以改成RSA。

 


 
  1. # HTTPS server  
  2. #  
  3. server {  
  4.     listen       443 ssl spdy;  
  5.     server_name  localhost;  
  6.   
  7.     ssl_certificate      /etc/ssl/certs/ssl-cert-snakeoil.pem;  
  8.     ssl_certificate_key  /etc/ssl/private/ssl-cert-snakeoil.key;  
  9.   
  10.     ssl_session_cache    shared:SSL:1m;  
  11.     ssl_session_timeout  5m;  
  12.   
  13.     #ssl_ciphers  HIGH:!aNULL:!MD5;  
  14.     ssl_ciphers  RSA;  
  15.     ssl_prefer_server_ciphers  on;  
  16.   
  17.     location / {  
  18.         root   /home/liuhx/xtp/writable/www;  
  19.         index  index.html index.htm;  
  20.     }  
  21. }  

 

 

启动:

sudo /usr/local/nginx/sbin/nginx

 

注:Apache使用的mod_spdy支持server push,nginx还不支持。

 

参考:

http://dev.meettea.com/show-110-1.html

http://nginx.org/en/docs/http/ngx_http_spdy_module.html

http://nginx.org/en/docs/configure.html

 
(责任编辑:IT)
------分隔线----------------------------