Install Webmin from repository
Now let’s install Webmin on our Debian Squeeze server using the repositories.
Webmin is a web-based interface for system administration for Unix. Using any modern web browser, you can setup user accounts, Apache, DNS, file sharing and much more.
1. Install Webmin
By default Webmin cannot be found in official repositories, so we need to add Webmin’s repository into our APT sources file. Before that we need to import the GPG key for the new repository.
wget -q http://www.webmin.com/jcameron-key.asc -O- | apt-key add -
After the GPG key have been imported, we need to add the new repository to /etc/apt/sources.list file, by adding the following line on the bottom of the file:
deb http://download.webmin.com/download/repository sarge contrib
Now let’s update:
apt-get update
And install Webmin from repositories:
apt-get install webmin
APT will show you the list of dependencies that will be installed with Webmin:
root@debian:~# apt-get install webmin Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: apt-show-versions file libapt-pkg-perl libauthen-pam-perl libdb4.7 libio-pty-perl libmagic1 libnet-ssleay-perl mime-support openssl perl perl-modules python python-minimal python2.6 python2.6-minimal Suggested packages: libmime-base64-perl ca-certificates perl-doc libterm-readline-gnu-perl libterm-readline-perl-perl make python-doc python-tk python-profiler python2.6-doc python2.6-profiler binutils binfmt-support The following NEW packages will be installed: apt-show-versions file libapt-pkg-perl libauthen-pam-perl libdb4.7 libio-pty-perl libmagic1 libnet-ssleay-perl mime-support openssl perl perl-modules python python-minimal python2.6 python2.6-minimal webmin 0 upgraded, 17 newly installed, 0 to remove and 0 not upgraded. Need to get 29.5 MB of archives. After this operation, 152 MB of additional disk space will be used. Do you want to continue [Y/n]?
Confirm the installation and you’re done.
2. Configure Webmin
On Debian, by default Webmin can be accessed using your web browser on the following address: https://192.168.0.2/:10000, where 192.168.0.2 will be replaced with your server’s IP address or domain. Most often we need to change the default port from 10000 to a custom one.
2.1 Change Webmin’s default port
Webmin’s configuration file is located here: /etc/webmin/miniserv.conf. We need to edit this file in order to change Webmin’s default port. Here is how the configuration file looks by default:
port=10000 root=/usr/share/webmin mimetypes=/usr/share/webmin/mime.types addtype_cgi=internal/cgi realm=Webmin Server logfile=/var/webmin/miniserv.log errorlog=/var/webmin/miniserv.error pidfile=/var/webmin/miniserv.pid logtime=168 ppath= ssl=1 env_WEBMIN_CONFIG=/etc/webmin env_WEBMIN_VAR=/var/webmin atboot=1 logout=/etc/webmin/logout-flag listen=10000 denyfile=\.pl$ log=1 blockhost_failures=5 blockhost_time=60 syslog=1 session=1 premodules=WebminCore server=MiniServ/1.580 userfile=/etc/webmin/miniserv.users keyfile=/etc/webmin/miniserv.pem passwd_file=/etc/shadow passwd_uindex=0 passwd_pindex=1 passwd_cindex=2 passwd_mindex=4 passwd_mode=0 preroot=blue-theme passdelay=1 sudo=1
In order to change the port, simply edit the port and listen values as you wish. Once the configuration file was updated, restart Webmin:
service webmin restart
Now you can access Webmin on the new port.
2.2 Use HTTP instead of HTTPS
By default in Debian, Webmin must be accessed over a secure connection (HTTPS), as a security measure.
If you want to access Webmin using the HTTP protocol, simply edit in the configuration file the ssl option from 1 to 0 and restart webmin service:
service webmin restart