How to configure SSL certificate for Apache2 Ubuntu server

Select an SSL certificate from the CA organization and apply for an SSL certificate after generating a certificate signing request on the Apache2 Ubuntu server. Provide the required information to the certificate authority (CA), wait for the review, and after the verification is passed, the SSL certificate will be issued, and then follow the simple methods listed below to configure and install.

1. The CA organization sends the license in the form of a zip file via email. The zip file will contain the main certificate, intermediate certificate and root certificate files. Download and decompress the zip file on the server where you want to keep all the certificate files;

2. Find the Apache configuration file on the Apache2 Ubuntu server in the following location:

/etc/apache2/sites-enabled/Domain_name

If you cannot find the configuration file, type the following code in the command:

sudo a2ensite domain name

3. Open the Apache configuration file in a text editor, and then search for the Apache Setting block;

Note: If you want to use HTTPS and HTTP to access the site at the same time, you need two different "/etc/apache2/sites-enabled/Domain_name" files, one for port 80 and one for port 443.

4. Then use the following code to configure:

SSLCertificateFile/path/to/Domain-Name.crt

DocumentRoot/var/www/SSLEngine SSLCertificateKeyFile/path/to/Private.Key SSLCertificateChainFile/path/to/Intermediate.crt

Note: 1) SSLCertificateFile refers to the main SSL certificate file

2) SSLCertificateKeyFile corresponds to the private key file you received in the process of generating CSR

3) SSLCertificateChainFile refers to the intermediate certificate file received from your SSL certificate authority.

Now, restart Apache and install the SSL certificate on the Apache2 Ubuntu server to complete the configuration.

Guess you like

Origin blog.csdn.net/WoTrusCA/article/details/111309505