一、安装带ssl的Apache2.2.21
1、安装apache之前需要先检查openssl是否安装完毕,yum list "*openssl*",如果没有用yum安装下即可
2、apache安装,网上文档很多,以下是专门针对ssl的编译参数
# cd /usr/local/src/tarbag # wget http://labs.renren.com/apache-mirror//httpd/httpd-2.2.21.tar.gz # tar xzvf httpd-2.2.21.tar.gz -C ../software # cd ../software/httpd-2.2.21 # ./configure --prefix=/usr/local/apache --enable-so --enable-ssl --enable-rewrite --enable-headers --with-mpm=worker --enable-expires --enable-suexec --with-suexec-docroot=/data/www --enable-mods-shared=all # make && make install # rm -rf /etc/init.d/httpd # cp /usr/local/apache/bin/apachectl /etc/init.d/httpd # sed -i '2c#chkconfig: 35 85 15' /etc/init.d/httpd # sed -i '3c#description: apache' /etc/init.d/httpd # chmod x /etc/init.d/httpd # chkconfig --add httpd # chkconfig httpd on # rm -rf /sbin/apachectl # ln -s /usr/local/apache/bin/apachectl /sbin
二、生成证书
1、生成证书存放目录
安装好apache后,第一时间生成证书,在生成证书之前先准备生成一个证书存放的目录
# cd /usr/local/apache/conf # mkdir ssl.key # cd ssl.key/