-
Notifications
You must be signed in to change notification settings - Fork 15
apache self signed cert
Wiki ▸ Server Installation ▸ Apache fonting Tomcat▸ Certificate
These instructions show how to create a self signed certificate for the Apache web server fronting the Biobank Tomcat server. The certificate will allow the Biobank client to log into the server using the DNS name and the IP address.
-
In a shell create a new directory to hold the certificate :
cd /etc/apache2 mkdir ssl
-
Create a file named
apache.cnf
with the following content, but replace__YOUR_IP_ADDRESS_HERE___
with the IP address for the server:[req] distinguished_name = req_distinguished_name req_extensions = v3_req [req_distinguished_name] countryName = Country Name (2 letter code) countryName_default = CA localityName = Locality Name (eg, city) organizationalUnitName = Organizational Unit Name (eg, section) commonName = Common Name (eg, YOUR name) commonName_max = 64 emailAddress = Email Address emailAddress_max = 40 [v3_req] keyUsage = keyEncipherment, dataEncipherment extendedKeyUsage = serverAuth subjectAltName = @alt_names [alt_names] IP.1 = __YOUR_IP_ADDRESS_HERE___
-
Create a private key:
openssl genrsa -out apache.key 2048
-
Create the certificate signing request:
openssl req -new -key apache.key -out apache.csr -config apache.cnf
-
Sign the certificate signing request, and generate the certificate:
openssl x509 -req -days 3650 -in apache.csr -signkey apache.key -out apache.crt -extensions v3_req -extfile apache.cnf
-
Edit the file
/etc/apache2/sites-available/default-ssl
change the following lines:SLEngine on SSLCertificateFile /etc/apache2/ssl/apache.crt SSLCertificateKeyFile /etc/apache2/ssl/apache.key
You can now restart the Apache web server with the command:
service apache2 restart