About Self-Signed Certificates

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

Step One-Install Mod SSL

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

  1. yum install mod_ssl

Step Two-Create a New Directory

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

  1. mkdir /etc/httpd/ssl

Step Three-Create a Self Signed Certificate

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

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

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

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

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

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

  1. You are about to be asked to enter information that will be
  1. incorporated into your certificate request.
  2. What you are about to enter is what is called a Distinguished
  1. Name or a DN.
  2. There are quite a few fields but you can leave some blank
  3. For some fields there will be a default value,
  4. If you enter '.', the field will be left blank.
  5. -----
  6. Country Name (2 letter code) [AU]:US
  7. State or Province Name (full name) [Some-State]:New York
  8. Locality Name (eg, city) []:NYC
  9. Organization Name (eg, company) [Internet Widgits Pty Ltd]:Awesome Inc
  10. Organizational Unit Name (eg, section) []:Dept of Merriment
  11. Common Name (e.g. server FQDN or YOUR name) []:example.com
  12. Email Address []:webmaster@awesomeinc.com

Step Four-Set Up the Certificate

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

打开SSL config 文件

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

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

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

  1. ServerName example.com:443

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

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

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

Step Five-Restart Apache

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

  1. /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. 开发者必知的8款App快速开发工具

    开发者必知的8款App快速开发工具 “我有一个好创意,就差一个CTO……” “原生APP开发难度大,周期长,成本高,还没上线市场已经被占领了.” “APP版本迭代更新,都是企业的一道难关,没有一个一劳 ...

  2. 【Netty学习】 ChannelHandler 改动及影响

    channelHandler 在Netty 4.x版本有了相当大的改动 http://netty.io/wiki/new-and-noteworthy.html   官网的更新改进说明. 以下节选官网 ...

  3. 关于开源授权协议 GPL 和 LGPL

    GPL 是 GNU General Public License (GNU 通用公共许可证)的缩写形式:LGPL 是 GNU Lesser General Public License (GNU 宽通 ...

  4. runtime获取类名,遍历变量,遍历对象,遍历方法

  5. mysql -prompt选项

    使用-pormpt修改提示符.可以在登录时或者在登录后使用prompt选项来修改提示符 (1)使用mysql命令行参数修改提示符 # mysql -u root -p Enter password: ...

  6. 对jsp可见域的变量感悟

    page  变量当前页面有效 reqeust 某次请求中的变量有效 session 某次会话中的变量有效 application 全站有效 page<request<session< ...

  7. 多文件 定义全局变量的使用 extern

    extern 申明变量在其他文件中定义了.如果变量放在*.h头文件,其它cpp文件加载*.h头文件就会出现变量定义重复. 头文件 DHeah.h #include <iostream> u ...

  8. android 单例模式

    单例模式特点: 1.一个类只能有一个实例 2.自己创建这个实例 3.整个系统都要使用这个实例 单例模式的形式: 1.饿汉式单例类 public class Singleton { private Si ...

  9. Tomcat8.5

    说明:Tomcat服务器上一个符合J2EE标准的Web服务器,在tomcat中无法运行EJB程序,如果要运行可以选择能够运行EJB程序的容器WebLogic,WebSphere,Jboss等Tomca ...

  10. MVC4中给TextBoxFor设置默认值和属性

    例如:(特别注意在设置初始值的时候 Value 中的V要大写) @Html.TextBoxFor(model => model.CustomerCode, new { Value="  ...