Thursday, April 10, 2008

Installing webmin on Ubuntu 7.10

Recently, I've discovered a very neat tool for administering some of my linux servers. It is called webmin, and it may be one of the more complete web based system administration tools I have seen for linux.

Admittedly, I was a bit apprehensive at first trusting a web interface to do administration. After all, I am not one to shy away from the command line. But the more I used the webmin console, the more I could really see the benefit of using such a tool. In particular, I found the custom commands, and scheduled monitoring two particularly useful features.

I had been configuring small single-application virtual machines lately with Ubuntu, and found webmin to be a very robust tool in which to write custom commands to administer the various function of that server. With webmin, it made each VM more like a virtual appliance -- something we just turn on and off -- rather than something we had to learn oodles of commands to maintain.

Now installatin of webmin on Ubuntu isn't quite as straight forward as just saying "apt-get install webmin", so I've written a small HOWTO guide on how to install on Ubuntu. If you find this useful, please do leave a comment. It's nice to know what people find useful, and what things people don't.

Step 1: Get the latest webmin debian package from webmin's site. Since the bare bones Ubuntu Server won't have a graphical browser, the easiest way to do this is to find the download link via another machine, then use wget to download it onto your server. For me, this was a close sourceforge mirror from which to obtain it. Therefore, I issued a command like this:

wget http://internap.dl.sourceforge.net/sourceforge/webadmin/webmin_1.410_all.deb

This was the response:

--12:57:12-- http://internap.dl.sourceforge.net/sourceforge/webadmin/webmin_1.410_all.deb
=> `webmin_1.410_all.deb'
Resolving internap.dl.sourceforge.net... 74.201.26.4
Connecting to internap.dl.sourceforge.net|74.201.26.4|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 13,140,062 (13M) [text/plain]

100%[====================================================================================================>] 13,140,062 417.00K/s ETA 00:00

12:57:44 (416.17 KB/s) - `webmin_1.410_all.deb' saved [13140062/13140062]

Step 2: Next, install the appropriate libraries (as a sudo user) to get webmin to run:

sudo apt-get install libnet-ssleay-perl libauthen-pam-perl libio-pty-perl libmd5-perl openssl
This was the response:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
ca-certificates
The following NEW packages will be installed:
libauthen-pam-perl libio-pty-perl libmd5-perl libnet-ssleay-perl openssl
0 upgraded, 5 newly installed, 0 to remove and 39 not upgraded.
Need to get 1138kB of archives.
After unpacking 3555kB of additional disk space will be used.
Get:1 http://ca.archive.ubuntu.com gutsy/universe libauthen-pam-perl 0.16-1 [32.2kB]
Get:2 http://ca.archive.ubuntu.com gutsy/universe libio-pty-perl 1:1.07-1 [42.3kB]
Get:3 http://ca.archive.ubuntu.com gutsy/universe libmd5-perl 2.03-1 [5680B]
Get:4 http://ca.archive.ubuntu.com gutsy/main libnet-ssleay-perl 1.30-1 [186kB]
Get:5 http://ca.archive.ubuntu.com gutsy-updates/main openssl 0.9.8e-5ubuntu3.1 [872kB]
Fetched 1138kB in 9s (117kB/s)
Selecting previously deselected package libauthen-pam-perl.
(Reading database ... 33264 files and directories currently installed.)
Unpacking libauthen-pam-perl (from .../libauthen-pam-perl_0.16-1_i386.deb) ...
Selecting previously deselected package libio-pty-perl.
Unpacking libio-pty-perl (from .../libio-pty-perl_1%3a1.07-1_i386.deb) ...
Selecting previously deselected package libmd5-perl.
Unpacking libmd5-perl (from .../libmd5-perl_2.03-1_all.deb) ...
Selecting previously deselected package libnet-ssleay-perl.
Unpacking libnet-ssleay-perl (from .../libnet-ssleay-perl_1.30-1_i386.deb) ...
Selecting previously deselected package openssl.
Unpacking openssl (from .../openssl_0.9.8e-5ubuntu3.1_i386.deb) ...
Creating directory /etc/ssl
Setting up libauthen-pam-perl (0.16-1) ...
Setting up libio-pty-perl (1:1.07-1) ...
Setting up libmd5-perl (2.03-1) ...
Setting up libnet-ssleay-perl (1.30-1) ...
Setting up openssl (0.9.8e-5ubuntu3.1) ...


Step 3: Install the webmin package as root using dpkg.

sudo dpkg -i webmin_1.410_all.deb
This was the response:

Selecting previously deselected package webmin.
(Reading database ... 33791 files and directories currently installed.)
Unpacking webmin (from webmin_1.410_all.deb) ...
Setting up webmin (1.410) ...
Webmin install complete. You can now login to https://myserver:10000/
as root with your root password, or as any user who can use sudo
to run commands as root.

Step 4: You're done! Login to the server using your web browser and point it to the address it indicates.

4 comments:

David Powell said...

Thanks for this--seems to have worked beautifully for me on 8.04 Hardy Heron, as well.

Jonathan Ng said...

Hi David,

Glad to hear that the instructions work well for 8.04 too.

Jonathan.

Anonymous said...

i got it installed but cant login.
i use root as username. what do i put for password.

Jonathan Ng said...

Shahrukh,

Use your own username and password for webmin's login. I'm not entirely sure whether you need to be a member of the admin group (or otherwise a sudo'er). In my case, I am sudoer on most machines I have webmin installed.

That being said, it is possible to set a root password (though Ubuntu's recommended way of doing superuser things is through sudo). To do this, login to the machine (via console or SSH), then type "sudo passwd".

Hope that helps.

Jonathan.