Category: Tech Stuff | Posted on: 2021-04-27 15:20:50 | Updated on: 2021-04-27 15:57:22 | Posted by: Admin User
Steps to install SSL certificate generated from RapidSSL on your AWS EC2 (Amazon Linux AMI) instance running LAMP server
Following are the steps to install SSL certificate on an AWS EC2 (Amazon Linux AMI) instance running LAMP server.
sudo yum install -y mod24_ssl
openssl req -new -newkey rsa:4096 -nodes -keyout private.key -out certificate.csr
Country Name (2 letter code) [XX]: IN
State or Province Name (full name) []: Chandigarh
Locality Name (eg, city) [Default City]: Chandigarh
Organization Name (eg, company) [Default Company Ltd]: XYZ Pvt Ltd
Organizational Unit Name (eg, section) []: BLOG
Common Name (eg, your name or your server's hostname) []: mydomain.com
Email Address []: admin@mydomain.com
private.key
file is the one created in step-2.b above./etc/httpd/conf.d/ssl.conf
file to use above paths.
SSLCertificateFile /etc/pki/tls/certs/certificate.crt
SSLCertificateKeyFile /etc/pki/tls/private/private.key
SSLCertificateChainFile /etc/pki/tls/certs/DigiCertCA.crt
Make sure that HTTPS traffic is allowed on your server.
For more details check https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/SSL-on-amazon-linux-ami.html
Note:
Sometimes you might also have to add chain certificate.
In such case, please visit https://whatsmychaincert.com and test whether your server is using correct chain certificate.
If not, then you can get the chain certificate from RapidSSL and upload to /etc/pki/tls/certs/server-chain.crt
.
Make sure to edit /etc/httpd/conf.d/ssl.conf
to use appropriate path of the chain certificate.