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. git安装步骤

    Git简单使用说明 安装git msysgit是Windows版的Git,从https://git-for-windows.github.io下载,然后按默认选项安装即可(注:安装适合自己电脑版本的g ...

  2. iOS -Swift 3.0 -String(字符串常规用法)

    // // ViewController.swift // Swift-String // // Created by luorende on 16/9/10. // Copyright © 2016 ...

  3. 使用Fiddler对android应用抓包

    工作原理 先上个图 此图一目了然,可以看出fiddler在请求中所处的位置,我们就可以确定它能干些什么. 它实际工作在本机的8888端口http代理,我们启动fiddler时,它会自动更改代理设置: ...

  4. itunes connect

    https://developer.apple.com/library/content/documentation/LanguagesUtilities/Conceptual/iTunesConnec ...

  5. YII实现Memcache故障转移的配置办法

    YII在默认配置下连接Memcache失败时会报错,要想实现故障转移就要改一下配置和代码 1.首先修改一下YII的 caching/CMemCache.php,我的版本是 1.1.7 找到 $cach ...

  6. runcluvfy.sh运行结果

    $ ./runcluvfy.sh stage -pre crsinst -n rac11g1,rac11g2 -verbose Performing pre-checks for cluster se ...

  7. css 字体样式

    [强制] font-family 属性中的字体族名称应使用字体的英文 Family Name,其中如有空格,须放置在引号中. 解释: 所谓英文 Family Name,为字体文件的一个元数据,常见名称 ...

  8. LIS 最长递增子序列

    一.最长公共子序列 经典的动态规划问题,大概的陈述如下: 给定两个序列a1,a2,a3,a4,a5,a6......和b1,b2,b3,b4,b5,b6.......,要求这样的序列使得c同时是这两个 ...

  9. java io读书笔记(2)什么是stream

    什么是stream?stream就是一个长度不确定的有序字节序列. Input streams move bytes of data into a Java program from some gen ...

  10. android 内存不足的问题

    FAILURE: Build failed with an exception. * What went wrong: A problem occurred configuring project ' ...