一、安装apache:
1、依次下载apr-1.4.6、apr-util-1.4.1、pcre-8.33、openssl-1.0.0j的tar包,解压后,依次执行
- ./configure
- make
- sudo make install
2、下载httpd-2.4.6,解压后编译安装,同上
./configure --prefix=/usr/local/apache2 --enable-so --enable-ssl=shared --enable-mods-shared=all --with-ssl=/usr/local/ssl --with-apr-util=/usr/local/apr-util --with-pcre=/usr/local/pcre
3、开启mod_ssl
- 编辑httpd.conf,去掉以下几行的注释:
- Include conf/extra/httpd-ssl.conf
LoadModule ssl_module modules/mod_ssl.so
LoadModule socache_shmcb_module modules/mod_socache_shmcb.so
- 生成服务器私钥:
#openssl genrsa -des3 -out server.key 1024
生成服务器证书请求,并按要求填些相关证书信息:
#openssl req -new -key server.key -out server.csr
签证:
# openssl x509 -req -days 700 -in server.csr -signkey server.key -out server.cert
Signature ok
重新启动APACHE
- 编辑conf/extra/httpd-ssl.conf文件,将所有关于apache路径改为你的路径,并保证前面生成的证书也可以被找到、
- 打开mod_ssl,
- sudo a2enmod ssl
- sudo a2ensite default-ssl
- sudo a2enmod ssl
4、启动apache:
sudo /etc/init.d/apache2 restart
二、安装SPDY
1、下载mod-spdy-beta_current_i386.deb,下载地址:https://developers.google.com/speed/spdy/mod_spdy/
2、 执行如下命令:
- dpkg -i mod-spdy-*.deb
- apt-get -f install
三、测试
在google浏览器中输入https://localhost,然后再在另一个页面中输入chrome://net-internals/#spdy,如果可以看到localhost,就说明安装成功,否则,没成功