To install an SSL certificate on your Amazon AMI Linux instance, follow these organized steps:
Generate CSR and Private Key:
example.com.cnf) with your domain details.echo '[NewRequest]' > example.com.cnf
echo 'Subject = "/C=US/ST=CA/L=Mountain View/O=My Company/OU=IT/CN=myserver"' >> example.com.cnf
echo 'Exportable = TRUE' >> example.com.cnf
echo 'KeyLength = 2048' >> example.com.cnf
echo 'KeySpec = 1' >> example.com.cnf
echo 'KeyUsage = 0xf0' >> example.com.cnf
echo 'MachineKeySet = TRUE' >> example.com.cnf
openssl req -key privateKey.pem -out csr.pem -reqext -config example.com.cnf
Submit CSR to Certificate Authority (CA):
csr.pem to your CA provider (e.g., Esadax) to obtain certificate files.Combine Certificate and Private Key:
cat privateKey.pem certificate.pem > server.crt
Install SSL Certificate on Linux Instance:
sudo openssl x509 -req -in server.crt -key -out temp.pem -days 365 -nodes
Set Permissions:
chmod 600 privateKey.pem
chmod 600 temp.pem
Restart Relevant Services:
sudo nginx -s reloadsudo systemctl reload apache2Verify SSL Installation:
openssl s_client to check the certificate and ensure it's trusted.