Kamis, 23 Oktober 2008

Chapter 1. Obtaining and Installing Webmin

Obtaining Webmin is easy. In fact, it may be installed on your system already. Several Linux distributions now include Webmin as either its primary system administration interface or as an optional package. Also, a large number of Linux hardware vendors use Webmin or a modified version of Webmin as their graphical administration interface. Best of all, because Webmin is free software, even if you don't have Webmin already, it is only a download away.

Where to Download Webmin

It is often best to obtain Webmin from your OS vendor if they provide a package for it. In this way, you can be sure it is automatically configured suitably for your particular OS and version. Executable and configuration file locations vary somewhat from OS version to version and from vendor to vendor, so getting Webmin from your vendor insures consistency.

[Caution]Caution

It is necessary to temper the advice to get Webmin from your vendor with the warning that some vendors lag behind the release schedule of the official Webmin by a month or more. In recent months at least two exploitable conditions have been found in older versions of Webmin. If you are obtaining Webmin from your vendor, it is imperative that you check to be sure it is a recent version, which does not have exploitable bugs. Good vendors will of course update their packages immediately with a secured version, but being cautious is wise when the security of your server is at stake.

If your OS or system vendor does not provide a package of Webmin, then you can go to the Webmin homepage at: http://www.webmin.com/. Here you will find the latest version of Webmin in a tarball package, a Solaris pkg, and an RPM package. The tarball will work on nearly any UNIX version that has Perl, while the RPM package is known to work directly on at least Red Hat, Mandrake, SuSE, MSC and Caldera versions of Linux.

Installing Webmin

Installation of Webmin differs slightly depending on which type of package you choose to install. Note that Webmin requires a relatively recent Perl for any of these installation methods to work. Nearly all, if not all, modern UNIX and UNIX-like OS variants now include Perl as a standard component of the OS, so this should not be an issue.

Installing from a tar.gz

First you must untar and unzip the archive in the directory where you would like Webmin to be installed. The most common location for installation from tarballs is /usr/local. Some sites prefer /opt. If you're using GNU tar, you can do this all on one command line:

        # tar zxvf webmin-0.87.tar.gz

If you have a less capable version of tar, you must unzip the file first and then untar it:

        # gunzip webmin-0.87.tar.gz
# tar xvf webmin-0.87.tar

Next, you need to change to the directory that was created when you untarred the archive, and execute the setup.sh script, as shown in the following example. The script will ask several questions about your system and your preferences for the installation. Generally, accepting the default values will work. An example installation might look like this:

        [root@delilah webmin-1.050]# ./setup.sh
******************************************************************
* Welcome to the Webmin setup script, version 1.050 *
******************************************************************
Webmin is a web-based interface that allows Unix-like operating
systems and common Unix services to be easily administered.

Installing Webmin in /usr/local/webmin-1.050 ...

******************************************************************
Webmin uses separate directories for configuration files and log
files. Unless you want to run multiple versions of Webmin at the
same time you can just accept the defaults.

Config file directory [/etc/webmin]: /usr/local/etc/webmin
Log file directory [/var/webmin]: /usr/local/var/webmin

******************************************************************
Webmin is written entirely in Perl. Please enter the full path to
the Perl 5 interpreter on your system.

Full path to perl (default /usr/bin/perl):

Testing Perl ...
Perl seems to be installed ok

******************************************************************
Operating system name: Redhat Linux
Operating system version: 8.0

******************************************************************
Webmin uses its own password protected web server to provide
access to the administration programs. The setup script needs to
know :
- What port to run the web server on. There must not be another
web server already using this port.
- The login name required to access the web server.
- The password required to access the web server.
- If the webserver should use SSL (if your system supports it).
- Whether to start webmin at boot time.

Web server port (default 10000):
Login name (default admin): root
Login password:
Password again:
The Perl SSLeay library is not installed. SSL not available.
Start Webmin at boot time (y/n): n
******************************************************************
Creating web server config files..
..done

Creating access control file..
..done

Inserting path to perl into scripts..
..done

Creating start and stop scripts..
..done

Copying config files..
..done

Creating uninstall script /usr/local/etc/webmin/uninstall.sh ..
..done

Changing ownership and permissions ..
..done

Running postinstall scripts ..
..done

Attempting to start Webmin mini web server..
Starting Webmin server in /usr/local/webmin-1.050
..done

******************************************************************
Webmin has been installed and started successfully. Use your web
browser to go to

http://delilah.swell:10000/

and login with the name and password you entered previously.

[root@delilah webmin-1.050]#

Here you can see that I've chosen the default in some locations, and deviated from the default in others. The most likely changes you may want to make include changing the default installation directories, and altering the port on which Webmin will listen. Webmin also politely generates an uninstall.sh script that allows you to easily remove Webmin from your system.

Installing from an RPM

Installing from an RPM is even easier. You only need to run one command:

        [root@delilah root]# rpm -Uvh webmin-1.050-1.noarch.rpm

This will copy all of the Webmin files to the appropriate locations and run the install script with appropriate default values. For example, on my Red Hat system, the Webmin perl files will be installed in /usr/libexec/webmin while the configuration files will end up in /etc/webmin. Webmin will then be started on port 10000. You may log in using root as the login name and your system root password as the password. It's unlikely you will need to change any of these items from the command line, because they can all be modified using Webmin. If you do need to make any changes, you can do so in miniserv.conf in /etc/webmin.

Installing from a pkg

To install on a Solaris machine using the pkg file, the steps are almost as simple as using the RPM. First, unzip the file using gzip and then use pkgadd to install the package:

        root# gunzip webmin-1.050.pkg.gz
root# pkgadd -d webmin-1.050.pkg

This will install Webmin into /usr/opt, and run the install script with appropriate default values.

After Installation

After installation, your Webmin install will behave nearly identically, regardless of operating system vendor or version, location of installation, or method of installation. The only apparent differences between systems will be that some have more or fewer modules because some are specific to one OS. Others will feature slightly different versions of modules to take into account different functioning of the underlying system. For example, the package manager module may behave differently, or be missing from the available options entirely, depending on your OS.

[Note]Note

A common problem after installing Webmin, is that some modules do not work, or do not seem to work completely. This can be caused by some of the software being installed in non-standard locations on your system. By default, when Webmin is installed, it creates a configuration for each module based on the standard filesystem structure and configuration file locations for your selected OS. If you have installed software from source tarballs instead of packages, or packages from a different source than your OS vendor, Webmin may not be able to find the files it needs to function correctly. Correcting these problems is usually a simple matter of modifying the configuration for the individual modules to match the actual locations of your configuration files.

Changing Webmin Passwords from the Command Line

Generally, once Webmin is installed all configuration of Webmin can be performed from within Webmin. However, there are a few things that can lead to being unable to log in. A common question is how to log in if you've forgotten the Webmin administrator password. If you have root access to the machine in question (i.e., you haven't also forgotten your system password), you can use the changepass.pl tool, that is found in the same directory as all of the other Webmin executable files (this is the directory in which you installed Webmin). For example, to use changepass.pl to change the root password, you could use the following command:

        # ./changepass.pl /etc/webmin root newpassword

In the preceding example, the first option should be the directory where your Webmin configuration files are located. The second is the login name of the user whose password you'd like to change. The third is what you'd like the password to be changed to. Note that this script only works if you are logged in as the system root user, and can change any Webmin users password.

Changing the Webmin Port from the Command Line

Another problem after installation may be that a firewall prevents access to the Webmin port from across a WAN link (if, for example, you are remotely maintaining your Webmin server). If this is the case, you will want to consult with the firewall administrator to find out whether port 10000 can be opened, or if not, what port you can use for your Webmin installation. Changing the port on which Webmin runs after installation is also a pretty simple process. Simply edit the file miniserv.conf in the /etc directory where your Webmin configuration files were installed (this is likely one of the following: /etc/webmin, /usr/local/webmin/etc, or /opt/webmin/etc). You'll find a port directive. Change this to whatever port you need Webmin to listen on, and then restart the Webmin web server.

Restarting Webmin from the Command Line

Restarting the Webmin server is usually required when making changes to the miniserv.conf file. Some OS versions provide a standard method to stop, start, and restart services, which Webmin often supports. But all versions of Webmin on all OS versions will have start and stop scripts, usually located in the configuration file directory of Webmin.

Restarting the Webmin server can be accomplished in a few different ways depending on the OS and version. Under Red Hat Linux and its derivatives, for example, you would use the standard service command:

        [root@delilah /root]# /sbin/service webmin stop
[root@delilah /root]# /sbin/service webmin start

If your OS does not have a standardized service control tool like service, you may use the standard Webmin stop and start scripts located in the Webmin etc directory:

        [root@delilah /root]# /etc/webmin/stop; /etc/webmin/start

The miniserv.conf file contains many other options, but you will only need to edit a few manually. Other common problems that users run into include restricting their access by IP. This can cause them a problem if their service provider changes the IP. Simply mistyping an IP can also lead to the same trouble. The remedy for this problem is to add the correct IP to the allow= directive and then restart the Webmin server.

Tidak ada komentar:

Posting Komentar