How to generate a CSR code in Webmin

In this guide, we will go through the CSR generation process on a server, operated under Webmin administration panel. The software used for demonstration is the following:

  • Ubuntu 16.04 LTS
  • Webmin 1.840 with Apache web-server 2.4.18

Firstly, we need to log into Webmin and open Terminal, pressing the button like on the picture below:

On the opened Terminal screen, we need to either type in or paste the OpenSSL command for CSR generation. The command below will generate the private key and the CSR, save them in the given location and display the CSR code on the screen:

sudo openssl req -new -newkey rsa:2048 -nodes -keyout /etc/ssl/ -out /etc/ssl/ -subj /C=US/ST=Arizona/L=Phoenix/; cat /etc/ssl/

Make sure to change the values highlighted in red in the following way:

  • -keyout /etc/ssl/ the path and the filename to save the private key code.

NOTE: Please avoid putting the file with the private key into publicly accessible directories (the document root folders in other words), for example, “/var/www/html”, “/usr/share/example/html”, “/home/example/public_html”, etc, as the private key must not be disclosed under any circumstances due to security concerns.

  • -out /etc/ssl/ the path and the filename to save the CSR code
  • C=US 2-letter country code, compliant with ISO-3166-1 alpha-2
  • ST=Arizona the name of the state or another geographical region within the country
  • L=Phoenix the name of the city
  • the company/organization name or just NA if there is no company
  • OU=Support the name of the division/department within the company (not obligatory though) or NA instead
  • the exact fully qualified domain name the certificate is going to be issued for - “”, “” or “”, for instance. In case of a wildcard certificate, it is necessary to prepend an asterisk to the domain name - “*” or “*”.

The picture below shows the command already entered and executed:

At this point, you can copy the CSR code enclosed with the -----BEGIN CERTIFICATE REQUEST------ and -----END CERTIFICATE REQUEST----- headers and start the SSL certificate activation:

If the activation page does not accept the CSR code and returns certain errors indicating that something is wrong with the CSR, you can decode the code here and see what exactly is incorrect in order to re-generate the CSR with these amendments.


Powered by Zendesk