[root@centos5 ~]# yum -y install mod_ssl 在线安装mod_ssl Loading "fastestmirror" plugin Loading mirror speeds from cached hostfile * base: centos.candishosting.com.cn * updates: mirror.khlug.org * addons: centos.candishosting.com.cn * extras: centos.candishosting.com.cn Setting up Install Process Parsing package install arguments Resolving Dependencies --> Running transaction check ---> Package mod_ssl.i386 1:2.2.3-11.el5_2.centos.4 set to be updated --> Processing Dependency: libdistcache.so.1 for package: mod_ssl --> Processing Dependency: libnal.so.1 for package: mod_ssl --> Running transaction check ---> Package distcache.i386 0:1.4.5-14.1 set to be updated --> Finished Dependency Resolution Dependencies Resolved ============================================================================= Package Arch Version Repository Size ============================================================================= Installing: mod_ssl i386 1:2.2.3-11.el5_2.centos.4 updates 85 k Installing for dependencies: distcache i386 1.4.5-14.1 base 119 k Transaction Summary ============================================================================= Install 2 Package(s) Update 0 Package(s) Remove 0 Package(s) Total download size: 204 k Downloading Packages: (1/2): mod_ssl-2.2.3-11.e 100% |=========================| 85 kB 00:02 (2/2): distcache-1.4.5-14 100% |=========================| 119 kB 00:03 Running rpm_check_debug Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction Installing: distcache ######################### [1/2] Installing: mod_ssl ######################### [2/2] Installed: mod_ssl.i386 1:2.2.3-11.el5_2.centos.4 Dependency Installed: distcache.i386 0:1.4.5-14.1 Complete! [root@centos5 ~]# cd /etc/httpd/conf 进入HTTP服务器配置文件所在目录 [root@centos5 conf]# rm -rf ssl.*/server.* 删除默认或残留的服务器证书相关文件 [root@centos5 ~]# rpm -qa |grep openssl openssl-0.9.8b-10.el5 [root@centos5 ~]# openssl genrsa -out www.yang.com.key 1024 建立服务器密钥 Generating RSA private key, 1024 bit long modulus ...........................................................++++++ .++++++ e is 65537 (0x10001) [root@centos5 ~]# openssl req -new -key www.yang.com.key -out www.yang.com.csr 建立服务器公钥 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.