Apache搭建HTTPS Virtual Host

发表于:2014-4-04 16:07

字体: | 上一篇 | 下一篇 | 我要投稿

 作者:傲雪星枫    来源:51Testing软件测试网采编

  Apache 搭建HTTPS Virtual Host
  1.创建SSL证书
  首先需要安装openssl,linux系统默认已安装,如没有则用以下命令安装:
  sudo apt-get install openssl
  sudo apt-get install libssl-dev
  创建证书:
  cd /etc/ssl/private
  sudo openssl req -new -x509 -days 365 -sha1 -newkey rsa:1024 -nodes -keyout demo.key -out demo.crt
  参数说明:
  -x509 显示证书和签名工具
  -days 证书的有效期
  -sha1 证书加密算法
  -newkey rsa:1024 创建一个新key,1024表示公钥长度为1024bits
  命令执行完会创建demo.key与demo.crt
  更多参数说明可以参考:http://www.openssl.org/docs/apps/openssl.html
  创建步骤:
root@ubuntu:/etc/ssl/private# sudo openssl req -new -x509 -days 365 -sha1 -newkey rsa:1024 -nodes -keyout demo.key -out demo.crt
Generating a 1024 bit RSA private key
.......++++++
...........++++++
writing new private key to 'demo.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]:CN
State or Province Name (full name) [Some-State]:GD
Locality Name (eg, city) []:GZ
Organization Name (eg, company) [Internet Widgits Pty Ltd]:fdipzone.Ltd
Organizational Unit Name (eg, section) []:test
Common Name (eg, YOUR name) []:demo.fdipzone.com
Email Address []:fdipzone@gmail.com
root@ubuntu:/etc/ssl/private#
21/212>
《2023软件测试行业现状调查报告》独家发布~

关注51Testing

联系我们

快捷面板 站点地图 联系我们 广告服务 关于我们 站长统计 发展历程

法律顾问:上海兰迪律师事务所 项棋律师
版权所有 上海博为峰软件技术股份有限公司 Copyright©51testing.com 2003-2024
投诉及意见反馈:webmaster@51testing.com; 业务联系:service@51testing.com 021-64471599-8017

沪ICP备05003035号

沪公网安备 31010102002173号