Apply SSL Certificate to PerfSONAR and MaDDash Webservers
Introduction: This document provides instructions on setting up SSL for use with perfSONAR web tools. These steps are the same for both the perfSONAR Toolkit and MaDDash web tools.
- Install OpenSSL and make sure you can run the openssl command.
Run the following command to generate an unencrypted key for the server.
openssl genrsa -out server.key 2048
Run the following command to create a certificate sign request.
openssl req -new -key server.key -out server.csr
- You will be asked for multiple different kinds of information, like Country, State/Province, etc. Make sure that when you are prompted for "Common Name" to use the domain "Fully Qualified Domain Name" of the server.
- For a standard perfSONAR node, the Fully Qualified Domain Name is usually just the hostname of the server.
- Send the CSR file to a Certifying Authority (CA) or to a member of your organization's IT department that can do this. You will then be given a certificate file (e.x. server.crt or server.cer ) and a certificate chain file (e.x. server.ca-bundle or server_interm.cer ).
- Run the following commands to place the server.key and the server.crt files into a secure location with proper permissions.
You can use another directory besides /etc/ssl/private and /etc/ssl/certs/, but make sure they have the same ownership and access permissions to prevent unauthorized access. This is especially true for the private key.
Open /etc/httpd/conf.d/ssl.conf . This is the configuration file the Apache web server uses for SSL settings. Note the VirtualHost section of the file.
<VirtualHost _default_:443>
# General setup for the virtual host, inherited from global configuration
#DocumentRoot "/var/www/html"
#ServerName www.example.com:443
...
SSLCertificateFile /etc/pki/tls/certs/localhost.crt
...
SSLCertificateKeyFile /etc/pki/tls/private/localhost.key
...
SSLCertificateChainFile /etc/pki/tls/certs/ca-bundle.crt
...
</VirtualHost>Change the file for SSLCertificateFile, SSLCertificateKeyFile, and SSLCertificateChainFile to the server certificate, key, and certificate chain respectively you have from the prior steps.
<VirtualHost _default_:443>
# General setup for the virtual host, inherited from global configuration
#DocumentRoot "/var/www/html"
#ServerName www.example.com:443
...
SSLCertificateFile /path/to/server.crt
...
SSLCertificateKeyFile /path/to/server.key
...
SSLCertificateChainFile /path/to/server.ca-bundle
...
</VirtualHost>Restart the webserver with the following command.
systemctl restart httpd
Related content
Center for Computational Sciences