Latest tutorial: Making a Movieclip face another Movieclip or point on the stage | Ask Tutorial5!
 

Build Your Own Database Driven Website Using PHP & MySQL

SitePoints Best Seller book on scripting.

  • Learn how to install and administer PHP & MySQL on Windows, Linux or Mac

  • Build your very first live Database Driven Website using PHP & MySQL

  • Instantly apply working code examples from the book to your Website


Download the free chapters now!

Webmin: Linux administration kept simple

(5 votes)
Written by Michael D.   

In this tutorial, I will teach you how to keep Linux administration simple using a tool based on a web interface.

One of the biggest problems when a server is needed in a network is the administration. The problem gets more serious if you need to maintain a Linux-based machine and you are a novice in this domain. This can get a little tricky if you don’t come up with a good solution.
 

1. Installation

The best application that can help you in this matter is Webmin. You can get it from http://www.webmin.com/download.html, by selecting your Operating System type. The most common Linux OS support automated installers based on specific packages.

a) For example, if you use a Fedora Core distribution, get the rpm package and it will install by itself (or just login as root in your system and type “yum install webmin”. Fedora will do the rest). The result should be something like this:

yum install webmin

In my example, the package was already installed so I just searched for it to see the results. If the ‘install’ argument is passed, yum will search, download and install the program for you, asking only one confirmation.

b) If you use a Debian-based distribution, use the command “apt-get install webmin”. The rest is almost similar.


2. First access on Webmin

To access your administration interface, just open a browser and type http://serverip:10000. This will open the login screen for you.
If this fails the first time, do some troubleshooting: check if the service is running and if it’s accepting connections like shown bellow.

troubleshoot service status and connectivity

In our case we can see that webmin is running and accepting connections (HTTP traffic flows).

If it’s all ok, you should see the following screen:

webmin first login

Login here with your root account and password to access the administration interface; don’t worry it should be safe if it’s done in your local area network.


3. Web-based administration

As you can see, the first screen will show you a brief server summary regarding resources.

webmin logged in

The first thing you should do now is to configure Webmin itself. For accesing any functions, you need to use the cascading menu in the left. Click Webmin and then Webmin Configuration.

Go to IP Access Control and configure the list, as you desire (you can leave the ‘Allow from all addresses’ field check, so you can access you web interface from anywhere; but if the server is connected to the Internet, this can becomes a security risk).

Return to Webmin configuration and go to Authentication. Select the ‘enable password timeouts option’ and block a host for at least 60 seconds after 2 failed logins. This will prevent brute force attacks. Enable session authentication and select a decent timeout for it (5 minutes or so). In addition you can enable a SSL authentication from the Webmin configuration menu. You may need some extra modules to be installed, but Webmin can do that for you.

It’s now safe to use Webmin to your production server.
Please note that you should use a strong root password, with a minimum of 10 characters, containing at least one number and one symbol. Don’t use dictionary-based passwords or sentences; they are the easiest to force in (a password like ihaveaverystrongpassword is not a good idea).

Now you can use the System menu to go and configure the most important parts of your Linux Operating System. You can manage boot/shutdown operations by a couple of clicks and create a username on the system easily by completing a form:

 webmin create user

Another useful option is the Software Packages menu. You can add, remove and search for any software available for you system. Just have an Internet connection on the server and the application will download and install any program for you, resolving dependencies. You can also do a total system update with only one mouse click.


In the Servers menu, you can choose from a variety of common used Linux services. Note that these are also the recommended applications for different tasks. If a package is not installed on your system (let’s say you select DHCP server), webmin will prompt you for installing it with a message like:


“The DHCP server /usr/sbin/dhcpd could not be found on your system. Maybe it is not installed, or your DHCP module configuration is incorrect.
The ISC DHCPd package can be automatically installed by Webmin. Click here to have it downloaded and installed using YUM.”
You just click it and it will install; then you can configure all the options you want.

Besides Networking and Hardware and their submenus, Webmin offers an interesting feature called Clustering. You can install Webmin on a network of servers linked together and authenticate one which other; after discovering and logging in all servers (automatically) you can perform group commands in your server Cluster. It also includes a heartbeat options to keep the connections alive and learn fast enough if any failure accours.

The “Others” menu holds three interesting options. First is the File manager, where you can add, delete, view or edit any file on your server’s hard disk. Note that this application is based on a Java applet, which is downloaded from the server, so you need Java(TM) Platform installed on your client:

Webmin file manager

Secondly there is the Upload/Download menu where you can get or put any files from and to your server. This can get very handy if you don’t want to use FTP server software.

Now probably the best option available is the Command shell. This allows you to execute a command as root on the server without being logged via ssh. For example, I wanted to see what are the last system messages and I typed “tail /var/log/messages” and read the output in the web interface as you can see bellow:

Webmin execute command


Hope this was useful to you!



Subscribe now via RSS feed and get all the new tutorials

written by Eric Vanderslice , October 24, 2007

I installed the current version of webmin on Ubuntu Server 7.04. I can't log on to Webmin for the first time. There is no "root" user per se, but even enabling a SU password I don't get anywhere. I've tried users admin, andministrator, root root@server, blank and user. Right now I only have one password so I know that is correct. I can't seem to find a config file that I could directly edit to add a user. How do I get in for the first time?
written by Mihai Dobos , October 24, 2007

Hello

The default login in Webmin is using your local system root account. The problem with Ubuntu is that it has no root password set by default; this will confuse Webmin a little, since it's a huge security risk from the start.

To set a root password in Ubuntu, login with your user account first. Then open a terminal (if you are in X Window System) and type "sudo passwd". You will be asked for a new root password; try to use a combination of alphabetical and numerical charachters (uppercase and lowercase would be better), with a minimum of 8 in length to increase security. After doing this, you should login to Webmin using the username "root" and the password you just set.


Mihai D.

Do you need more help? Ask now!
 

busy
Last Updated ( Friday, 31 August 2007 )