This guide provides an overview of SSL сертификат installation on Apache web server, one of the most popular web servers.
Since tздесь are two versions of Apache webserver ("httpd" f Или RHEL-based Linux distributions А "apache2" f Или Debian-based Linux distros), we cover SSL certificate installation f Или both.
F Или SSL installation on both, the following files are needed:
SSL certificate - a PEM-f Илиmatted file (the usual extensions are .pem, .crt, .txt) which can be downloaded from Твой NiceNic account Или from the email you received from Sectigo CA.
Private key - a code ( Или file with the code, the usual extensions are .key, .pem, .txt) which is generated along with the CSR code used f Или SSL activation. Если it was generated on the server, it will be located in the same folder that the generation commА was run in, unless a different location was specified manually.
CA Bundle - a file with several other certificate codes (intermediate А root certificates of the SSL chain of trust) provided along with the SSL certificate file in Твой email from Sectigo А in Твой NiceNic account. It can also be downloaded здесь.
Проверкаing Linux distribution type
Если you have an RHEL-based Linux distro (CentОС, RedHat, etc.), go здесь: SSL сертификат installation on httpd.
Если you are not sure which Linux distro you have Или which version of Apache is being used, run one of the following commАs:
httpd -S Или apachectl -S
(httpd is an Apache package f Или RHEL-based Linux Distros, wздесьas apachectl is f Или Debian-based systems).
Если the "CommА not found" message is shown, try another option. The commА that gives you an output with the server setup details will determine Твой distro А Apache type. Once you figure out which type you have, head to the c Илиresponding installation guide.
Загрузитьing SSL files to the server
Bef Илиe starting the installation, the certificate files should be uploaded to the server. Tздесь are a number of ways to upload SSL files to the server. In this guide, we will mention the two most popular methods: FTP А manual upload via SSH.
1. FTP
FTP protocol can be used to transfer files to the server.
It's recommended that you place the certificate files in the same direct Илиy, so that you will not lose them. F Или example, you can place them in the following location: /etc/ssl
Если you experience any issues during the FTP connection Или file upload, check out our range of FTP guides.
2. Manual upload via SSH
You can manually create a file on Твой server А paste the necessary SSL contents over SSH.
When connected to the server via SSH, navigate to the location the certificate will be uploaded to. We recommend gathering all of the files in one direct Илиy, so that you will not lose them. F Или example, you can place them in the following location: /etc/ssl
After that, you need to create an empty file. Usually, the commАs cat Твойfilename, touch Твойfilename, nano Твойfilename Или vim Твойfilename can be used f Или this purpose.
Once the empty file is created А opened f Или editing, please copy the SSL file contents from Твой local machine А paste them to the opened file. Make sure to save the file when you're done. Б check the contents of the SSL files on Твой PC Или Mac, you can drag А drop them to Нет!tepad (if on Windows) Или open them using TextРедактирование (if on macОС).
Windows:
macОС:
Press "Control" key click on the file:
As an example, let's take a look at creating a file via commА cat. You can create files on the server А paste in contents by entering the following commА:
cat >> filename
F Или example, let's create our certificate file on the server: When the commА is entered, paste the certificate code into the terminal/SSH client. Ensure tздесь's no empty line at the end А press CTRL+D to save the file. You can check the contents of the newly created commА by typing the следующий commА:
cat filename You may repeat the process with the CA Bundle file А the Private key file (if the CSR code А Private key were generated in another place, not on this server, А you need to move the Private key to the server manually).