centos openssl 安装配置

centos openssl 安装配置

ID:34208664

大小:174.50 KB

页数:5页

时间:2019-03-04

上传者:U-5734
centos openssl 安装配置_第1页
centos openssl 安装配置_第2页
centos openssl 安装配置_第3页
centos openssl 安装配置_第4页
centos openssl 安装配置_第5页
资源描述:

《centos openssl 安装配置》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库

CentOS下Apache2.2+OpenSSL0.9安装配置系统版本:CentOSrelease5.5(Final)软件:httpd-2.2.22.tar.gz,openssl-0.9.8e.tar.gz1.首先用ssh上传到centos虚拟机器中[root@cacti~]#tar-zxvfhttpd-2.2.22.tar.gz[root@cacti~]#tar-zxvfopenssl-0.9.8e.tar.gz2.首先安装openssl[root@cactiopenssl-0.9.8e]#./config--prefix=/usr/local/ssl//配置路径为/usr/local/ssl目录下[root@cactiopenssl-0.9.8e]#make&&makeinstall//安装openssl3.安装apache2.2[root@cactihttpd-2.2.22]#./configure--prefix=/usr/local/apache--enable-so--enable-ssl--with-ssl=/usr/local/ssl//如果需要加别的参数也是可以的可以用./configure--help查看其它参数。[root@cactihttpd-2.2.22]#make&&makeinstall//安装apache4.[root@cacti~]#cd/usr/local/apache/conf/[root@cacti~]#vihttpd.conf#Secure(SSL/TLS)connectionsIncludeconf/extra/httpd-ssl.conf//把这个井号去掉,默认路径也可以修改5.[root@cactiextra]#cdextra进入extra目录找到httpd.ssl.conf[root@cactiextra]#cphttpd.ssl.confhttpd.ssl.conf.backup//备份一份[root@cactiextra]#cathttpd.ssl.conf|grep-v"#">httpd.ssl.conf//把井号去掉便于查找。[root@cactiextra]#vihttpd.ssl.conf//打开httpd.ssl.conf文件。DocumentRoot"/usr/local/apache/htdocs"ServerNamewww.example.com:443ServerAdminyou@example.comErrorLog"/usr/local/apache/logs/error_log"TransferLog"/usr/local/apache/logs/access_log"SSLEngineonSSLProtocolall-SSLv2SSLCipherSuiteHIGH:MEDIUM:!aNULL:!MD5SSLCertificateFile"/usr/local/apache/conf/server.cert"//这里可以修改默认路径和后缀名。SSLCertificateKeyFile"/usr/local/apache/conf/server.key"6.[root@cacticonf]#cd/usr/local/apache/conf//进入conf路径生成密匙[root@cacticonf]#opensslgenrsa-des3-outserver.key1024//生成服务器私钥:运行openssl命令,生成1024、2048位长的私钥server.key文件。如果您需要对server.key添加保护密码,请使用-des3 扩展命令。Windows环境下不支持加密格式私钥,Linux环境下使用加密格式私钥时,每次重启Apache都需要您输入该私钥密码(例:opensslgenrsa-des3-outserver.key2048)。GeneratingRSAprivatekey,1024bitlongmodulus....................++++++.................................++++++eis65537(0x10001)Enterpassphraseforserver.key://输入密码Verifying-Enterpassphraseforserver.key:[root@cacticonf]#opensslreq-new-keyserver.key-outserver.crt//生成服务器证书请求,并按要求填些相关证书信息:Enterpassphraseforserver.key:Youareabouttobeaskedtoenterinformationthatwillbeincorporatedintoyourcertificaterequest.WhatyouareabouttoenteriswhatiscalledaDistinguishedNameoraDN.TherearequiteafewfieldsbutyoucanleavesomeblankForsomefieldstherewillbeadefaultvalue,Ifyouenter'.',thefieldwillbeleftblank.-----CountryName(2lettercode)[GB]:cn//您所在国家的ISO标准代号,中国为CNStateorProvinceName(fullname)[Berkshire]:zj浙江//您单位所在地省/自治区/直辖市LocalityName(eg,city)[Newbury]://您单位所在地的市/县/区hz杭州OrganizationName(eg,company)[MyCompanyLtd]:hz公司名字hzOrganizationalUnitName(eg,section)[]://部门名称hz组织单位名称CommonName(eg,yournameoryourserver'shostname)[]:通用名,例如:www.xxx.com。此项必须与您访问提供SSL服务的服务器时所应用的域名完全匹配。zhh主机名EmailAddress[]:enjoygoodboy@163.com邮箱地址//您的邮件地址,不必后缀可以输入,直接回车跳过Pleaseenterthefollowing'extra'attributes//以下信息不必输入,回车跳过直到命令执行完毕。tobesentwithyourcertificaterequestAchallengepassword[]:Anoptionalcompanyname[]:签名:[root@cacticonf]#opensslx509-req-days700-inserver.crt-signkeyserver.key-outserver.certSignatureoksubject=/C=cn/ST=zj/L=hz/O=hz/OU=hz/CN=zhh/emailAddress=enjoygoodboy@163.comGettingPrivatekeyEnterpassphraseforserver.key:[root@cacticonf]#ls//可以备份证书extrakeybackupmime.typesserver.certserver.keyhttpd.confmagicoriginalserver.crt为了安装把以上生成3个文件chmod400模式。7.启动apache服务输入密码 [root@cacti~]#/usr/local/apache/bin/apachectlstarthttpd:Couldnotreliablydeterminetheserver'sfullyqualifieddomainname,using127.0.0.1forServerNameApache/2.2.22mod_ssl/2.2.22(PassPhraseDialog)Someofyourprivatekeyfilesareencryptedforsecurityreasons.Inordertoreadthemyouhavetoprovidethepassphrases.Serverwww.example.com:443(RSA)Enterpassphrase:OK:PassPhraseDialogsuccessful.Youhavemailin/var/spool/mail/root8.测试 3.备份私钥并提交证书请求请将证书请求文件certreq.csr提交给天威诚信,并备份保存证书私钥文件server.key,等待证书的签发。服务器证书密钥对必须配对使用,私钥文件丢失将导致证书不可用。安装服务器证书1.获取服务器证书中级CA证书为保障服务器证书在客户端的兼容性,服务器证书需要安装两张中级CA证书(不同品牌证书,可能只有一张中级证书)。从邮件中获取中级CA证书:将证书签发邮件中的从BEGIN到END结束的两张中级CA证书内容(包括“-----BEGINCERTIFICATE-----”和“-----ENDCERTIFICATE-----”)粘贴到同一个记事本等文本编辑器中,中间用回车换行分隔。修改文件扩展名,保存为intermediatebundle.crt文件(如果只有一张中级证书,则只需要保存并安装一张中级证书)。2.获取EV服务器证书将证书签发邮件中的从BEGIN到END结束的服务器证书内容(包括“-----BEGINCERTIFICATE-----”和“-----ENDCERTIFICATE-----”)粘贴到记事本等文本编辑器中,保存为server.crt文件服务器证书的备份及恢复在您成功的安装和配置了服务器证书之后,请务必依据下面的操作流程,备份好您的服务器证书,以防证书丢失给您带来不便。1.服务器证书的备份备份服务器证书私钥文件server.key,服务器证书文件server.crt,以及服务器证书中级CA证书文件intermediatebundle.crt即可完成服务器证书的备份操作。2.服务器证书的恢复请参照服务器证书配置部分,将服务器证书密钥文件恢复到您的服务器上,并修改配置文件,恢复服务器证书的应用。本篇文章来源于Linux公社网站(www.linuxidc.com)原文链接:http://www.linuxidc.com/Linux/2012-03/57286p2.htm

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。
关闭