Setting Up SSL Certificates in Apache
SSL Certificate Options
- The easiest way to get signed certs on your PBX is to create Let's Encrypt certs via the "Certificate Management" module. The down side is they have to be refreshed every 2 months.
- If you don't want to use Let's Encrypt certs you can also use the "Certificate Management" module to install signed certs purchased through a trusted certificate authority.
- You can also just use the pre-installed self signed certs. Many browsers and devices will not trust self-signed certs and may have issues using them. Whenever possible signed certs are preferred.
Once you have the certs installed on the PBX via "Certificate Management" you'll need to link them to Apache.
Linking Certificates in Apache Without Registered System Admin
- If your system isn't registered with Sangoma, and you don't want to register it, you'll need to manually copy the certs installed via Certificate Management to the Apache Directory.
- SSH into your PBX using an ssh client like PuTTy and make sure you have root/sudo access.
- Find your certs. In the case of Lets Encrypt certs they will be named FQDN.pem/crt/key etc.
-
ll -tr /etc/asterisk/keys/
- Create the pki directory in /etc/httpd/
mkdir /etc/httpd/pki
- Copy your certs from /etc/asterisk/keys/ to /etc/httpd/pki/ as below changing the <CertName> part of the filename to match your cert names.
Example:
cp /etc/asterisk/keys/<CertName>-ca-bundle.crt /etc/httpd/pki/ca-bundle.crt
cp /etc/asterisk/keys/<CertName>.crt /etc/httpd/pki/webserver.crt
cp /etc/asterisk/keys/<CertName>.key /etc/httpd/pki/webserver.key
cp /etc/asterisk/keys/<CertName>.pem /etc/httpd/pki/webserver.pem
-
Once that's done restart apache via systemctl
systemctl restart httpd.service
-
You shouldn't see any messages once the restart finishes. If you do there was an error and you'll need to fix before Apache will run.
Linking Certificates in Apache via Registered System Admin
Once you have the certs installed on the PBX via "Certificate Management" you'll need to link them to apache.
If your system is registered with Sangoma then you can use the HTTPS Setup in System Admin
- Go to Admin --> System Admin
- Select HTTPS Setup from the right hand menu
- Select the Settings Tab
- Select your Cert from the drop down and Click Install