How To Create a SSL Certificate on Apache for CentOS 6
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的更多相关文章
- 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 ...
- 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 ...
- How to ignore SSL certificate errors in Apache HttpClient 4.4
public static CloseableHttpClient acceptsUntrustedCertsHttpClient() throws KeyStoreException, NoSuch ...
- Centos 64位 Install certificate on apache 即走https协议
Centos 64位 Install certificate on apache 即走https协议 一: 先要apache 请求ssl证书的csr 一下是步骤: 重要注意事项 An Importan ...
- How to disable SSL certificate checking with Spring RestTemplate?(使用resttemplate访问https时禁用证书检查)
How to disable SSL certificate checking with Spring RestTemplate?(使用resttemplate访问https时禁用证书检查) **** ...
- SSL certificate problem unable to get local issuer certificate解决办法
SSL certificate problem unable to get local issuer certificate 解决办法: 下载:ca-bundle.crt 将它放在自己的wamp或者x ...
- 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 ...
- 使用Letsencrypt做SSL certificate
为什么要使用Letsencrypt做SSL certificate? 最简单直接的原因是免费.但是免费存在是否靠谱的问题,尤其是对安全要求比较高的网站,需要考虑使用letsencrypt的安全性是否符 ...
- 使用 OpenSSL为WindowsServer远程桌面(RDP)创建自签名证书 (Self-signed SSL certificate)
前言 笔者查阅很多资料,才写成此文章,如有错误,请读者们及时提出. 一般大家使用远程桌面(Remote Desktop)连接Windows Server时,总会有一个警告提示,如图1 图1 出现此警告 ...
随机推荐
- 开发者必知的8款App快速开发工具
开发者必知的8款App快速开发工具 “我有一个好创意,就差一个CTO……” “原生APP开发难度大,周期长,成本高,还没上线市场已经被占领了.” “APP版本迭代更新,都是企业的一道难关,没有一个一劳 ...
- 【Netty学习】 ChannelHandler 改动及影响
channelHandler 在Netty 4.x版本有了相当大的改动 http://netty.io/wiki/new-and-noteworthy.html 官网的更新改进说明. 以下节选官网 ...
- 关于开源授权协议 GPL 和 LGPL
GPL 是 GNU General Public License (GNU 通用公共许可证)的缩写形式:LGPL 是 GNU Lesser General Public License (GNU 宽通 ...
- runtime获取类名,遍历变量,遍历对象,遍历方法
- mysql -prompt选项
使用-pormpt修改提示符.可以在登录时或者在登录后使用prompt选项来修改提示符 (1)使用mysql命令行参数修改提示符 # mysql -u root -p Enter password: ...
- 对jsp可见域的变量感悟
page 变量当前页面有效 reqeust 某次请求中的变量有效 session 某次会话中的变量有效 application 全站有效 page<request<session< ...
- 多文件 定义全局变量的使用 extern
extern 申明变量在其他文件中定义了.如果变量放在*.h头文件,其它cpp文件加载*.h头文件就会出现变量定义重复. 头文件 DHeah.h #include <iostream> u ...
- android 单例模式
单例模式特点: 1.一个类只能有一个实例 2.自己创建这个实例 3.整个系统都要使用这个实例 单例模式的形式: 1.饿汉式单例类 public class Singleton { private Si ...
- Tomcat8.5
说明:Tomcat服务器上一个符合J2EE标准的Web服务器,在tomcat中无法运行EJB程序,如果要运行可以选择能够运行EJB程序的容器WebLogic,WebSphere,Jboss等Tomca ...
- MVC4中给TextBoxFor设置默认值和属性
例如:(特别注意在设置初始值的时候 Value 中的V要大写) @Html.TextBoxFor(model => model.CustomerCode, new { Value=" ...