install crt into apache

Hi, I am using Apache on debian 8, how do I install a crt file into it? I dont use virtual hosts I dont think... I only host 1 site.

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jason CarsonComputer TechnicianCommented:
1) First enable Apache ssl
sudo a2enmod ssl
sudo a2ensite default-ssl
sudo service apache2 restart

Open in new window

2) Create a directory for your certificates (Example: /etc/certs/) and enter the directory

3) Your certificate provider will require you to create a CSR. Instructions to do so can be found on your cert provider website or you can generate a CSR use the following command.  You will be asked to answer some questions. Once finished  It will create two files: mycert.csr and mycert.key
openssl req -new -newkey rsa:2048 -nodes -keyout mycert.key -out mycert.csr

Open in new window

4) Open the mycert.csr file and copy what's inside. Paste it on your certificate providers website. You will receive 2 certificates. Your certificate plus an intermediate certificate. Put both certs in /etc/certs/. You can name them mycert.crt and intermediate.crt

5) Your apache2 configuration file will be in /etc/apache2/sites-enabled/default-ssl.conf. Open that file. Modify the following lines.
SSLCertificateFile      /etc/certs/mycert.crt
SSLCertificateKeyFile   /etc/certs/mycert.key
SSLCertificateChainFile /etc/certs/intermediate.crt

Open in new window

5) Restart Apache and you should be good to go.

Note: When restarting apache2 it will ask you for a password. To prevent that from happening enter your /etc/certs/ directory and running the following commands
openssl rsa -in mycert.key -out mycert.key2
mv mycert.key mycert.key.orig
mv mycert.key2 mycert.key

Open in new window

Restart apache to make sure it works and is not asking for a password.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
RobogrinchAuthor Commented:
Awesome answers, thank you very much
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Apache Web Server

From novice to tech pro — start learning today.