---
title: "WebSphere配置SSL指南[原创]"
author: "eryin"
date: "2010-04-08T21:49:38Z"
tags: ["ASP", "IBM", "Websphere", "虚拟机", "配置管理"]
categories: ["操作系统"]
slug: "websphere-ssl"
draft: false
lastmod: "2010-04-08T22:57:39Z"
id: 638418
url: "https://eryin.iteye.com/blog/638418"
---

公司购买了IBM的产品IHS（IBM HTTP Server）和WAS（WebSphere Application Server），这两个WEB服务器组合购成了IBM WEB服务器金牌组合。因为工作需要，公司网站内容管理系统后台需要使用SSL数字证书验证登陆。下面就将Windows、IBM WebSphere环境下SSL的创建过程列举如下：

 

**一、 用IBMIHS自带的“密钥管理实用程序”创建证书；**

 

1、 从开始菜单&gt;&gt;程序&gt;&gt;IBM HTTP Server 6.0打开“密钥管理实用程序”，如下图1：

 

![](http://mven.cn/content/uploadfile/200907/thum-63c85d8fea3a65f4a0888e30607c53a720090727155324.jpg)   
图1 打开“密钥管理实用程序”

 

2、 “密钥管理实用程序”打开后界面如下图2所示：

 

 ![](http://mven.cn/content/uploadfile/200907/thum-75fbb7f751dcbed3164815928ce3021020090727155351.jpg)  
图2 “密钥管理实用程序”打开后界面

 

3、 在菜单栏单击 “密钥管理实用程序”点击新建，创建“密钥数据库文件，如图3

 

![](http://mven.cn/content/uploadfile/200907/thum-6bade8110601de30c47dd51084ffc66320090727155549.jpg)   
图3：创建“密钥数据库”文件

 

4、 选择CMS类型，文件名wcmkey.kdb，位置选在IBMIHS安装目录的etc目录下，点击确定，出现图四所示输入密码界面：

 

 ![](http://mven.cn/content/uploadfile/200907/thum-a7ee56745585a55a4703baadfbd9f5c120090727155618.jpg)  
图4：填写密码和到期时间

 

5、 填好密码、到期时间和密码存储方式后，点击确定，然后点击“创建”菜单，选择“创建自签署证书”，出现图5：

 

 ![](http://mven.cn/content/uploadfile/200907/thum-45ed3e5a1e47deb9c5c01fdc9389cc0320090727155647.jpg)

图5：创建自签署证书

 

6、 填好证书资料后，点击确定，创建自签署证书成功了。下面将证书导出为p12格式的证书文件，如图6、7：

 

 ![](http://mven.cn/content/uploadfile/200907/thum-80b76d027791bfc3b2bc148367fde60c20090727155717.jpg)

图6：导出刚才创建的自签署证书为.p12文件

 

 ![](http://mven.cn/content/uploadfile/200907/thum-7d30fc34fead9f1ac3dda8174994cbec20090727155746.jpg)  
图7：输入.p12证书文件的密码，用于安装时安全防护

 

7、 输入证书密码后，导出证书就成功了，这样客户机访问的时候，直接将证书导入或安装就可以了，在此不再详述。

 

**二、 配置IBMIHS的配置文件httpd.conf，如下图8所示：**

 

 ![](http://mven.cn/content/uploadfile/200907/thum-96f90e110ce3f53e13d9b0c6a2e3fff820090727155822.jpg)  
图8：用红钱描出的部分就是在IBMIHS里的配置文件里添加的内容

 

```
LoadModule deflate_module modules/mod_deflate.so
#AddOutputFilterByType DEFLATE text/html text/plain text/xml

Listen 218.73.64.129:80
Listen 218.73.64.134:443

Alias /webpic  "F:/trswcm/webpic.ear/webpic.war"
Alias /pub  "F:/trswcm/pub.ear/pub.war"
Alias /template  "F:/trswcm/template.ear/template.war"

AddType text/html .htm
AddHandler server-parsed .htm
AddType text/html .asp
AddHandler server-parsed .asp

<VirtualHost 218.73.64.129:80>
DocumentRoot "F:/trswcm/pub.ear/pub.war"
DirectoryIndex index.html index.html.var
</VirtualHost>

<VirtualHost 218.73.64.134:443>
DocumentRoot "F:/trswcm/pub.ear/pub.war"
DirectoryIndex index.html index.html.var
LoadModule ibm_ssl_module modules/mod_ibm_ssl.so             #加载SSL模块
SSLEnable                                                    #SSL模块生效
Keyfile "D:/Program Files/IBM HTTP Server/etc/wcmkey.kdb"    #定义密钥数据库文件路径
SSLClientAuth required
</VirtualHost>
```

 

**三、 在WebSphere控制台里面添加443端口。**

 

1、 打开WebSphere管理控制台，在左侧菜单栏中依次选择：环境&gt;&gt;虚拟主机&gt;&gt;，出现如图9所示页面：

 

 ![](http://mven.cn/content/uploadfile/200907/thum-9acf928a602580321bb776a289aea69320090727155939.jpg)  
图9：环境&gt;&gt;虚拟主机界面

 

2、 点击default\_host&gt;&gt;其他属性&gt;&gt;主机别名&gt;&gt;新建，出现如图10所示界面：

 

![](http://mven.cn/content/uploadfile/200907/thum-57973ccb4dd5ed4c08947b6ee25f0cfb20090727160016.jpg)   
图10：新建主机别名和端口类型

 

3、 主机名“\*”，端口号：443（即HTTPS端口），点击确定，保存主配置更改，重新启动IBMIHS和WebSphere后，大功告成。

本文来自：韦少乾博客(mven.cn)  
详细出处：[http://mven.cn/post/19.html](http://mven.cn/post/19.html)