Apache SSL Certificate Installation

https://www.digicert.com/ssl-certificate-installation-apache.htm


  1.  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  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 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 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:
    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

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.
  • 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 and tags that enclose your SSL configuration.
  • Apache SSL Certificates, Guides, & Tutorials
    BUY NOWLEARN MORE
    Visite nuestras instrucciones en español para Apache Instalar Certificado SSL.

    Troubleshooting:

    1. If your web site is publicly accessible, our SSL Certificate Tester tool can help you diagnose common problems.
    2. For help moving your certificates to additional servers or across server platforms, see our OpenSSL export instructions.
    3. If you need to disable SSL version 2 compatibility in order to meet PCI Compliance requirements, you will need to add the following directive to your Apache configuration file:
          SSLCipherSuite HIGH:+MEDIUM:!SSLv2:!EXP:!ADH:!aNULL:!eNULL:!NULL
      If the directive already exists, you will probably need to modify it to disable SSL version 2.
    4. Also you can visit our page with instructions to fix common Apache SSL Errors for additional tips.

    Apache Server Configuration

    For information about Apache server configurations that can strengthen your SSL environment:

    Installing your SSL Certificates in Apache

    How to install your SSL Digital Certificate.

    留言

    熱門文章