Home/Article
Esadax JournalFAQ

Generating a CSR and Installing SSL on AWS AMI Linux Instance

To install an SSL certificate on your Amazon AMI Linux instance, follow these organized steps: * Create a configuration file (example.com.cnf) with your domain details. * Generate the CSR and private key:

To install an SSL certificate on your Amazon AMI Linux instance, follow these organized steps:

    • Create a configuration file (example.com.cnf) with your domain details.
    • Generate the CSR and private key:
  1. Submit CSR to Certificate Authority (CA):
    • Upload csr.pem to your CA provider (e.g., Esadax) to obtain certificate files.
    • Create a temporary key for installation:
    • Ensure the temp key is securely managed and removed after use.
  2. Restart Relevant Services:
    • For Nginx: sudo nginx -s reload
    • For Apache: sudo systemctl reload apache2
  3. Verify SSL Installation:
    • Use openssl s_client to check the certificate and ensure it's trusted.

Set Permissions:

chmod 600 privateKey.pem
chmod 600 temp.pem

Install SSL Certificate on Linux Instance:

sudo openssl x509 -req -in server.crt -key -out temp.pem -days 365 -nodes

Combine Certificate and Private Key:

cat privateKey.pem certificate.pem > server.crt

Generate CSR and Private Key:

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
Subscribe