您好,欢迎访问一九零五行业门户网

linux下apache2+php+ssl的安装

本文主要介绍了在linux下安装apache2+php+ssl的细节及配置。
步骤:
1.下载并安装 openssl
2.安装apache2
./configure --prefix=你打算安装apache2的目录 --with-openssl=安装了openssl的目录 --with-apr=/usr/local/apr-httpd/ --with-apr- util=/usr/local/apr-util-httpd/ --enable-mods-shared=all --enable-ssl --enable-so --enable-cache --enable-file-cache --enable-mem-cache --enable-disk-cache
3.安装php
./configure --with-apxs2=安装了apache2的目录
4.制作证书
ca的证书文件cacert.pem
# cd /usr/share/ssl/misc # ./ca -newca
证书请求newreq.pem
# ./ca -newreq
签署证书newcert.pem
# ./ca -sign # mkdir /usr/local/apache2/conf/ssl.crt/ # mkdir /usr/local/apache2/conf/ssl.key/ # cp newcert.pem /usr/local/apache2/conf/ssl.crt/server.pem # cp newreq.pem /usr/local/apache2/conf/ssl.key/server.pem
5.修改apache配置文件
更改服务器的证书文件的相关配置
# vi /usr/local/apache2/conf/extra/httpd-ssl.conf
sslcertificatefile /usr/local/apache2/conf/ssl.crt/server.pem sslcertificatekeyfile /usr/local/apache2/conf/ssl.key/server.pem
<directory "你的ssl根目录"> options -indexes allowoverride none order allow,deny allow from all </directory>
6.启动apache+ssl
httpd启动时需要输入口令
备注:
打开端口的命令:
iptables -t filter -a input -d 192.168.0.5 -p tcp --dport 8080 -j accept
参考了如下资料
1. http://www.linuxdiyf.com/viewarticle.php?id=66493
2. http://man.chinaunix.net/newsoft/apachemenual_cn_2.2new/ssl/ssl_howto.html
相关阅读:
windows服务器中检测php ssl是否开启以及开启ssl的方法
php中使用openssl生成证书及加密解密
nginx 和 node在阿里云部署https方法步骤
以上就是linux下apache2+php+ssl的安装的详细内容。
其它类似信息

推荐信息