SSL Setup For Server
SSLs encrypt internet traffic and are required by most browsers currently. Without an SSL you will be given a warning saying the site isn’t safe, or similar.
Adding an SSL can only be done by an administrator and is typically handled by Anovys for you.
Creating The First SSL
- Create the CSR from the CLI
openssl req -new -newkey rsa:2048 -nodes -keyout sprout.domain.tld.key -out sprout.domain.tld.csr
- Copy the resulting key file to the /etc/ssl/private directory
sudo cp sprout.domain.tld.key /etc/ssl/private/
- Submit the resulting CSR to the certification authority (CA) for validation
- The CA will provide a server and a CA bundle upon validation. Those two files must be combined into the ssl-bundle.crt file.
- To accomplish this do the following:
sudo nano /etc/ssl/certs/ssl-bundle.crt
- First copy the sprout.domain.tld.crt data in to the new file
- Second copy the sprout.domain.tld-ca-bundle data into the new file
- Save the new file
- Edit the Nginx config and add the following data immediately after the call out for port 80
- The file is in /etc/nginx/sites-available
listen 443;
server_name sprout.domain.tld;
ssl on;
ssl_certificate /etc/ssl/certs/ssl-bundle.crt;
ssl_certificate_key /etc/ssl/private/sprout.domain.tld.key;
ssl_prefer_server_ciphers on;
- Save the config file
- Restart Nginx
sudo /etc/init.d/nginx restart
- Test via a web browser
Renewing An SSL
- Create the CSR from the CLI
openssl req -new -newkey rsa:2048 -nodes -keyout sprout.domain.tld.key -out sprout.domain.tld.csr
- Copy the resulting key file to the /etc/ssl/private directory
sudo cp sprout.domain.tld.key /etc/ssl/private/
- Submit the resulting CSR to the certification authority (CA) for validation
- The CA will provide a server and a CA bundle upon validation. Those two files must be combined into the ssl-bundle.crt file.
- To accomplish this do the following:
sudo nano /etc/ssl/certs/ssl-bundle.crt
- Remove all current data in the ssl-bundle.crt file
- Copy the sprout.domain.tld.crt data in to the new file
- Copy the sprout.domain.tld-ca-bundle data into the new file
- Save the file
- Restart Nginx
sudo /etc/init.d/nginx restart
- Test via a web browser
