Skip to content

Instantly share code, notes, and snippets.

@mthabsheer
Created May 22, 2018 18:22
Show Gist options
  • Save mthabsheer/c10aeb5ec974c6229ca6aa9a2d12b359 to your computer and use it in GitHub Desktop.
Save mthabsheer/c10aeb5ec974c6229ca6aa9a2d12b359 to your computer and use it in GitHub Desktop.
#This file covers the steps for installing the SSL certificate in the Ubuntu 16.04 server.
1.Generate CSR
openssl req -new -newkey rsa:2048 -nodes -keyout domain.key -out domain.csr
This will prompt for the following options
Common Name: The fully-qualified domain name, or URL, you're securing.
If you are requesting a Wildcard certificate, add an asterisk (*) to the left of the common name where you want the wildcard, for example *.coolexample.com.
Organization: The legally-registered name for your business. If you are enrolling as an individual, enter the certificate requestor's name.
Organization Unit: If applicable, enter the DBA (doing business as) name.
City or Locality: Name of the city where your organization is registered/located. Do not abbreviate.
State or Province: Name of the state or province where your organization is located. Do not abbreviate.
Country: The two-letter International Organization for Standardization (ISO) format country code for where your organization is legally registered.
2. Login to the DNS manage and upload the CSR
3. After verification the certificate will be ready.
4. Download the certificate and upload the crt and bundle.crt to the server.
5. a2ensite example_your_domain
By default there will default-ssl.conf in the /etc/apache2/sites-available folder. The above command will copy this defualt conf to site-enabled folder.
Edit the file and configure the values as below:
SSLCertificateFile /path/to/example _your _domain.crt
SSLCertificateKeyFile /path/to/your_private.key
SSLCertificateChainFile /path/to/CertificateAuthority.crt
6. Enable the SSL in apache using command: a2enmod ssl
7. Restart the apache: service apache2 restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment