Securing Your ISPConfig 3 Installation With A Free Class1 SSL Certificate From StartSSL
|
Submitted by falko (Contact Author) (Forums) on Tue, 2012-01-17 17:50. :: Debian | ISPConfig | Ubuntu | Web Server | Apache | Control Panels | Email | nginx | Postfix
Securing Your ISPConfig 3 Installation With A Free Class1 SSL Certificate From StartSSLVersion 1.0 This tutorial shows how you can use a free Class1 SSL Certificate from StartSSL to secure your ISPConfig 3 installation and get rid of self-signed certificate warnings. The guide covers using the SSL certificate for the ISPConfig web interface (both Apache2 and nginx), Postfix (for TLS connections), Courier and Dovecot (for POP3s and IMAPs), and PureFTPd (for TLS/FTPES connections). If you've installed monit and use HTTPS for its web interface, I will show you how to use the StartSSL certificate for it as well. This guide assumes you use Debian or Ubuntu; the principle is the same for other distributions supported by ISPConfig 3, but paths might differ. I do not issue any guarantee that this will work for you!
1 Preliminary NoteI assume you have used one of the guides from http://www.ispconfig.org/ispconfig-3/documentation/ to set up your system. As I've mentioned before, I will concentrate on Debian/Ubuntu in this guide, but it should work for other distributions supported by ISPconfig 3 as well (you might have to adjust some paths though). I will use the hostname server1.example.com here; StartSSL allows you to create the Class1 certificate for the main domain and one subdomain, so I will create the certificate for example.com and server1.example.com. This means that you must tell your users to use the main domain example.com or the subdomain server1.example.com for all services (ISPConfig web interface, Postfix, Courier/Dovecot, PureFTPD, etc.) because otherwise they will get certificate warnings. If you prefer to use different hostnames for your services (e.g. mail.example.com for Postfix, ispconfig.example.com for ISPConfig, etc.), I suggest you get a Class2 certificate from StartSSL. It isn't free, but allows you to create it for multiple subdomains (you can even use *.example.com to create it for all subdomains) and even multiple domains. The instructions are the same, except that when I use StartSSL's sub.class1.server.ca.pem intermediate certificate, you must use sub.class2.server.ca.pem instead. I will outline this difference throughout the tutorial. I'm running all the steps in this tutorial with root privileges, so make sure you're logged in as root. If you use Ubuntu, run... sudo su ... to get root privileges.
2 Creating A Certificate Signing Request (CSR)We need a Certificate Signing Request (CSR) to get an SSL certificate from StartSSL. Since the ISPConfig installer (for versions >= 3.0.4) creates this anyway, I will use this CSR as the basis for encrypting all services (ISPConfig, Postfix, etc.). Since ISPConfig version 3.0.4, the ISPConfig installer offers the option to use SSL encryption for the ISPConfig web interface, it creates a self-signed certificate (4096bits) including a CSR if you answer the following question with ENTER or y: Do you want a secure (SSL) connection to the ISPConfig web interface (y,n) [y]: <-- ENTER To make the ISPConfig installer create the CSR with the correct data, you must enter the correct details when you see these questions: Generating RSA private key, 4096 bit long modulus Please enter the following 'extra' attributes If you have initially created the certificate with the wrong data, you can either update ISPConfig by running... ispconfig_update.sh ..., or, if you have the latest version installed already, run the following commands: cd /tmp This will allow you to create a new certificate for your ISPConfig 3 web interface by answering the following question with yes: Create new ISPConfig SSL certificate (yes,no) [no]: <-- yes If you use an ISPConfig version prior to 3.0.4, you should now upgrade to the latest stable version by running... ispconfig_update.sh This will also allow you to create an SSL connection for your ISPConfig 3 web interface by answering the following question with yes: Create new ISPConfig SSL certificate (yes,no) [no]: <-- yes As outlined above, make sure you enter the correct details. Afterwards, you should have an SSL key, a CSR, and a self-signed certificate in the /usr/local/ispconfig/interface/ssl/ directory: ls -l /usr/local/ispconfig/interface/ssl/ root@server1:~# ls -l /usr/local/ispconfig/interface/ssl/ All we need in this tutorial is the private key (ispserver.key) and the CSR (ispserver.csr); we will replace ispserver.crt with the Class1 certificate from StartSSL. You can ignore ispserver.key.secure. It is also possible to create ispserver.key and ispserver.csr on the command line as follows: cd /usr/local/ispconfig/interface/ssl/ (This will give you no ispserver.crt which doesn't matter as we will get our signed certificate from StartSSL.) Your ispserver.csr should be similar to this one (I've x'ed out big parts of it because this is a real CSR I use): cat /usr/local/ispconfig/interface/ssl/ispserver.csr
3 Getting Your Free Class1 Certificate From StartSSLNow go to http://www.startssl.com/ and create an account. After you have validated your domain (on the Validations Wizard tab), you can request your certificate on the Certificates Wizard tab - select Web Server SSL/TLS Certificate from the Certificate Target drop-down field: Since we already have a private key and a CSR, we can skip the next step - click on Skip >>: On the next page, you fill in your CSR, i.e., the contents of the /usr/local/ispconfig/interface/ssl/ispserver.csr file (beginning with -----BEGIN CERTIFICATE REQUEST----- and ending with -----END CERTIFICATE REQUEST-----): Then follow the rest of the wizard - it will ask you for a domain and one subdomain for which the certificate will be created. If you use server1.example.com for all your services, fill in example.com as the domain and server1 as the subdomain. After a few minutes, you will receive an email that your new certificate is ready. Go to Toolbox > Retrieve Certificate and select your certificate: Copy the certificate from StartSSL's web interface... ... and make a backup of your original ispserver.crt file and paste the StartSSL Class1 certificate into the (empty) ispserver.crt file: mv /usr/local/ispconfig/interface/ssl/ispserver.crt /usr/local/ispconfig/interface/ssl/ispserver.crt_bak
Next download StartSSL's Root CA and the Class1 Intermediate Server CA: cd /usr/local/ispconfig/interface/ssl (If you use a Class2 certificate, please download sub.class2.server.ca.pem instead of sub.class1.server.ca.pem). Rename both files: mv ca.pem startssl.ca.crt (Adjust the second command if you use a Class2 certificate.) Some services require a .pem file which we create as follows (again, make sure you adjust the commands if you use a Class2 certificate): cat startssl.sub.class1.server.ca.crt startssl.ca.crt > startssl.chain.class1.server.crt
|









Recent comments
19 hours 40 min ago
1 day 39 min ago
1 day 2 hours ago
1 day 2 hours ago
1 day 4 hours ago
1 day 9 hours ago
1 day 9 hours ago
1 day 12 hours ago
2 days 1 hour ago
2 days 2 hours ago