• 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 and Configure OpenSSL Certificate for Apache on REDHAT 8.5

  • 00:06 cat /etc/os-release
  • 00:26 yum install httpd*
  • 00:51 systemctl enable httpd
  • 01:03 systemctl start httpd
  • 01:20 firewall-cmd --permanent --add-service=http
  • 01:37 firewall-cmd --permanent --add-service=https
  • 01:55 firewall-cmd --reload
  • 02:16 yum install mod_ssl
  • 02:34 systemctl restart httpd
  • 02:51 openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/pki/tls/private/apache-selfsigned.key -out /etc/pki/tls/certs/apache-selfsigned.crt
  • 04:31 vim /etc/httpd/conf.d/test.conf
  • 04:53 mkdir /var/www/html/test
  • 05:04 cd /var/www/html/test
  • 05:18 vi index.html
  • 06:03 vim /etc/hosts
  • 06:34 apachectl configtest
  • 06:55 systemctl reload httpd
  • 07:16 firewall-cmd --reload
{{postValue.id}}

To Install and Configure openssl Certificate for Apache on REDHAT 8.5

Introduction:

The SSL/TLS security protocol protects data confidentiality and integrity during transit. By encrypting data between the web browser and web server, it ensures confidentiality. Furthermore, the webserver and browser exchange keys to decrypt the data, ensuring its integrity.

Installation Procedure:

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

[root@linuxhelp ~]# cat /etc/os-release 
NAME="Red Hat Enterprise Linux"
VERSION_ID="8.5"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Red Hat Enterprise Linux 8.5 (Ootpa)"

Step 2: Install the Apache Web Server by using the below command

[root@linuxhelp ~]# yum install httpd
Updating Subscription Management repositories.
Unable to read consumer identity
================================================================================
 Package             Arch    Version                                   Repo
                                                                           Size
================================================================================
Installing:
apr-util-bdb        x86_64  1.6.1-6.el8                               1   25 k
 apr-util-openssl    x86_64  1.6.1-6.el8                               1   27 k

Transaction Summary
================================================================================
Install  17 Packages

Total download size: 5.9 M
Installed size: 19 M
Is this ok [y/N]: y
Downloading Packages:
(1/17): apr-1.6.3-12.el8.x86_64.rpm             6.4 MB/s | 130 kB     00:00    
(16/17): openldap-devel-2.4.46-18.el8.x86_64.rp  61 MB/s | 812 kB     00:00    
(17/17): redhat-logos-httpd-84.5-1.el8.noarch.r  10 MB/s |  29 kB     00:00    
--------------------------------------------------------------------------------
 
  redhat-logos-httpd-84.5-1.el8.noarch                                          

Complete!

Step 3: Enable the Services of Apache server by using the below command

 [root@linuxhelp ~]# systemctl enable httpd
Created symlink /etc/systemd/system/multi-user.target.wants/httpd.service → /usr/lib/systemd/system/httpd.service.

Step 4: Start the Services of Apache server by using the below command

 [root@linuxhelp ~]# systemctl start httpd

Step 5: Add the firewall for http by using the below command

[root@linuxhelp ~]# firewall-cmd --permanent --add-service=http
Success

Step 6: Add the firewall for https by using the below command

[root@linuxhelp ~]# firewall-cmd --permanent --add-service=https
Success

Step 7: Reload the Firewall by using the below command

[root@linuxhelp ~]# firewall-cmd --reload
success

Step 8: Install The mod_ssl ,an Apache module for SSL encryption by using the below command

 [root@linuxhelp ~]# yum install mod_ssl
Updating Subscription Management repositories.
Unable to read consumer identity

This system is not registered with an entitlement server. You can use subscription-manager to register.

Last metadata expiration check: 0:02:42 ago on Friday 13 May 2022 08:15:27 AM IST.
Dependencies resolved.
================================================================================
 Package    Arch      Version                                        Repo  Size


================================================================================
Installing:
 mod_ssl    x86_64    1:2.4.37-41.module+el8.5.0+11772+c8e0c271      1    136 k
Is this ok [y/N]: y
Downloading Packages:
mod_ssl-2.4.37-41.module+el8.5.0+11772+c8e0c271  21 MB/s | 136 kB     00:00    
--------------------------------------------------------------------------------
Complete!

Step 9: Restart the apache server by using the below command

 [root@linuxhelp ~]# systemctl restart httpd

Step 10: create the SSL key and certificate by using the below command

 [root@linuxhelp ~]# openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/pki/tls/private/apache-selfsigned.key -out /etc/pki/tls/certs/apache-selfsigned.crt
Generating a RSA private key
Country Name (2 letter code) [XX]:IN
State or Province Name (full name) []:TN
Locality Name (eg, city) [Default City]:CHENNAI 
Organization Name (eg, company) [Default Company Ltd]:EXAMPLE
Organizational Unit Name (eg, section) []:EXAMPLE 1
Common Name (eg, your name or your server's hostname) []:192.168.6.127
Email Address []:linuxserver@example.com

Step11: Create the Virtual Host configuration by using the below command

[root@linuxhelp ~]# vim /etc/httpd/conf.d/test.conf
<VirtualHost *:443>
    ServerName linuxhelp.com
    DocumentRoot /var/www/html/test
    SSLEngine on
    SSLCertificateFile /etc/pki/tls/certs/apache-selfsigned.crt
    SSLCertificateKeyFile /etc/pki/tls/private/apache-selfsigned.key
</VirtualHost>

Step 12: Make the directory by the name of test by using the below command

 [root@linuxhelp ~]# mkdir /var/www/html/test

Step 13: change the directory on following path by using the below command

[root@linuxhelp ~]# cd /var/www/html/test

Step 14: Create .html extension file by using the below command

 [root@linuxhelp test]# vi index.html
	<h1> welocome To Linuxhelp.com</h1>

Step 15: put the host entry by using the below command

 [root@linuxhelp test]# vim /etc/hosts
	192.168.6.127 linuxhelp.com                          

Step 16: Check the Apache configuration for syntax errors by using the below command

 [root@linuxhelp test]# apachectl configtest
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using fe80::20c:29ff:fe86:be5c. Set the 'ServerName' directive globally to suppress this message
Syntax OK

Step 17: Reload the Apache server by using the below command

[root@linuxhelp test]# systemctl reload httpd

Step 18: Reload the firewall by using the below command

 [root@linuxhelp test]# firewall-cmd --reloads
success

Step 19: Go to your favorite Browser and search your domain as shown in the below image snap 1

Step 20 click Advanced as shown in the below image Snap 2

Step 21: Click Accept the Risk and Continue as shown in the below image Snap 3

Output Snap 4

By this to Install and Configure openssl Certificate for Apache on REDHAT 8.5 is Completed.

Tags:
sebastian
Author: 

Comments ( 0 )

No comments available

Add a comment
{{postCtrl.cmtErrMsg}}

Frequently asked questions ( 5 )

Q

1, What are SSL/TLS certificates?

A

Ans: SSL/TLS is a standard security protocol that ensures the confidentiality and integrity of data while in transit. It encrypts the data flow between the web browser and web server, hence ensuring confidentiality. Also, the webserver and browser exchanges key to decrypt the data, which ensures the integrity of the data.

Q

2. What is a Certificate Signing Request (CSR)?

A

Ans: Certificate Signing Request or CSR is encoded information that contains the applicant's information such as a common name, a name of an organization, email address, city, state, and country. This encoded information is used by certifying authority (CA) to issue an SSL certificate to the applicant.

Q

3. Discuss some public-key encryption algorithms used in SSL.

A

Ans: Public key encryption is used to exchange the symmetric key between browser and web server. Some of the algorithms used Elliptic curve cryptography (ECC), RSA, etc.

Q

4. What does S/MIME do in OpenSSL?

A

Ans: The OpenSSL S/MIME utility is useful for signing and encrypting S/MIME messages. S/MIME messages can be signed by multiple signers, encrypted, decrypted, and verified.

Q

5. What do you mean by X509 in OpenSSL?

A

Ans: The x509 command is a multi-purpose certificate utility. It can be used to display certificate information, convert certificates to various forms, sign certificate requests like a "mini CA" or edit certificate trust settings.

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 Jayce ?
What are the types of table used in IPtables

What are the various types of table used in IPtables and how to use that for my server security?

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.