Skip to content
Bots!
Bots!
  • About
    • Myself
    • আমার দোয়া
  • Bookmarks
    • Bookmarks
    • My OCI Bookmarks
    • Useful Proxmox Commands & Links
    • Learning Nano
    • Useful Sites
    • Useful Virtualbox Command
    • Useful MySQL Command
    • Useful Linux Command
    • BTT-CAS
  • Resources
    • Webinar on Cloud Adoption for Project Managers
  • Photos
  • Videos
  • Downloads
Bots!

SSL on Debian 10 Apache2

Rumi, December 16, 2021

Assuming you have an SSL certificate already downloaded and available on the server.

root@www:~#nano /etc/apache2/sites-available/default-ssl.conf
# line 3: change admin email

ServerAdminwebmaster@srv.world

# line 32,33: change to the certs gotten in section [1]

SSLCertificateFile /etc/letsencrypt/live/www.srv.world/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/www.srv.world/privkey.pem

# line 42: uncomment and change to the chain-file gotten in section

SSLCertificateChainFile /etc/letsencrypt/live/www.srv.world/chain.pem
root@www:~#a2ensite default-ssl
Enabling site default-ssl

To activate the new configuration, you need to run:

systemctl reload apache2
root@www:~#a2enmod ssl
Considering dependency setenvif for ssl:
Module setenvif already enabled
Considering dependency mime for ssl:
Module mime already enabled
Considering dependency socache_shmcb for ssl:
Enabling module socache_shmcb.
Enabling module ssl.
See /usr/share/doc/apache2/README.Debian.gz on how to configure SSL and create self-signed certificates.

To activate the new configuration, you need to run:

systemctl restart apache2
root@www:~#systemctl restart apache2

http to https force redirect:

If you’d like to set HTTP connection to redirect to HTTPS (Always on SSL/TLS), configure each Virtualhost like follows. It’s also OK to set it in [.htaccess] not in httpd.conf.

root@www:~#vi /etc/apache2/sites-available/000-default.conf
<VirtualHost *:80>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
root@www:~#a2enmod rewrite

Enabling module rewrite.

To activate the new configuration, you need to run:

systemctl restart apache2
root@www:~#systemctl restart apache2

Verify to access to the test page from a client computer with a Web browser via HTTPS. If you set Always On SSL/TLS, access with HTTP to verify the connection is redirected to HTTPS normally, too

Src: https://www.server-world.info/en/note?os=Debian_10&p=httpd&f=8

Administrations Configurations (Linux) Apache2HTTPSSSL

Post navigation

Previous post
Next post

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Myself…

Hi, I am Hasan T. Emdad Rumi, an IT Project Manager & Consultant, Virtualization & Cloud Savvyfrom Dhaka, Bangladesh. I have prior experience in managing numerous local and international projects in the area of Telco VAS & NMC, National Data Center & PKI Naitonal Root and CA Infrastructure. Also engaged with several Offshore Software Development Team.

Worked with Orascom Telecom-Banglalink, Network Elites as VAS partner, BTRC, BTT (Turkey) , Mango Teleservices Limited and Access to Informaiton (A2I-UNDP)

Currently working at Oracle Corporation as Principal Technology Solution and Cloud Architect.

You can reach me [h.t.emdad at gmail.com] and I will be delighted to exchange my views.

Tags

Apache Bind Cacti CentOS CentOS 6 CentOS 7 Debain Debian Debian 10 Debian 11 Debian 12 DKIM Docker endian icinga iptables Jitsi LAMP Letsencrypt Linux Munin MySQL Nagios Nextcloud NFS nginx pfsense php Postfix powerdns Proxmox RDP SSH SSL Ubuntu Ubuntu 16 Ubuntu 18 Ubuntu 20 Varnish virtualbox vpn Webmin Windows 10 XCP-NG zimbra

Topics

Recent Posts

  • Updated Repository of Debian 10 (Aug 2025) September 5, 2025
  • Deploye Minio using docker September 5, 2025
  • Install valkey ubuntu 22.04 August 30, 2025
  • MinIO with Let’s Encrypt SSL on Debian 12 – Step-by-Step Configuration August 1, 2025
  • How to Set Windows File Associations to Open .JNLP Files July 28, 2025
  • Removing CEPH from Proxmox Cluster July 23, 2025
  • Install Jitsi on Ubuntu 22.04 / 22.10 April 30, 2025
  • Key Lessons in life April 26, 2025
  • Create Proxmox Backup Server (PBS) on Debian 12 April 19, 2025
  • Add Physical Drive in Proxmox VM Guest April 19, 2025

Archives

Top Posts & Pages

  • Updated Repository of Debian 10 (Aug 2025)
©2025 Bots! | WordPress Theme by SuperbThemes