Home/Article
Esadax JournalFAQ

Installing an SSL Certificate on Apache via SSH

To manually upload an SSL certificate using SSH, follow these organized steps: 1. Connect to your server via SSH: * Open a terminal on your local machine. * Type the command: ssh user@example.

To manually upload an SSL certificate using SSH, follow these organized steps:

  1. Connect to your server via SSH:
    • Open a terminal on your local machine.
    • Type the command: ssh user@example.com where user is your username and example.com is your server's hostname.
  2. Navigate to the appropriate directory:
  3. Create a new directory for SSL files (optional):
  4. Create an empty file for the SSL certificate:
  5. Copy the SSL certificate contents to the server:
    • Copy the SSL certificate from your local machine to the terminal.
    • Press Ctrl+D to save the file.
  6. Verify the SSL certificate:
  7. Repeat for CA bundle and private key (if needed):
    • Create files for each additional required file (e.g., ca_bundle.crt and private_key.pem).
    • Upload their contents similarly.
  8. Check for errors:
    • Ensure all files are correctly formatted without extra spaces or lines.

Remove any empty or incorrect files using:

rm -f /etc/ssl/certs/file_name

Check if the file was created correctly by viewing its contents:

cat /etc/ssl/certs/server.crt

Use cat >> /etc/ssl/certs/server.crt and paste the content, ensuring no extra lines are added:

cat >> /etc/ssl/certs/server.crt

Use touch to create an empty file, e.g., server.crt:

touch server.crt

Create a subdirectory within /etc/ssl:

mkdir -p /etc/ssl/certs

Use the cd command to move to the desired location, such as certificates:

cd /etc/ssl/certs
Subscribe