User Tools

Site Tools


apache

Admin Howtos

Virtualhost and SSL Certificate

Say you have a new domain mydomain.com and you want a virtualhost and a signed SSL Certificate. Here is a Howto:

1. Create a self-signed certificate

cd /etc/apache2/ssl/
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout mydomain.com.key -out mydomain.com.crt

2. Configure the virtualhost with self-signed certificate

cd /etc/apache2/sites-enabled
vim default-ssl.conf

add a virtualhost:

<VirtualHost *:443>
        ServerName mydomain.com
        # Redirect 302 / https://www.google.com/
 
        SSLEngine on
        SSLCertificateFile /etc/apache2/ssl/mydomain.com.crt
        SSLCertificateKeyFile /etc/apache2/ssl/mydomain.com.key
</VirtualHost>

3. Create a certification request

TBD! see https://help.ubuntu.com/lts/serverguide/certificates-and-security.html

openssl req -new -key mydomain.com.key -out mydomain.com.csr
apache.txt · Last modified: 2016/08/18 12:13 by hkoller