当前位置: > CentOS > CentOS服务器 > 环境配置 >

apache配置支持SPDY协议

时间:2014-10-23 16:51来源:linux.it.net.cn 作者:it
apache配置支持SPDY协议

1.SPDY协议要求Apache 2.2 (≥2.2.4)
查看apache版本
[root@localhost ~]# rpm -qa|grep httpd
httpd-tools-2.2.15-15.el6.centos.1.x86_64
httpd-2.2.15-15.el6.centos.1.x86_64

2.安装spdy包
需要依赖at包, 直接yum安装
[root@localhost ~]# yum install at
查看系统版本
[root@localhost ~]# uname -r
2.6.32-358.el6.x86_64

spdy包地址
https://developers.google.com/speed/spdy/mod_spdy/
mod_spdy 32-bit .deb (Debian/Ubuntu)
mod_spdy 64-bit .deb (Debian/Ubuntu)
mod_spdy 32-bit .rpm (CentOS/Fedora)
mod_spdy 64-bit .rpm (CentOS/Fedora)

我需要下载mod_spdy 64-bit .rpm (CentOS/Fedora)
https://dl-ssl.google.com/dl/lin ... _current_x86_64.rpm

如果大家不方便上google, 我为大家提供了百度网盘的地址http://pan.baidu.com/s/1bnEkIhL



[root@localhost ~]# rpm -U mod-spdy-*.rpm
warning: mod-spdy-beta_current_x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 7fac5991: NOKEY
error: Failed dependencies:
        mod_ssl >= 2.2 is needed by mod-spdy-beta-0.9.4.3-420.x86_64


需要首先安装mod_ssl >= 2.2
[root@localhost ~]# yum search mod_ssl
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
* epel: ftp.sjtu.edu.cn
=================================================== N/S Matched: mod_ssl ===================================================
mod_ssl.x86_64 : SSL/TLS module for the Apache HTTP Server

  Name and summary matches only, use "search all" for everything.
[root@localhost ~]# yum info mod_ssl
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
* epel: ftp.sjtu.edu.cn
Available Packages
Name        : mod_ssl
Arch        : x86_64
Epoch       : 1
Version     : 2.2.15
Release     : 15.el6.centos.1
Size        : 87 k
Repo        : base
Summary     : SSL/TLS module for the Apache HTTP Server
URL         : http://httpd.apache.org/
License     : ASL 2.0
Description : The mod_ssl module provides strong cryptography for the Apache Web
            : server via the Secure Sockets Layer (SSL) and Transport Layer
            : Security (TLS) protocols.
可以直接yum安装mod_ssl
[root@localhost ~]# yum install mod_ssl

[root@localhost ~]# rpm -Uvh mod-spdy-*.rpm
Preparing...                ########################################### [100%]
        package mod-spdy-beta-0.9.4.3-420.x86_64 is already installed

重启apache

3.测试使用spdy协议
打开chrome浏览器, 输入下面的url访问,不要关闭
chrome://net-internals/#spdy
再打开一个窗口
访问你的apache
https://10.237.90.78/
忽略警告, 继续访问

在chrome://net-internals/#spdy中出现你的主机名即为正常 (责任编辑:IT)
------分隔线----------------------------