Skip to content
May 15, 2025
  • Linkedin
  • Twitter
  • Facebook
  • Youtube

Daily CyberSecurity

Primary Menu
  • Home
  • Cyber Security
  • Cybercriminals
  • Data Leak
  • Linux
  • Malware Attack
  • Open Source Tool
  • Technology
  • Vulnerability
  • Home
  • Technique
  • Install & Enable HTTPS on Apache Server
  • Technique

Install & Enable HTTPS on Apache Server

Ddos September 15, 2017 1 min read
Trustico-DigiCert

Install & Enable HTTPS on Apache Server

First of all, you need to have a website that can run under http. This tutorial is about Apache2, and other servers may have similar settings.

  1. Get a free SSL certificate.
    Now Let’s Encrypt offers free SSL certificate service. So we need to register an account. Then, after landing you can apply for a free SSL certificate. Finally save the requested certificate locally.
  2. Configure the Apache2 environment
    This will automatically install the SSL plugins required for Apache2.
    sudo a2enmod ssl
    
    sudo a2ensite default-ssl

    Create a default SSL site that will be in /etc/apache2/sites-enabled/ to generate a configuration file.

    In /etc/apache2/creating two folders

    cd /etc/apache2
    
    sudo mkdir ssl.key
    sudo mkdir ssl.crt

    Upload *.crt to ssl.crt folder, upload *.ssl to ssl.key folder.
    Next, we start the configuration default-ssl.conf file

    sudo vim /etc/apache2/sites-enabled/default-ssl.conf

    In which the following attributes are changed

    SSLCertificateFile     /etc/apache2/ssl.crt/2_***.crt
    
    SSLCertificateKeyFile /etc/apache2/ssl.key/3_***.key
    SSLCertificateChainFile /etc/apache2/ssl.crt/1_***.crt

    After the change is successful, restart the Apache2 service

    sudo service apache2 restart

    Finally, try to access https://YourDomain

  3. Enable https by default
    On .htaccess file, add
    RewriteEngine On
    
    RewriteBase /
    RewriteCond %{SERVER_PORT} !^443$
    RewriteRule ^(.*)$ https://YourDomain/ [L]

    After the creation is complete, change /etc/apache2/apache2.conf

    AllowOverride All
  4. Enjoy
Rate this post
Tags: Apache server https

Continue Reading

Previous: Talk about HTML5 local storage
Next: How to use WebRTC to get viewer’s IP address

Search

Our Websites
  • Penetration Testing Tools
  • The Daily Information Technology
    • About SecurityOnline.info
    • Advertise on SecurityOnline.info
    • Contact

    When you purchase through links on our site, we may earn an affiliate commission. Here’s how it works

    • Disclaimer
    • Privacy Policy
    • DMCA NOTICE
    • Linkedin
    • Twitter
    • Facebook
    • Youtube
    Copyright © All rights reserved.
    x