Find apache2 configuration files where have ssl.conf file and check in the file sslengine on/off, we can see website source file location, certificate locations.
systemctl status httpd
cat /etc/httpd/conf.d/ssl.conf
-
Online
-
Command Line
From a browser search [ Generate csr from online ] we can see some online csr generated website. Then choose any trusted website and generate csr with private key.
Access any link and filup there form as your domain information. Then click generate button and download or copy paste csr & key file.
This way we need to access that server terminal and run a single line command for generate private key and csr.
mkdir -p /etc/httpd/ssl/
chmod 700 /etc/httpd/ssl/
cd /etc/httpd/ssl/
openssl req -new -newkey rsa:2048 -nodes -keyout exampledomain.com.key -out exampledomain.com.csr
Common Name:www.paulco.xyz - (website address) This is Too Important.
Common Name(CN): www.paulco.xyz
Organization: Computing Technology
Organization Unit (OU): IT
City or Locality: Dhaka
State or Province: Dhaka
Country: BD
ls -ln
exampledomain.com.key exampledomain.com.csr
Create a backup the .key file as it will be required later when installing your SSL certificate in apache2.
upzip the .zip file in we got 3 files.
Note: The 3 certificates are.
-
TrustedRoot.crt
-
DigiCertCA.crt
-
Yourdomain.crt
Put this certificates file on /etc/httpd/ssl/
location.
Copy TrustedRoot.crt DigiCertCA.crt Yourdomain.crt /etc/httpd/ssl/
Some Times need to that.
Concatenate the primary and intermediate certificates
cat Yourdomain.crt DigiCertCA.crt TrustedRoot.crt >> sslbundle.crt
Find to .conf file for locate ssl configuration file.
find ssl.conf
find / -name "ssl.conf"
OR
locate ssl.conf
locate .conf
<VirtualHost *:443>
DocumentRoot /var/www/html
ServerName www.paulco.xyz
SSLEngine on
SSLCertificateFile /etc/httpd/ssl/certificate.crt
SSLCertificateKeyFile /etc/httpd/ssl/private.key
SSLCertificateChainFile /etc/httpd/ssl/nssd_navy_mil_bd.crt
SSLCACertificateFile /etc/httpd/ssl/My_CA_Bundle.ca-bundle
</VirtualHost>
To redirect traffic to become SSL encrypted, go ahead and open a file ending in .conf in the /etc/httpd/conf.d directory:
nano /etc/httpd/conf/httpd.conf
<VirtualHost *:80>
ServerName www.example.com
Redirect "/" "https://www.paulco.xyz/"
</VirtualHost>
Once completed, save and close the file.
apache2ctl -t
apachectl configtest
service apache2 restart
systemctl restart httpd
service httpd restart
apachectl stop
apachectl start
service httpd status
/etc/apache2/sites-enabled/your domain.conf
netstat -tupan | grep -i http
netstat -tulpn | grep --colorb:80