About Self-Signed Certificates

自签证书。一个SSL证书,是加密网站的信息,并创建更安全的链接的一种方式。附加地,证书可以给网站浏览者显示VPS的的身份证明信息。如果一个SSC没有第三方证实,那么证书作者可以发行SSL证书,用以验证虚拟服务器的细节。

Step One-Install Mod SSL

为了设置自签名证书,我们先要确保Apache和Mod SSL已经在VPS上安装。你可以通过下面的命令安装他们:

yum install mod_ssl

Step Two-Create a New Directory

下一步,我们需要创建一个新的路径,用以存储server key和certificate.

mkdir /etc/httpd/ssl

Step Three-Create a Self Signed Certificate

当我们请求一个新证书,我们可以通过改变365为任何我们乐意的数字,来指定证书的有效期。

标准的证书,会在一年后过期。

openssl req -x509 -nodes -days 365 -newkey rsa:2048 
-keyout /etc/httpd/ssl/apache.key 
-out /etc/httpd/ssl/apache.crt

通过该命令,我们重建了自签名SSL certificate,和保护它的server key,并把他们都放在该新路径里。

该命令会要求输入一些信息。

最重要的是Common Name这一行,在这儿填入你的官方域名。如果你还没有,你可以写网站的IP地址。

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]:US
State or Province Name (full name) [Some-State]:New York
Locality Name (eg, city) []:NYC
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Awesome Inc
Organizational Unit Name (eg, section) []:Dept of Merriment
Common Name (e.g. server FQDN or YOUR name) []:example.com
Email Address []:webmaster@awesomeinc.com

Step Four-Set Up the Certificate

现在,所有必要的部分已经完成。下一步,要设置虚拟主机,来显示新的certificate.

打开SSL config 文件

vi /etc/httpd/conf.d/ssl.conf

找到<VirtualHost _default_443>,做一些快速改变。

取消DocumentRoot和ServerName行的备注,用你DNS可以抵达的域名或服务器IP地址,替换example.com。(它应该和certificate上的common name一样):

ServerName example.com:443

找到下面的三行,确保他们和下面的表达式匹配:

SSLEngine on
SSLCertificateFile /etc/httpd/ssl/apache.crt
SSLCertificateKeyFile /etc/httpd/ssl/apache.key

你的虚拟主机现在全都设置好了。保存并退出文件。

Step Five-Restart Apache

你已经做完。重启Apache server,会重载你修改过配置。

/etc/init.d/httpd restart

在你的浏览器,键入https://youraddress,会显示该新certificate。

How To Create a SSL Certificate on Apache for CentOS 6的更多相关文章

  1. How to Move SSL certificate from Apache to Tomcat

    https://www.sslsupportdesk.com/how-to-move-ssl-certificate-from-apache-to-tomcat/ Apache uses x509 p ...

  2. How To Set Up Apache with a Free Signed SSL Certificate on a VPS

    Prerequisites Before we get started, here are the web tools you need for this tutorial: Google Chrom ...

  3. How to ignore SSL certificate errors in Apache HttpClient 4.4

    public static CloseableHttpClient acceptsUntrustedCertsHttpClient() throws KeyStoreException, NoSuch ...

  4. Centos 64位 Install certificate on apache 即走https协议

    Centos 64位 Install certificate on apache 即走https协议 一: 先要apache 请求ssl证书的csr 一下是步骤: 重要注意事项 An Importan ...

  5. How to disable SSL certificate checking with Spring RestTemplate?(使用resttemplate访问https时禁用证书检查)

    How to disable SSL certificate checking with Spring RestTemplate?(使用resttemplate访问https时禁用证书检查) **** ...

  6. SSL certificate problem unable to get local issuer certificate解决办法

    SSL certificate problem unable to get local issuer certificate 解决办法: 下载:ca-bundle.crt 将它放在自己的wamp或者x ...

  7. Failed to connect to VMware Lookup Service……SSL certificate verification failed

    今天登陆vsphere web-client时候,报错如下: Failed to connect to VMware Lookup Service https://vc-test.cebbank.co ...

  8. 使用Letsencrypt做SSL certificate

    为什么要使用Letsencrypt做SSL certificate? 最简单直接的原因是免费.但是免费存在是否靠谱的问题,尤其是对安全要求比较高的网站,需要考虑使用letsencrypt的安全性是否符 ...

  9. 使用 OpenSSL为WindowsServer远程桌面(RDP)创建自签名证书 (Self-signed SSL certificate)

    前言 笔者查阅很多资料,才写成此文章,如有错误,请读者们及时提出. 一般大家使用远程桌面(Remote Desktop)连接Windows Server时,总会有一个警告提示,如图1 图1 出现此警告 ...

随机推荐

  1. mysql中文乱码问题

    1.mysql客户端在插入中文字符的时候可能出现乱码问题. 原因:  要解决字符集的问题,首先要知道现在的系统.数据库.表.客户端等使用什么样的字符集,以及系统支持什么字符集等. 2.我百度了好多,说 ...

  2. Http 四种请求访问代码 HttpGet HttpPost HttpPut HttpDelete .

    String url = "http://www.baidu.com"; //将要访问的url字符串放入HttpPost中 HttpPost httpPost= new HttpP ...

  3. 一表格简单明了区分BI和大数据

    大数据和BI两词现阶段处于刷屏状况,但是,很多人对于这两词确傻傻分不清.改怎么区别呢?本文将从概念.应用.发展趋势等多个角度对大数据和BI进行区分. BI(Business Intelligence) ...

  4. Android ListView 自定义 Adapter

    自定义Adapter类 public class ListViewAdapter extends BaseAdapter { private static final String TAG = Mai ...

  5. linux内核编译相关

    参考:http://www.arm.linux.org.uk/docs/kerncomp.php 一. 内核编译1) linux 2.4make clean/make mrpropermake dep ...

  6. block数据类型

    // //  main.m //  04-block数据类型 // //  Created by apple on 14-3-18. //  Copyright (c) 2014年 apple. Al ...

  7. Oracle自增长ID

    在Oracle中,可以为每张表的主键创建一个单独的序列,然后从这个序列中获取自动增加的标识符,把它赋值给主键.例如一下语句创建了一个名为customer_id_seq的序列,这个序列的起始值为1,增量 ...

  8. DNS域名解析

    之前用的是DNSPOD.CN的解析,没什么问题. 因为想根据不同国家做服务器解析(欧洲,亚洲,美国) 然后就转到DNSPOD.com里面有按国家来分的. 但是欧洲那边反应,每天断断续续会不能访问网站. ...

  9. 01分数规划poj2728(最优比例生成树)

    Desert King Time Limit: 3000MS   Memory Limit: 65536K Total Submissions: 21766   Accepted: 6087 Desc ...

  10. zoj The 12th Zhejiang Provincial Collegiate Programming Contest Demacia of the Ancients

    http://acm.zju.edu.cn/onlinejudge/showContestProblem.do?problemId=5504  The 12th Zhejiang Provincial ...