• Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial News 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
{{postValue.id}}

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
{{postCtrl.cmtErrMsg}}

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

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 Isaac ?
How to run windows application in linux

I need to run the windows application in my Linux machine, instead of installing from yum repo or any other repos. How to do that..??

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.