How to Configure Apache Server with SSL certificates (https) in CentOS 7, Redhat 7, Fedora - Linux tech Solutions
How to Configure Apache Server with SSL certificates (https) in CentOS 7, Redhat 7, Fedora
In cryptography and computer security, a self-signed certificate is an identity certificate that is signed by the same entity whose identity it certifies. This term has nothing to do with the identity of the person or organization that actually performed the signing procedure. In technical terms a self-signed certificate is one signed with its own private key.
Http/Apache is used to host a single website or multiple website on system with static IP address.The Apache HTTP Server, is free and open-source cross-platform web server software, released under the terms of Apache License 2.0. Apache is developed and maintained by an open community of developers under the auspices of the Apache Software Foundation.
Package httpd , mod_ssl , openssl(To Generate SSL Certificate)
http - 80
https - 443
Selinux context httpd_sys_content_t
Main Configuration filfe /etc/httpd/conf/httpd.conf
Document root /var/www/html
Server Configuration :-
To configure Apache server we must have an static ip.
1 )first of all we will install the httpd , mod_ssl , openssl packages :-
2 )Now we will create our own configuration file in /etc/httpd/conf.d
You can create with the configuration file with any name but the file extension must be .conf .
In this configuration file you have to give the following parameters:-
3)Now we will generate the ssl certificates :-
4)Now just move the Generated server.crt file and server.key file to their desired Locations.
[[email protected] ~]#mv server.key /etc/pki/tls/private/
5)Now go to the hosts file and edit the entries.
# [Your IP] [Your Domain]
6)Now Create a file in the Document root directory.
[[email protected] ~]#vim index.html
#[Your HTML code you want to add to your website]
7)Now start the httpd service and enable it.
If there is any error during running the httpd service then there is some mistake in the coniguration file.
To check the sytax of the configuration file.
8)Now apply the firewall rule.
[[email protected] ~]#firewall-cmd --reload
9)Now open your website on firefox.
[It will show connection is not secure then click on "Advanced" and then click on "Add Exceptions" and then on click on "Confirm Security Exception".