W3Schools Learner's Blog

W3Schools Programming knowledge summary website

div

2/15/2020

how to configure ssl certificate in apache server

How to configure ssl certificate in apache server by ourselves? It's very easy:

First : Apply For SSL

We need to apply for SSL certificate from some certificate provider, then we will get three ssl file, like this:


Next : Upload SSL File

Upload "1_root_bundle.crt" file to "/etc/pki/tls/certs/".
Upload "2_www.xxx.com.crt" file to "/etc/pki/tls/certs/".
Upload "3_www.xxx.com.key" file to "/etc/pki/tls/private/".

Then : Install mod_rewrite.so Module

yum install mod_ssl
Afterword: Configure SSL in "/etc/httpd/conf.d/ssl.conf"
<VirtualHost _default_:443>
 # Website DocumentRoot Directory
 DocumentRoot "/var/www/html/tpyyes/"
 
 # Domain and SSL 443 port
 ServerName www.tpyyes.com:443
 
 # SSL centificate Position
 SSLCertificateFile /etc/pki/tls/certs/2_www.tpyyes.com.crt
 SSLCertificateKeyFile /etc/pki/tls/private/3_www.tpyyes.com.key
 SSLCertificateChainFile /etc/pki/tls/certs/1_root_bundle.crt
</VirtualHost>
Finally : Restart Apache
systemctl restart httpd

No comments:

Post a comment

Note: only a member of this blog may post a comment.