DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • How to Verify Domain Ownership: A Technical Deep Dive
  • Designing Embedded Web Device Dashboards
  • How Java Servlets Work: The Backbone of Java Web Apps
  • Types of Bot Traffic on a Public Internet Website

Trending

  • AI in SRE: A Practical Autonomy Model for Self-Healing Infrastructure
  • Building an AI Visibility Checker With Cloudflare Workers (Without a Backend)
  • A Zero-Trust Implementation Framework for Cloud Migrations: Lessons From Enterprise Deployments
  • This One Spring Data JPA Pattern Cleaned Up to 3 Years of Repository Debt

How to Install SSL Certificate to an Apache Web Server

SSL is currently on of the standards of web security. Learn how to implement an SSL certificate on an Apache Web Server to keep your data safe.

By 
Kalpesh Patel user avatar
Kalpesh Patel
·
Apr. 11, 18 · Tutorial
Likes (2)
Comment
Save
Tweet
Share
13.3K Views

Join the DZone community and get the full member experience.

Join For Free

Before you start the installation process, please make sure that a CSR Code is generated, all validations are met, and the SSL Certificate is issued and downloaded.

To Install an SSL Certificate, Perform the Following Steps:

  • Copy the certificate into the shell text editor and name the file “mydomain.crt”

Note: Copy the contents of the certificate from (and including) the -----BEGIN CERTIFICATE---- line to the ---END CERTIFICATE--- line.

  • Copy the certificate to the Apache Server Directory in which you plan to store your certificates (by default: /usr/local/apache/conf/ssl.crt/ or /etc/httpd/conf/ssl.crt/)

Note: - If you have a custom installation, please locate the server directory.

  • Open the Apache Configuration file in a text editor. Apache configuration files are usually found in /etc/httpd. The main configuration file is usually named httpd.conf. In most cases, the <VirtualHost> blocks will be at the bottom of this httpd.conf file. Sometimes you will find <VirtualHost> blocks in a separate file in a directory like /etc/httpd/sites/ or in a file called ssl.conf.
  • Locate the SSL VirtualHost associated with your certificate. Verify that you have the following two directives within this virtual host. Please add them if they are not present.
    • SSLCertificateFile /usr/local/apache/conf/ssl.crt/domainname.crt (or server.crt)
    • SSLCertificateKeyFile /usr/local/apache/conf/ssl.key/domainname.key (or server.key)

Note: Some instances of Apache will store Virtual Host information in an ssl.conf file. If your httpd.conf contains no Virtual Host information then you will need to locate and amend the ssl.conf as performed above.

  • Save the changes and exit the shell editor.
  • Start or Restart your Apache web server using one of the following commands:
  • By default:

    /usr/local/apache/bin/apachectl startssl 

    or

    /usr/local/apache/bin/apachectl restart 

    Web server

    Published at DZone with permission of Kalpesh Patel. See the original article here.

    Opinions expressed by DZone contributors are their own.

    Related

    • How to Verify Domain Ownership: A Technical Deep Dive
    • Designing Embedded Web Device Dashboards
    • How Java Servlets Work: The Backbone of Java Web Apps
    • Types of Bot Traffic on a Public Internet Website

    Partner Resources

    ×

    Comments

    The likes didn't load as expected. Please refresh the page and try again.

    • RSS
    • X
    • Facebook

    ABOUT US

    • About DZone
    • Support and feedback
    • Community research

    ADVERTISE

    • Advertise with DZone

    CONTRIBUTE ON DZONE

    • Article Submission Guidelines
    • Become a Contributor
    • Core Program
    • Visit the Writers' Zone

    LEGAL

    • Terms of Service
    • Privacy Policy

    CONTACT US

    • 3343 Perimeter Hill Drive
    • Suite 215
    • Nashville, TN 37211
    • [email protected]

    Let's be friends:

    • RSS
    • X
    • Facebook