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. linux mknod命令解析

    linux mknod命令解析 http://www.cnblogs.com/cobbliu/archive/2011/07/05/2389014.html mknod:make node  生成设备 ...

  2. mysql 恢复

    一.备份的目的 做灾难恢复:对损坏的数据进行恢复和还原需求改变:因需求改变而需要把数据还原到改变以前测试:测试新功能是否可用 二.备份需要考虑的问题 可以容忍丢失多长时间的数据:恢复数据要在多长时间内 ...

  3. 利用NSUserdefaults来存储自定义的NSObject类及自定义类数组

    利用NSUserdefaults来存储自定义的NSObject类及自定义类数组 1.利用NSUserdefaults来存储自定义的NSObject类 利用NSUserdefaults也可以来存储及获取 ...

  4. Uint8Array 对象

    8 位无符号整数值的类型化数组.内容将初始化为 0.如果无法分配请求数目的字节,则将引发异常. 语法 uint8Array = new Uint8Array( length ); uint8Array ...

  5. 查找g++文档的方法

    http://www.gnu.org/ -> Software(http://www.gnu.org/software/software.html) ->搜索 "gcc" ...

  6. Java基础之泛型——使用二叉树进行排序(TryBinaryTree)

    控制台程序. 1.实现针对容器类的基于集合的循环 为了让容器类类型的对象能够在基于集合的for循环中可用,类必须并且只需要满足一个要求——必须实现泛型接口java.lang.Iterable<& ...

  7. Redis Sets

    Sets Sets 就是一个集合,集合的概念就是一堆不重复值的组合.利用Redis提供的Sets数据结构,可以存储一些集合性的数据,比如在微博应用中,可以将一个用户所有的关注人存在一个集合中,将其所有 ...

  8. Mac 下 FlashBuilder的快捷键

    Option + 上/下  当前行上下调整位置 Shift + Command + 左/右  选择当前行 Option + Command + 左/右 查看上一个类

  9. Lucas

    C(n,m)%p=C(n%p,m%p)*C(n/p,m/p)%p 迭代递归 n,m非负整数,p质数 证明 最后一个由二项式定理和p进制数性质得出的我并没有看懂...

  10. C++Builder 解决绘图闪动问题

    使用双缓冲 Form->DoubleBuffered = true; Panel->DoubleBuffered = true;