apache2.0 https
首先安装SSL,再编译安装APACHE,再配置证书即可
1.下载apache和openssl
网址:http://www.apache.org
http://www.openssl.org
2.解压
#tar zxvf httpd-2.0.54.tar.gz
#tar zxvf openssl-0.9.7g.tar.gz
3.编译安装openssl,这个软件主要是用来生成证书:
#cd openssl-0.9.7g
#./config
#make
#make test
#make install
把openssl放进内核目录下,使其在任何目录下都能运行。
#cd /usr/local/bin
#ln -s /usr/local/ssl/bin/openssl openssl
4.编译安装apache
#cd /opt/httpd-2.0.54
#./configure --prefix="/opt/apache2" --enable-so --enable-ssl --with-ssl="/usr/local/ssl/bin"
#make
#make install
5.安装完毕,生成证书:
在/opt/apache2/conf下建立一个ssl.key目录
#cd ../apache2/
#cd conf/
#mkdir ssl.key
然后在该目录下生成证书:
#cd ssl.key/
生成服务器私钥:
#openssl genrsa -des3 -out server.key 1024
Generating RSA private key, 1024 bit long modulus
.......................++++++
.................................................++++++
e is 65537 (0x10001)
Enter pass phrase for server.key:
Verifying - Enter pass phrase for server.key:
生成服务器证书请求,并按要求填些相关证书信息:
#openssl req -new -key server.key -out server.csr
Enter pass phrase for server.key:
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:
State or Province Name (full name) [Some-State]:
Locality Name (eg, city) []:tyl
Organization Name (eg, company) [Internet Widgits Pty Ltd]:tz
Organizational Unit Name (eg, section) []:tz
Common Name (eg, YOUR name) []:tyl
Email Address []:tangyl@ruyi.com
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
签证:
# openssl x509 -req -days 700 -in server.csr -signkey server.key -out server.cert
Signature ok
subject=/C=AU/ST=Some-State/L=tyl/O=tz/OU=tz/CN=tyl/emailAddress=tangyl@ruyi.com
Getting Private key
Enter pass phrase for server.key:
为了安全,然后我们把这些文件的权限都设为400
chmod 400 server.key
chmod 400 server.cert
最后对/opt/apache2/conf/ssl.conf 进行修改:
vi /opt/apache2/conf/ssl.conf
修改的地方如下几处:
#SSLCertificateFile /opt/apache2/conf/ssl.crt/server.crt #108行
SSLCertificateFile /opt/apache2/conf/ssl.key/server.cert
#SSLCertificateFile /opt/apache2/conf/ssl.crt/server-dsa.crt
SSLCertificateKeyFile /opt/apache2/conf/ssl.key/server.key #116行
#SSLCertificateKeyFile /opt/apache2/conf/ssl.key/server-dsa.key
这样我们就基本配好了ssl现在我们来让apache启动ssl
首先配置http.conf:
添加
Include conf/extra/httpd-ssl.conf
/opt/apache2/bin/apachectl start
然后要求输入证书密码,正确输入后ssl就连同apache一起启动
在浏览器中输入:https://210.75.18.36
要求下载证书,OK~好了~结束~就是这么简单。
参考:http://www.szlangxing.com/Article/gyw/200504/524.html
http://www.chinaunix.net/jh/13/469276.html
Keytool应用实例:
1.产生一个keystore:
keytool -genkey -alias myssl -keyalg RSA -keystore myssl.jks
运行这个命令,系统提示:
Enter keystore password:(输入keystore密码:)
yourpassword(输入密码)
What is your first and last name?(您的名字与姓氏是什么?)
[Unknown]: www.myssl.cn(输入申请的证书的域名)
What is the name of your organizational unit? (您的组织单位名称是什么?)
[Unknown]:Fastcom(输入你所在组织单位的名字)
What is the name of your organization? (您的组织名称是什么?)
[Unknown]:Fastcom (输入你所在组织的名字)
What is the name of your City or Locality?(您所在的城市或区域名称是什么?)
[Unknown]:Shanghai(输入所在城市的名字)
What is the name of your State or Province? (您所在的州或省份名称是什么?)
[Unknown]:Shanghai(输入所在省份名字)
What is the two-letter country code for this unit?(该单位的两字母国家代码是什么?)
[Unknown]:CN(输入国家名字,如果是中国,请输入CN)
Is CN=www.myssl.cn, OU=fastcom, O=fastcom, L=Shanghai, ST=Shanghai, C=CN correct? [no]:
yes
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/ghosc/archive/2010/09/21/5899088.aspx
分享到:
相关推荐
详细描述 linux 安装Apache+openssl 过程,以及每个步骤所需安装包的下载地址
php5.3.1 v6版本适用于Apache等web服务器,Apache安装包含有openssl插件,php中含有php5apache2_2.dll文件,在windows7下配置并附有配置文件,我都搭建过了可以用,MySQL安装简单所以在这就没有添加进去。
个人win下安装 ssl amp 环境笔记 希望对大家有帮助呵呵
apache_2.2.24-x64-openssl-1.0.1e mysql-5.5.29-winx64 php-5.3.10-Win32-VC9-x64 vcredist_x64
apache openssl 安装文件 和 测试资源
1. nginx 主软件 和 3个依赖包 zlib + pcre + openssl
linux c 使用openssl实现SHA1WithRSA实现,签名,验签
WindowsApache+Openssl+MySQL+PHP+ZendOptimizer+eAccelerator+phpMyAdmin+NaviCat 安装与配置笔记.txt 很抱歉,该文件中有一个地方不小心写错了,这句: LoadModule php5_module "modules/php5apache2_2.dlll" ...
这些资源是配合apache(2.2.x)+openssl(0.9.6->1.0.1升级)过程博文环境搭建中所需要的资源,不是太好找,所以都传上来,主要有: 1.升级opensslV1.0.1b单独用到的三个文件:libeay32.dll,openssl.exe,ssleay32.dll ...
linux升级openssl9.3,linux升级openssl9.3,linux升级openssl9.3,linux升级opelinux升级openssl9.3,linux升级openssl9.3,linux升级openssl9.3,linux升级opelinux升级openssl9.3,linux升级openssl9.3,linux...
下载apache_2.2.4-win32-x86-openssl-0.9.8d.msi 进行安装 2. 注意默认端口是80 安装成功后启动apache访问http://127.0.0.1及安装成功 3。 apache的配置文件\conf\httpd.conf apache的默认...
专业服务器工作者最需求的:PHP Version 5.5.0 + Apache/2.4.5 (Win64) PHP Version 5.5.0 + Apache/2.4.5 (Win64)协同工作模块配置替代解决方案。 本文档用于解决PHP Version 5.5.0 + Apache/2.4.5 (Win64)不能...
windows下Curl+Openssl访问https实例,内含编译好的WIN32类库和实例
Apache2.2.4+Subverson1.7.6+Openssl安装配置,一步步安装配置,肯定能部署成功。祝你好运!
linux7升级到 openssl3.0.2 openssh8.9.p1 linux7升级到 openssl3.0.2 openssh8.9.p1 linux7升级到 openssl3.0.2 openssh8.9.p1 linux7升级到 openssl3.0.2 openssh8.9.p1 linux7升级到 openssl3.0.2 openssh8.9...
本代码使用MFC方式实现了如下功能: ...2> 集成OpenSSL POST访问HTTPS站点。可成功登陆小米官网。 文件包内含有完整的,编译好的OpenSSL开发需要的头文件以及库文件等,可以方便的使用在您的项目中。
win+linux环境下openssl-1.0.2e+1.1.1h; Windows环境下的openssl只需要安装exe文件即可; Linux环境下需要编译openssl源码; 详见本人博客:https://blog.csdn.net/sunny_hu92/article/details/111270894
APMServ 5.2.0 是一款拥有图形界面的快速搭建Apache 2.2.3、PHP 5.2.0、MySQL 5.0.27 &4.0.26、SQLite、ZendOptimizer、OpenSSL、phpMyAdmin、SQLiteManager,以及ASP、CGI、 Perl网站服务器平台的绿色软件。...
jpegsrc.v6b.tar.gz libpng-1.2.12.tar.gz freetype-2.3.4.tar.gz gd-2.0.34.tar.gz httpd-2.2.21.tar.gz openssl-0.9.8k.tar.gz php-5.2.17.tar.gz
C语言实现openssl的https客户端post方法使用,可以传入json字符串的格式,测试的例子,可以使用