How to implement ssl certificate for webmail in debian server 9.12 (stretch)?

46 views Asked by At

I am trying to implement a paid SSL certificate for a specific domain like webmail.domain.com in a mail server. I know has something to do with apache but I am not sure where specifically. Please can somebody help me?

1

There are 1 answers

0
Sotmir Laci On

I recently found a solution to make it work so I thought might be helpful if I will post it here. So basically I did this: I created a folder named ssl.crt in /etc/apache2/ and placed inside it the certificate files webmail.domain.com.bundle webmail.domain.com.crt webmail.domain.com.key. Then entered the conf-enabled folder placed in /etc/apache2/ and created a vhost configuration file named as my website domain name to webmail-domain-ssl.conf and entered this code inside it:

<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /opt/roundcube
ServerName webmail.domain.com

RewriteEngine On
RewriteRule ^(.*)$ https://%{HTTP_HOST}$1 [R=301,L]
</VirtualHost>

<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerAdmin [email protected]
DocumentRoot /opt/roundcube
ServerName webmail.domain.com

ErrorLog ${APACHE_LOG_DIR}/error.log
SSLEngine On
SSLProtocol All -SSLv2 -SSLv3
SSLHonorCipherOrder     on

SSLCertificateFile /etc/apache2/ssl.crt/webmail.domain.com.crt
SSLCertificateKeyFile /etc/apache2/ssl.crt/webmail.domain.com.key
SSLCertificateChainFile /etc/apache2/ssl.crt/webmail.domain.com.bundle
</VirtualHost>
</IfModule>