[go: up one dir, main page]

0% found this document useful (0 votes)
157 views2 pages

Manually Install An SSL Certificate On My Apache Server

To manually install an SSL certificate on an Apache server running Ubuntu: 1. Upload the certificate and key files to their storage directory, making them only readable by root. 2. Find the Apache configuration file, typically apache2.conf in /etc/apache2, and open it in a text editor. 3. Make a copy of the existing <VirtualHost> block and modify it to configure secure connections over port 443, specifying the certificate, key, and chain files. 4. Test the configuration for errors and restart Apache if no errors are found.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
157 views2 pages

Manually Install An SSL Certificate On My Apache Server

To manually install an SSL certificate on an Apache server running Ubuntu: 1. Upload the certificate and key files to their storage directory, making them only readable by root. 2. Find the Apache configuration file, typically apache2.conf in /etc/apache2, and open it in a text editor. 3. Make a copy of the existing <VirtualHost> block and modify it to configure secure connections over port 443, specifying the certificate, key, and chain files. 4. Test the configuration for errors and restart Apache if no errors are found.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Manually install an SSL certificate on my

Apache server (Ubuntu)


1. Find the directory on your server where certificate and key files are stored, then
upload your intermediate certificate (gd_bundle.crt or similar) and primary
certificate (.crt file with randomized name) into that folder.
o For security, you should make these files readable by root only.
2. Find your Apache configuration file.
o On default configurations, you can find a file named apache2.conf in the
/etc/apache2 folder.
o If you have configured your server differently, you may be able to find the
file with the following command:

grep -i -r "SSLCertificateFile" /etc/apache2/

▪ /etc/apache2/ may be replaced with the base directory of your


Apache installation.
3. Open this file with your favorite text editor.
4. Inside your apache2.conf file, find the < VirtualHost > block.
5. To have your site available on both secure (https) and non-secure (http)
connections, make a copy of this block and paste it directly below the existing <
VirtualHost > block.
6. You can now customize this copy of the < VirtualHost > block for secure
connections. Here is an example configuration:

<VirtualHost xxx.xxx.x.x:443>
DocumentRoot /var/www/coolexample
ServerName coolexample.com www.coolexample.com
SSLEngine on
SSLCertificateFile /path/to/coolexample.crt
SSLCertificateKeyFile /path/to/privatekey.key
SSLCertificateChainFile /path/to/intermediate.crt
</VirtualHost>

o Don't forget the added 443 port at the end of your server IP.
o DocumentRoot and ServerName should match your original < VirtualHost
> block.
o The remaining/path/to/... file locations can be replaced with your
custom directory and file names.

7. First, run the following command to check your Apache configuration file for
errors:

apache2ctl configtest
8. Confirm that the test returns a Syntax OK response. If it does not, review your
configuration files.

Warning: The Apache service will not start again if your config files have syntax
errors.

9. After confirming a Syntax OK response, run the following command to restart


Apache:

apache2ctl restart

You might also like