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怎么终止当前正在执行的sql语句

    mysql怎么终止当前正在执行的sql语句 show processlist; kill 要杀的ID kill 7

  2. Linux - sort & uniq

    参考:http://www.cnblogs.com/ggjucheng/archive/2013/01/13/2858385.html sort < InputFile | uniq -c

  3. 从AsyncTask中获取数据的问题

    public class GetData extends AsyncTask<String, Void, String> { DataDownloadListener dataDownlo ...

  4. 测试App运行状态

    示例代码: #import "AppDelegate.h" @interface AppDelegate () @end @implementation AppDelegate - ...

  5. yum只下载安装需要的rpm包

    1.安装yum的插件yum-downloadonly yum -y install yum-downloadonly 2.使用 yum -y install somepackges --downloa ...

  6. jdk与eclipse版本问题解决applet的启动

    今天在中韩,遇到一个保全项目,需要调用applet显示打印批单,结果IE一直显示安全设置问题,去java程序的安全里面想下调等级,不好调,所以想改个jdk_32试试. 版本环境 原先是eclipse_ ...

  7. wampserver下修改mysql root用户的登录密码

    1.安装好wamp后,运行WampServer程序,进入MYSQL控制台; 2.进入控制台后,提示输入密码(不用输入任何密码,因为密码为空),按回车键进入; 3.输入“USE mysql;”然后回车, ...

  8. Tomcat系列之Java技术详解

    一.概述 1.前言 在前面几篇博客中,我们和大家说了负载均衡器服务器.Web服务器.反向代理服务器.缓存服务器,从这篇博客开始我们和大家说说应用程序服务器,对于上述内容不了解的博友可以去参考一下我们前 ...

  9. 学习jsp(3)

    HttpServletRequest和HttpServletResponse: response.setContentType("text/html;charset=UTF-8") ...

  10. 建立一个Hello World级别的Spring项目

    package com.sevenhu.domain; import org.springframework.context.ApplicationContext; import org.spring ...