Now everyone is concerned with getting an SSL certificate, otherwise Google will flag the page as insecure. Let’s Encrypt certificates are at high demand. Here is the manual how to install Let’s Encrypt certificate on CentOS 6.X.
The first step is git installation. Execute the following command: # yum install git.
Then go to /tmp directory: #cd /tmp
Use git to download Let’s Encrypt files. The script is called certbot:
# git clone https://github.com/certbot/certbot
Then go to the directory: # cd certbot
Grant permissions to run script file:
# chmod a+x ./certbot-auto
The next step is getting the certificate.
# ./certbot-auto certonly –webroot –agree-tos –email [email protected] -w /home/bitrix/www/ -d my-domain.com -d www.my-domain.com
Use your email instead of [email protected], it can be used for restoring account.
In -w /home/bitrix/www put root directory of your website.
In -d my-domain.com put your domain, you can use subdomain as well.
After that script will start running. In case any packages are missing the script will suggest to install them. Please confirm and wait.
If everything goes fine you will see confirmation message about successful installation.
It means that the certificates have been installed, not you need to show nginx where the new SSL certificates are stored.
Setting up server
Open ssl.conf file: # vim /etc/nginx/bx/conf/ssl.conf
If you have had other SSL certificates installed before you need to delete or comment out them and insert new ones:
Please check and make sure that ssl is enabled, if not, you need to enable:
Then restart nginx.
# service nginx reload
If no errors are shown, everything went fine. You can check you website.
The certificate is provided for 90 days so after this period you will need to update it, this can be done with the following command: # certbot-auto renew. Either you can add it to cron.