• No results found

Any Linux system

Webmin:

www.webmin.com

Access Webmin via a web browser, locally or remotely

You can access Webmin from pretty much any platform. This tutorial covers installation methods that should work for most distros

The facilities of Webmin are provided by a massive collection of modules. These modules are accessed via the sidebar

The main window within the web browser is where you interact with most of the modules

01

Fetch the latest version

Head on over to www.webmin.com and proceed to the Download page to fetch the latest version of Webmin. Alternatively, download the latest version as a DEB fi le by typing

wget http://www.webmin.com/download/

deb/webmin-current.deb.

Or type wget http://www.webmin.com/

download/rpm/webmin-current.rpm for RPM.

04

Connect to Webmin

Fingers crossed, Webmin is now working. You can test it by navigating to https://[your hostname]:10000/. You can discover your hostname by typing hostname at the command prompt. If everything is working, you should see the web interface for Webmin.

05

Log in with root

Typically, you will give Webmin your ‘root’ username and password, when prompted. On a system such as Ubuntu that has no root account, you can use the username and password of the regular user so long as that user can execute sudo.

06

Set a static IP address

For convenience, you might want to assign a static IP address to the host machine, so that it can be consistently identifi ed on the network. In Webmin, go to Networking>Network Confi guration>Network Interfaces to see a list of currently activated network interfaces. Click on the name of the network adaptor used to connect to the rest of your network (‘eth0’ or

07

Confi gure your local fi rewall

If you can’t access Webmin from other machines on your network (by using http://[IP address:10000]/), don’t panic: it probably means a local fi rewall is blocking port 10000. You can confi gure the local fi rewall using Webmin itself, too. Go to Networking> Local Firewall and click on the add button. Most of the fi elds on the next page can ignored, but set Network Protocol to equals TCP and Source TCP port to equals 10000. Click on Create to apply.

02

Install Webmin (for DEB)

In the case of Debian-derived distributions, like Ubuntu, install the DEB fi le by typing sudo dpkg -i [name of .deb you

downloaded]. This won’t satisfy all of the

required dependencies for the package, so don’t worry if it throws up some errors. To fi x this, type: sudo apt-get -f install

03

Install Webmin (for RPM)

In the case of Red Hat-derived distros such as CentOS, fi rst make yourself root by typing su. To install, type: yum install [name

of RPM file you’ve downloaded].

similar for a wired network; ‘wlan0’ for a Wi- Fi one). From here, change the IP address to something congruent to your current numbering scheme but higher. For example from 192.168.1.5 to 192.168.1.200.

08

Confi gure your router

How you enable access from the internet is specifi c for each router, so you’ll need to examine the instructions for your router or visit portforward.com. In short, you need to allow incoming transmissions for port 10000 and forward that port to the IP address of the host computer on your network. This is usually very straightforward, but since every router is different, it’s impossible to explain in detail here.

10

Package Installation

We’ll install Java support on Ubuntu in this example, but things work in much the same way on other platforms. On the main page, select the package from APT and enter default-jdk into the text box. Now select Install. Like many of the Webmin modules, this window contains quite a lot of useful text output. At the top it shows the Apt command that it shall execute (apt-get -y --force-yes -f install default-jdk in this case). Beneath this, it shows the output of Apt and below this, a tabular summary of all packages installed.

11

Manage cron jobs

The syntax of specifying a new scheduled UNIX job, or cron job, is notoriously fi ddly, and Webmin offers a neat front-end for this. Begin by entering the System>Scheduled Cron Jobs page. On this page, you can create new jobs or edit jobs already on the system.

12

Create a cron job

We’re going to create a nightly job that deletes the contents of /var/log/mylogs using the Scheduled Cron Jobs page. Select the ‘Create a new scheduled cron job’ option and this takes you to the cron job editing page. In the job details section, specify that the job will be executed by user root. Type rm /var/log/ mylogs/* into the Command text box. Add a description for the job to the Description box. In the ‘When to execute’ section, select Simple schedule and Daily (at midnight). Click on Create.

13

Search system documentation

The System Documentation module (accessed from within the System section), offers a complete man page browser, usefully, accessing the man fi les on the host system. To use it, simply enter a search term. It operates much the same way as the standard ‘man’ command, but many will fi nd the web-based interface more convenient.

14

View logs

The Webmin Actions Log is a feather in Webmin’s cap. If you don’t add anything to the default form and click on search, you will be given a summary of confi guration changes made that day. You can further refi ne your search by, for example, widening the date range.

09

Webmin package management

In this example, we’ll install OpenJDK to a stock Ubuntu machine using the Webmin package management facilities. Open the System submenu from the sidebar and select Software Packages. Note that the Search… button opens a window that allows searching of the APT database.

15

Clone module

Clone a module to have a second (or more) version with different settings. Go to Webmin> Webmin Confi guration>Webmin Modules. Now select the Clone tab. From here, select a module to clone from the drop-down and give it a new name. Click on ‘Clone module’ and it will be added to the sidebar.

16

Execute commands

Webmin has basic facilities for the execution of commands on the host machine, with a display of the output using the Command Shell page. If there’s a command that you want to assign to a clickable button for frequent use, add it in the Custom Commands page.

17

Text login

If you need a bit more fl exibility than the execute commands page allows, but you don’t want to (or aren’t able to) install SSH, try Others> Text Login. This offers a full terminal in which you can run text-mode programs, all from within the browser.

18

Back up confi g fi les

You can back up any confi guration that Webmin modules can access to a local or remote fi le for later restoration on the Webmin>Backup Confi guration Files page. You can independently select which modules to back up and restore (Ctrl- or Shift-click), and there’s a facility for scheduled backups.

19

File system backup

Webmin includes a simple facility to back up fi les and directories. To use it, go to System>Filesystem Backup. Specify a directory and click on ‘Add backup directory’. From here you can specify details such as a schedule for the backups and the remote (SSH, FTP) or local destination for the archive.

20

Monitor bandwidth

Go to Networking>Bandwidth Monitoring and click on ‘Set up now’. Once it’s set up, you have to create some traffi c on that interface before a report can be generated. When you’ve done this, specify a time range and click on ‘Generate report’. Note that this function has a performance overhead.

21

Add a disk-space monitor

Webmin monitors alert you when certain conditions are met. Go to Others>System and Server Status. Click on Scheduled Monitoring and specify your SMTP email details. Select Disk Space from the drop-down and specify a 5% minimum size. Click on Create. Congratulations, you’ve started to master Webmin!