How to configure Webmin on CentOS 7.0

In this tutorial, you will learn how to set up Webmin on your server running CentOS 7.0. Webmin is a modern, web control panel usable by any Linux machine, which enables you to administer your server through a simple, user-friendly interface.

To complete this tutorial, you will need to have a machine running CentOS 7.0, as well as a sudo user with its own password already set up. Additionally, you must have Apache installed and a Fully-Qualified Domain Name (FQDN), with a DNS record pointing to the IP address of your server.

Installation

  • The first step is to add the Webmin depository for an easy installation and configuration of Webmin via the package manager. You can do that by adding a new file called /etc/yum.repos.d/webmin.repo with information about the new repository. So go ahead and create and open this new file in your text editor of choice:
sudo vi /etc/yum.repos.d/webmin.repo
  • Next, you’ll need to add the following lines to the file and then save and exit.
[Webmin]

name=Webmin Distribution Neutral

#baseurl=http://download.webmin.com/download/yum

mirrorlist=http://download.webmin.com/download/yum/mirrorlist

enabled=1
  • The last step before installing Webmin is adding Webmin author’s PGP key so that your system knows to trust the new repository:
wget http://www.webmin.com/jcameron-key.asc

sudo rpm --import jcameron-key.asc

 

  • Now, simply enter the following command to install Webmin:
sudo yum install webmin

 

Adding a valid certificate

To completely convince your system that it can run Webmin, you’ll need to add a valid certificate from Let’s Encrypt. According to its official website, Let’s Encrypt is a “free, automated, and open certificate authority (CA), run for the public’s benefit. It is a service provided by the Internet Security Research Group (ISRG)” [1] .You’ll be using Apache to perform the domain verification.

 

  • To get started, navigate to https://your_domain:10000 in your web browser (replacing your_domain with the domain name you pointed at your server). There, you’ll be greeted by a login screen.
  • Sign in with root and your current password for the root user.
  • Before applying for the certificate, you’ll have to set the server’s hostname. Navigate to the system Hostname field and click on the link to the right. This will take you to the Hostname and DNS Client page.
  • In the Hostname field enter your Fully-Qualified Domain Name. Press the Save button at the bottom of the page to apply the setting. Next, click on Webmin on the left navigation bar, and then click on Webmin Configuration.
  • Select SSL Encryption from the list of icons, and then click on the Let’s Encrypt tab
  • This type of certificates expire after 3 months, but we can instruct Webmin to automatically renew the Let’s Encrypt certificate monthly. As Let’s Encrypt looks for a verification file on our server, you must configure Webmin to place the verification file inside the folder /var/www/html.
  • To begin setting up your certificate, fill in Hostnames for certificate with your FQDN.
  • For Website root directory for validation file, select the Other Directory button and enter /var/www/html.
  • For Months between automatic renewal section, deselect the Only renew manually option by typing 1 into the input box, and then selecting the radio button to the left of the input box.
  • Finally, click the Request Certificate button. After a few seconds, you should see a confirmation screen.
  • Reloading the page should indicate that your certificate is now valid.

 

Having completed the steps above, you should now be able to use Webmin on CentOS 7.0. Congratulations!

 


Sources:

https://letsencrypt.org/about/

Leave a Reply