Webmin is a web-based interface for system administration of UNIX Operating system that includes managing user accounts, disk quotas, services or configuration files as well as modify or controlling open source apps from the console or remotely. Webmin includes CGI programs and a simple server and these programs are written in Perl version 5 without any specific Perl module. Here, we are going to explain how to install SSL certificate on Webmin server.
You need to create a Certificate Signing Request (CSR) to configure CA-signed SSL certificate for your Webmin server.
Make sure you should have following software for the entire process:
– Download and install the latest LTS version of Ubuntu 16.04.3 for a desktop.
– Webmin 1.840 with Apache web-server 2.4.18
Generate a CSR for Webmin Server
Follow Process to Generate a CSR for Webmin Server:
Step 1: First, you need to login into Webmin administration panel and open server’s Terminal screen (Alt+K) as the seen picture below:
openssl req -new -newkey rsa:2048 -nodes -keyout /etc/ssl/example_com.key -out /etc/ssl/example_com.csr/
Note: In above command, you will have to change the name of private key and CSR with your domain name. And out /etc/ssl/example_com.csr/ refers to path and file name to save CSR.
example_com.key is a private key, which should be saved on desktop/server and do not disclose to anyone. After that, you will have to enter CSR details that are as mentioned below:
- C=US [two-letter abbreviation refers to country code]
- ST= It refers State, Type full state Name, for example: California
- L= It refers locality, Type Full City name, for example: Los Angeles
- O= It refers Organization name, Type your Full legal company or personal name. For example: Company LLC
- OU= It refers Organizational Unit, Type the department/division of your organization, for example: IT
- CN= It refers Common Name or The Fully qualified domain name (FQDN) for your website. For e.g. example.com If you’re requesting Wildcard SSL Certificate, add an asterisk (*) to the left of the common name. for example, *.example.com
After OpenSSL command is entered and executed, You have generated CSR code including —–BEGIN CERTIFICATE REQUEST—– and —–END CERTIFICATE REQUEST—– headers and paste it on the configuration page. Picture below shows CSR code:
Install SSL Certificate on Webmin Server
Once you have completed the process of generating CSR for Webmin Server, Follow steps to install SSL on Webmin as mentioned below:
Step 1: Once you receive certificate files from Certificate Authority (CA) after domain and company validation, save those files on your local computer. Now, open main certificate file “example_com.crt” including a private key and certificate bundle file “example_com.ca-bundle” with a text editor and copy the code including the tags —–BEGIN CERTIFICATE—– and —–END CERTIFICATE—– of both files into a single file called WebminServer.pem that you can upload to a Webmin server.
Step 2: Replace WebminServer.pem file:
Now, locate WebminServer.pem file found at /etc/Webmin location and replace this file with newly created newWebminServ.pem file that includes a private key and main certificate file. You can replace a file with below code:
cat example_com.key example_com.crt > newWebminServ.pem
Note: Make sure to change the name of private key and certificate file name according to your domain.
Screen layout of newWebminServ.pem file will be as:
—–BEGIN RSA PRIVATE KEY—–
(Encrypted Contents of private key)
—–END RSA PRIVATE KEY—–
(Encrypted Contents of SSL certificate: example_com.crt)
Note: You should have a backup copy of WebminServer.pem file before replacing it with your new .pem file.
Step 3: Configure WebminServer.conf file:
Open WebminServer.conf file with notepad and enter the location of intermediate certificate
Step 4: Finally, you should restart Webmin server and open website URL in the browser.
Your SSL certificate is now installed and you can use SSL checker tool to confirm certificate details.