linux 下部署 openssl+apache 配置https
来源:互联网 发布:西瓜数据集3.0 编辑:程序博客网 时间:2024/05/23 20:07
在工作中,公司开发的IOS 版校园APP需要在IOS环境上提供下载APP,所以下载页面需要在Linux下部署Apache,安装openSSL,搭建HTTPS进行访问。
在部署某大学掌上校园时,整了很久,都没有成功搭建起Https环境,最后经过熬夜加班终于整出来了,现在整理下搭建步骤,防止下次再出现这种问题。
一、下载zlib-1.2.3.tar.gz包
将下载的包放在usr/local目录下,进行如下操作
(1)tar -zxf ./zlib-1.2.3.tar.gz
(2)./configure --prefix=/usr/local/zlib (这里按情况添加参数)
(3)make
(4)make install
二、下载安装openssl-1.0.1p.tar.gz
将下载的包放在/usr/local 目录下,进行如下操作
(1)解压安装包:tar -zxf ./tar -xzf openssl-openssl-1.0.0e.tar.gz
(2)进入解压目录:cd openssl-1.0.0e
(3)./config --prefix=/usr/local/openssl
(4)./config -t
(5)make depend
(6)cd /usr/local
(7)ln -s openssl ssl
(8)在/etc/ld.so.conf 文件的最后面,添加如下内容:
/usr/local/openssl/lib
(9)ldconfig
(10)添加OPENSSL的环境变量:
在etc/的profile的最后一行,添加:
export OPENSSL=/usr/local/openssl/bin
export PATH=$OPENSSL:$PATH:$HOME/bin
(11)退出命令界面
至此,openssl 就安装完毕。可输入 openssl version查看安装的openssl的版本。
以上步骤的原文地址:http://blog.csdn.net/dazhi_100/article/details/17143213
三、下载安装httpd-2.4.17.tar.gz
(1)解压安装包,tar -zxf ./httpd-2.4.17.tar.gz
(2)进入解压文件,编译该文件:
./configure --prefix=/usr/local/apache --enable-so --enable-ssl --with-ssl=/usr/local/ssl --enable-mods-shared=all --with-apr=/usr/local/apr --with-apr- util=/usr/local/apr-util --with-pcre=/usr/local/pcre --with-zlib=/usr/local/zlib
备注:如果提示没安装apr、apr-util、pcre,进行安装即可,在编译的时候,指定以上3个路径即可,目前尚不知道为什么不指定路径就找不到的原因。
(3)make
(4)make install
四、配置apache,让其支持https,生成授权文件和证书
由于openssl有生成证书的功能,所以可以借助该工具生成证书
#cd apache/conf
#mkdir ss1.key
#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.crt
五、修改 httpd.conf
#Listen 80
#Include conf/extra/httpd-ssl.conf (将改行的#去掉)
#修改httpd-ssl.conf
# 配置证书文件的地址
SSLCertificateFile "/usr/local/apache2/conf/ssl.key/server.crt"
SSLCertificateKeyFile "/usr/local/apache2/conf/ssl.key/server.key"
- linux 下部署 openssl+apache 配置https
- Linux系统下Apache+OpenSSL源码安装并配置https服务
- Linux下apache、openssl、mod_ssl安装、配置
- linux下apache+openssl配置记录
- linux下apache https 虚拟主机配置
- Linux+Apache+openssl实现https验证
- Linux apache配置https
- linux apache https配置
- linux 下部署Apache 转发域名配置
- linux下openssl在apache,tomcat的整合中的配置
- Linux下安装Apache Openssl
- Ubuntu下配置Apache HTTPS
- Centos下apache配置https
- Ubuntu下配置Apache HTTPS
- ngix+apache下https配置
- [转]Linux Apache Https 配置
- Apache+tomcat配置Openssl 之指定客户端目录使用Https
- 在Windows下配置Apache + OpenSSL
- 数据库应用-View
- sos的几种方案简析
- 数据库应用-Datalog
- Better Android build
- hiho刷题日记——第十五最近公共祖先·二
- linux 下部署 openssl+apache 配置https
- 开篇
- 数据库应用-E commerce管理
- CCI 复习笔记 11
- spirng中的asm与jdk不兼容<已解决>
- UVa201
- 遇到的问题:PHPNOW修改虚拟主机失败
- KMP算法体验
- apach+https安装过程出现的问题