• Categories
    Category
  • Categories
    Category
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial Comments FAQ Related Articles

How to install SSL Certificate to Secure Apache on Debian 11.3

  • 00:35 cat /etc/os-release
  • 00:46 apt-get install openssl
  • 01:00 openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/ca.key -out /etc/ssl/certs/ca.crt
  • 02:05 mkdir /var/www/mine
  • 02:20 nano /var/www/mine/index.php
  • 02:51 chown -R www-data.www-data /var/www/mine/
  • 03:18 chmod -R 775 /var/www/mine/
  • 03:40 nano /etc/apache2/sites-available/mine-ssl.conf
  • 04:28 a2ensite mine-ssl.conf
  • 04:46 a2dissite default-ssl.conf
  • 05:04 a2enmod ssl
  • 05:17 systemctl restart apache2
7483

TO Install SSL Certificate Secure Apache On Debian 11.3

Introduction:

SSL is a web protocol that allows sending traffic between server and client in a secured manner.It supplies secure and encrypted transactions between the browser and websites. This protocol generates a certificate that the end-user has to authenticate.

Installation Procedure:

Step 1: Check the OS version by using the below command

[root@linuxhelp ~]# cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye

Step 2: Install OpenSSL by using the below command

[root@linuxhelp ~]#  apt-get install openssl
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
openssl is already the newest version (1.1.1n-0+deb11u2).
openssl set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 94 not upgraded.

Step 3 : Create The SSL Certificate as Follows by using the below command

[root@linuxhelp ~]# openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/ca.key -out /etc/ssl/certs/ca.crt
Generating a RSA private key
......................................+++++
..............................................................................+++++
writing new private key to '/etc/ssl/private/ca.key'
-----
You are about to be asked to enter information that will be incorporated

into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:IN
State or Province Name (full name) [Some-State]:TN
Locality Name (eg, city) []:Chennai
Organization Name (eg, company) [Internet Widgits Pty Ltd]:sample
Organizational Unit Name (eg, section) []:sample
Common Name (e.g. server FQDN or YOUR name) []:192.168.6.133
Email Address []:abc@gmail.com

Step 4: Create own HTML directory and site configuration by using the below command

[root@linuxhelp ~]# mkdir /var/www/mine
[root@linuxhelp ~]# nano /var/www/mine/index.php
<h1> Welcome to Linux help </h1>

Step 5: Change ownership and permission by using the below command

[root@linuxhelp ~]# chown -R www-data.www-data /var/www/mine/
[root@linuxhelp ~]# chmod -R 775 /var/www/mine/

Step 6: Create Virtual Host for accessing the site with SSL by using the below command

[root@linuxhelp ~]# nano /etc/apache2/sites-available/mine-ssl.conf

Step 7: Enable site access by using the below command

[root@linuxhelp ~]# a2ensite mine-ssl.conf
Enabling site mine-ssl.
To activate the new configuration, you need to run:
  systemctl reload apache2

Step 8: Disable default site access by using the below command

[root@linuxhelp ~]# a2dissite default-ssl.conf
Site default-ssl already disabled

Step 9: Enable SSL module by using the below command

[root@linuxhelp ~]# 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.

Step 10: Restart the Apache service to make the changes effect by using the below command

[root@linuxhelp ~]# systemctl restart apache2

Step 11: Go to the browser and browse the URL. The untrusted connection page appears. Click 'Advanced'. Here you can view the SSL Certificate Secure Apache as shown in the below images

ssl snap1

ssl snap2

Conclusion:

We have reached the end of this article. In this guide, we have walked you through the steps required to How to Installation SSL Certificate Secure Apache on Debian 11.3. Your feedback is much welcome.

Tags:
stalin
Author: 

Comments ( 0 )

No comments available

Add a comment

Frequently asked questions ( 5 )

Q

What is SSL Certificate?

A

SSL is a web protocol that is used to send traffic between server and client in a secure manner. It provides secure and encrypted transactions between the browser and websites. This protocol generates a certificate that the end user has to authenticate.

Q

What are the pre-requirements of SSL?

A

The requirements are, Install LAMP(Apache, MariaDB, PHP)

Q

How to Create the SSL Certificate?

A

Run the following command: openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/ca.key -out /etc/ssl/certs/ca.crt

Q

How to Create own HTML directory?

A

Use the following command: # mkdir /var/www/mine

Q

How can I Enable site access?

A

Run the following command: # a2ensite mine-ssl.conf

Related Tutorials in How to install SSL Certificate to Secure Apache on Debian 11.3

Related Tutorials in How to install SSL Certificate to Secure Apache on Debian 11.3

How to install Apache from Source Code on CentOS 7
How to install Apache from Source Code on CentOS 7
Oct 21, 2017
How to install Gparted on Debian 9.0
How to install Gparted on Debian 9.0
Sep 13, 2017
How to Completely Remove and Install Apache package on CentOS 7.6
How to Completely Remove and Install Apache package on CentOS 7.6
May 23, 2019
How to Install Pligg - Content Management System
How to Install Pligg - Content Management System
Jul 26, 2016
Installation SSL Certificate on Ubuntu/Linuxmint/Debian to Secure Apache
Installation SSL Certificate on Ubuntu/Linuxmint/Debian to Secure Apache
Sep 19, 2018
How to install apache jmeter on ubuntu 18.04
How to install apache jmeter on ubuntu 18.04
May 19, 2018
How to Configure HAproxy Load Balancer with Keepalived in CentOS
How to Configure HAproxy Load Balancer with Keepalived in CentOS
Nov 21, 2016
How to enable the Apache server-status on centos 7
How to enable the Apache server-status on centos 7
Jan 28, 2019

Related Forums in How to install SSL Certificate to Secure Apache on Debian 11.3

Related Forums in How to install SSL Certificate to Secure Apache on Debian 11.3

CentOS
connor class=
How To Completely Remove Apache package On CentOS 7.6
May 14, 2019
SSL
oliver class=
checking for SSL headers... configure: error: Cannot find ssl headers
May 26, 2017
Apache
isaac class=
How to disable apache welcome page on Ubuntu
Dec 15, 2018
Apache
rebeccajazz class=
Apache2 : mod_proxy in opensuse
Jan 3, 2018
Apache
elijah class=
What is the difference between httpd and apache
Feb 18, 2017
MariaDB
ryan class=
E: Unable to locate package mariadb-server
Sep 18, 2017
Apache
logan class=
How to install Apache GUI
Feb 24, 2017
Linux
AadrikaAnshu class=
How to add timestamps to history On Any Linux Machine
Jun 18, 2019

Related News in How to install SSL Certificate to Secure Apache on Debian 11.3

Related News in How to install SSL Certificate to Secure Apache on Debian 11.3

Debian IceDove kicks the bucket after Thunderbird revisits Debian Repositories
Debian IceDove kicks the bucket after Thunderbird revisits Debian Repositories
Feb 28, 2017
Attackers take advantage of Apache Struts vulnerabilities
Attackers take advantage of Apache Struts vulnerabilities
Mar 17, 2017
Mass update of Jessie - A better alternative to new version?
Mass update of Jessie - A better alternative to new version?
May 8, 2017
An Apache Web Server Bug That Grants Root Access on  Shared Web Hosts
An Apache Web Server Bug That Grants Root Access on Shared Web Hosts
Apr 10, 2019
Debian 9.2 ‘Stretch’ OS is here, download distro now
Debian 9.2 ‘Stretch’ OS is here, download distro now
Oct 9, 2017
Back To Top!
Rank
User
Points

Top Contributers

userNamenaveelansari
135850

Top Contributers

userNameayanbhatti
92510

Top Contributers

userNamehamzaahmed
32150

Top Contributers

1
userNamelinuxhelp
31040

Top Contributers

userNamemuhammadali
24500
Can you help Elijah ?
Remote Desktop Connection Has Stopped Working

When accessing my remote machine server using remote desktop on a windows machine I am getting this error

forum (1)

Networking
  • Routing
  • trunk
  • Netmask
  • Packet Capture
  • domain
  • HTTP Proxy
Server Setup
  • NFS
  • KVM
  • Memory
  • Sendmail
  • WebDAV
  • LXC
Shell Commands
  • Cloud commander
  • Command line archive tools
  • last command
  • Shell
  • terminal
  • Throttle
Desktop Application
  • Linux app
  • Pithos
  • Retrospect
  • Scribe
  • TortoiseHg
  • 4Images
Monitoring Tool
  • Monit
  • Apache Server Monitoring
  • EtherApe 
  • Arpwatch Tool
  • Auditd
  • Barman
Web Application
  • Nutch
  • Amazon VPC
  • FarmWarDeployer
  • Rukovoditel
  • Mirror site
  • Chef
Contact Us | Terms of Use| Privacy Policy| Disclaimer
© 2025 LinuxHelp.com All rights reserved. Linux™ is the registered trademark of Linus Torvalds. This site is not affiliated with linus torvalds in any way.