原文地址:
https://www.digicert.com/ssl-certificate-installation-apache.htm
SSL Certificate Installation in Apache
1. Copy the Certificate files to your server.
Download your Intermediate (DigiCertCA.crt) and Primary Certificate (your_domain_name.crt) files from your Customer Area, then copy them to the directory on your server where you will keep your certificate and key files. Make them readable by root only.
2. Find the Apache config file to edit.
The location and name of the config file can vary from server to server - especially if you use a special interface to manage your server configuration.
Apache's main configuration file is typically named httpd.conf or apache2.conf. Possible locations for this file include /etc/httpd/ or /etc/apache2/. For a comprehensive listing of default installation layouts for Apache HTTPD on various operating systems and distributions, see Httpd Wiki - DistrosDefaultLayout.
Often, the SSL Certificate configuration is located in a <VirtualHost> block in a different configuration file. The configuration files may be under a directory like /etc/httpd/vhosts.d/, /etc/httpd/sites/, or in a file called httpd-ssl.conf.
One way to locate the SSL Configuration on Linux distributions is to search using grep, as shown in the example below.
Type the following command:
grep -i -r "SSLCertificateFile" /etc/httpd/
Where "/etc/httpd/" is the base directory for your Apache installation.
3. Identify the SSL <VirtualHost> block to configure.
If you need your site to be accessible through both secure (https) and non-secure (http) connections, you will need a virtual host for each type of connection. Make a copy of the existing non-secure virtual host and configure it for SSL as described in step 4.
If you only need your site to be accessed securely, configure the existing virtual host for SSL as described in step 4.
4. Configure the <VirtualHost> block for the SSL-enabled site.
Below is a very simple example of a virtual host configured for SSL. The parts listed in bold are the parts that must be added for SSL configuration:
<VirtualHost 192.168.0.1:443>
DocumentRoot /var/www/html2
ServerName www.yourdomain.com
SSLEngine on
SSLCertificateFile /path/to/your_domain_name.crt
SSLCertificateKeyFile /path/to/your_private.key
SSLCertificateChainFile /path/to/DigiCertCA.crt
</VirtualHost>
Adjust the file names to match your certificate files:
- SSLCertificateFile should be your DigiCert certificate file (eg. your_domain_name.crt).
- SSLCertificateKeyFile should be the key file generated when you created the CSR.
- SSLCertificateChainFile should be the DigiCert intermediate certificate file (DigiCertCA.crt)
If the SSLCertificateChainFile directive does not work, try using the SSLCACertificateFile directive instead.
5. Test your Apache config before restarting.
It is always best to check your Apache config files for any errors before restarting, because Apache will not start again if your config files have syntax errors. Run the following command: (it is apache2ctl on some systems)
apachectl configtest
Restart Apache.
You can use apachectl commands to stop and start Apache with SSL support:
apachectl stop
apachectl start
Note: If Apache does not start with SSL support, try using "apachectl startssl" instead of "apachectl start". If SSL support only loads with "apachectl startssl" we recommend you adjust the apache startup configuration to include SSL support in the regular "apachectl start" command. Otherwise your server may require that you manually restart Apache using "apachectl startssl" in the event of a server reboot. This usually involves removing the <IfDefine SSL> and </IfDefine> tags that enclose your SSL configuration.
分享到:
相关推荐
Apache SSL 加密機制 Apache SSL 加密機制
CentOS Apache SSL Configuration
apache插件,用以实现SSL协议,good luck!
svn+apache+ssl整合,实现通过https访问SVN服务,并且可以实现只有持有证书才能访问及EMAIL通知和一些安装过程中遇到的问题
mod_ssl(apache SSL插件)
Apache服务器是大家经常用到的web服务器,部署SSl证书增加了网站的安全性,本文档提供了安装SSl证书的方法。
在Centos7.6平台下使用openssl给apache做自签名证书,并给apache设置HTTPS的SSL证书。(无坑版) 二、平台 [root@kahn.xiao ~]# uname -r 3.10.0-957.el7.x86_64 [root@kahn.xiao ~]# cat /etc/redhat-release ...
windows下Apache配置SSL安全连接.docx
apache+ssl安装
Apache HTTP Server 2.4.23 x86 (32 bit) Windows Installers,不含SSL。
apache配置sslapache配置sslapache配置ssl
本文档主要介绍Apache SSL的安装及详解过程!有关SSl方面的资料请查看本人上传的其他资料!
linux环境中设置APACHE支持SSL,使用OPENSSL生成安全密钥。前段时间客户要求增加项目安全性,通过实践与网络学习,总结文档与大家分享。
ubuntu linux中配置svn+apache+ssl
用openssl为apache制作ssl证书
什么是SSL? SSL(Secure Socket Layer): 是为Http传输提供安全的协议,通过证书认证来确保客户端和网站服务器之间的数据是安全。Open SSL下载地址:http://www.openssl.org/source/ ...1.安装配有SSL模块的apache,
apache安装包以及apr/apr-util/openssl/pcre相关依赖。用于apache+SSL的安装使用,
apache和tomcat整合配置 ssl
NULL 博文链接:https://xj84.iteye.com/blog/1171001
详细讲解apache2下简明具体配置SSL