`
long_yu2
  • 浏览: 343013 次
社区版块
存档分类
最新评论

rhel5.5_Apache配置openssl支持https服务

阅读更多

《rhel5.5_Apache配置openssl支持https服务》

1:切换到openssl证书目录:
# cd /etc/pki/tls/certs

2:创建私钥:
# make server.key
umask 77 ; \
    /usr/bin/openssl genrsa -des3 1024 > server.key
Generating RSA private key, 1024 bit long modulus
.++++++
...++++++
e is 65537 (0x10001)
Enter pass phrase:  123456
Verifying - Enter pass phrase:  123456

3:重写私钥,清除密码,让httpd启动时不必输入密码 
# openssl rsa -in server.key -out server.key
Enter pass phrase for server.key: 123456
writing RSA key

4:证书签发请求(Certificate Signing Request) (CSR)
# make server.csr
umask 77 ; \
    /usr/bin/openssl req -utf8 -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) [GB]:cn
State or Province Name (full name) [Berkshire]:fujian
Locality Name (eg, city) [Newbury]:xiamen
Organization Name (eg, company) [My Company Ltd]:xmu
Organizational Unit Name (eg, section) []:eda
Common Name (eg, your name or your server’s hostname) []:192.168.1.105     (注: 此处应与httpd.conf中的ServerName一致, 否则提示证书错误)
Email Address []:clough@eda.com
Please enter the following ’extra’ attributes
to be sent with your certificate request
A challenge password []:cliff
An optional company name []:xmu

5:给自己创建CA并签名
# openssl x509 -in server.csr -req -signkey server.key -days 365 -out server.crt
Signature ok
subject=/C=cn/ST=fujian/L=xiamen/O=lexie/OU=lexie/CN=192.168.1.105/emailAddress=clough@sohu.com
Getting Private key

6:调整/etc/httpd/conf.d/ssl.conf正确引用上面创建的证书。
# vi /etc/httpd/conf.d/ssl.conf

SSLCertificateFile /etc/pki/tls/certs/server.crt
SSLCertificateKeyFile /etc/pki/tls/certs/server.key

7: 启动服务
# service httpd restart

分享到:
评论

相关推荐

    Apache+MySQL+SVN+SSL(最终文档)

    这份文档由作者“chi”创建于2011年3月16日,旨在指导用户如何在RHEL 5.5系统上安装并配置这些组件,同时提供了适用于Windows客户端的TortoiseSVN安装包信息。 ### Apache Web Server Apache是全球最广泛使用的Web...

    RHEL5.4下LAMP搭建

    其中,`--prefix`指定了安装路径,`--enable-deflate`支持网页压缩,`--with-mpm=worker`让Apache以worker模式运行,提高并发处理能力。 3. **编译并安装** 使用`make`命令进行编译,然后使用`make install`进行...

    owncloud-9.1.4.zip

    ownCloud是一款开源的云...这个过程涉及的技术知识点包括但不限于:Linux系统管理、软件包管理、网络服务配置、数据库管理、PHP编程以及Web安全实践。完成这些步骤后,你就可以拥有一个自托管的、安全的云存储平台了。

    centreon+nagios免费开源监控系统

    - 配置NSClient++服务,使其能够监听特定端口。 2. **配置Nagios** - 在`hosts.cfg`中添加远程Windows主机的信息,并指定使用NSClient++进行检查。 3. **测试连接** - 使用`nscp -H <远程主机IP> -c ping`命令...

    Zabbix安装指南(详细优化).pdf

    4. **配置Apache服务** - 设置Apache启动脚本: ```bash cp /usr/local/apache2/bin/apachectl /etc/init.d/httpd chmod +x /etc/init.d/httpd chkconfig --add httpd chkconfig httpd on ``` - 启动Apache...

Global site tag (gtag.js) - Google Analytics