How to Install sysstat on CentOS 5.7 Linux Server

In this post i will show how to install sysstat on Linux CentOS 5.7 server. Sysstat package is on of the method to monitor the linux server. sysstat package contains the sar, iostat and mpstat which are the system performance tools for Linux operating system. The sar command collects and reports system activity information. The iostat command reports CPU utilization and I/O statistics for disks. The mpstat command reports global and per-processor statistics. The statistics reported by sar concern I/O transfer rates, paging activity, process-related activities, interrupts, network activity, memory and swap space utilization, CPU utilization, kernel activities and TTY statistics. All these tools can be schedule via cron to collect and historize performance and activity data. These are the list of sysstat’s available packages :

a) iostat(1) reports CPU statistics and input/output statistics for devices, partitions and network filesystems.
b) mpstat(1) reports individual or combined processor related statistics.
c) pidstat(1) reports statistics for Linux tasks (processes) : I/O, CPU, memory, etc.
d) sar(1) collects, reports and saves system activity information (CPU, memory, disks, interrupts, network interfaces, TTY, kernel tables,etc.)
e) sadc(8) is the system activity data collector, used as a backend for sar.
f) sa1(8) collects and stores binary data in the system activity daily data file. It is a front end to sadc designed to be run from cron.
g) sa2(8) writes a summarized daily activity report. It is a front end to sar designed to be run from cron.
h) sadf(1) displays data collected by sar in multiple formats (CSV, XML, etc.) This is useful to load performance data into a database, or import them in a spreadsheet to make graphs.
i) nfsiostat(1) reports input/output statistics for network filesystems (NFS).
j) cifsiostat(1) reports CIFS statistics.

To install sysstat, simply run the following command :

[root@CentOS57 ~]# yum install sysstat -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.oscc.org.my
 * extras: mirror.oscc.org.my
 * rpmforge: fr2.rpmfind.net
 * updates: mirror.oscc.org.my
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package sysstat.i386 0:7.0.2-11.el5 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================
 Package                Arch                Version                       Repository           Size
====================================================================================================
Installing:
 sysstat                i386                7.0.2-11.el5                  base                182 k

Transaction Summary
====================================================================================================
Install       1 Package(s)
Upgrade       0 Package(s)

Total download size: 182 k
Downloading Packages:
sysstat-7.0.2-11.el5.i386.rpm                                                | 182 kB     00:00
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : sysstat                                                                      1/1

Installed:
  sysstat.i386 0:7.0.2-11.el5

Complete!

To check the installed sysstat’s package using rpm command :

[root@CentOS57 ~]# rpm -qa sysstat
sysstat-7.0.2-11.el5

To see sysstat manual simply run any of the sisgle package command. As an example sa1 :

[root@CentOS57 ~]# man sa1
SA1(8)                        Linux Userâs Manual                       SA1(8)

NAME
       sa1 - Collect and store binary data in the system activity daily data file.

SYNOPSIS
       /usr/lib/sa/sa1 [ interval count ]

DESCRIPTION
       The sa1 command is a shell procedure variant of the sadc command and handles all of
       the flags and parameters of that command. The sa1 command collects and store binary
       data  in  the  /var/log/sa/sadd  file, where the dd parameter indicates the current
       day. The interval and count parameters specify that the record  should  be  written
       count  times  at interval seconds. If you do not specify these parameters, a single
       record is written.

       The sa1 command is designed to be started automatically by the cron command.

EXAMPLES
       To create a daily record of sar activities, place the following entry in your  root
       or adm crontab file:

       0 8-18 * * 1-5 /usr/lib/sa/sa1 1200 3 &

FILES
       /var/log/sa/sadd
              Indicate  the daily data file, where the dd parameter is a number represent-
              ing the day of the month.

AUTHOR
       Sebastien Godard (sysstat  wanadoo.fr)

SEE ALSO
       sar(1), sadc(8), sa2(8), sadf(1), mpstat(1), iostat(1), vmstat(8)

       http://perso.orange.fr/sebastien.godard/

Linux                              JUNE 2006                            SA1(8)

How to Install phpMyAdmin on CentOS 5.7 using RPMforge Repository

phpMyAdmin is a free software tool written in PHP intended to handle the administration of MySQL over the World Wide Web. It can manage a whole MySQL server (needs a super-user) as well as a single database. phpMyAdmin supports a wide range of operations with MySQL. The most frequently used operations are supported by the user interface (managing databases, tables, fields, relations, indexes, users, permissions, etc), while you still have the ability to directly execute any SQL statement. In this post, i will show on how to install phpMyAdmin on CentOS 5.7 using RPMforge repository. This steps has been tested on CentOS 5.7, but it may working on CentOS 5.1, CentOS 5.2, CentOS 5.4, CentOS 5.5, CentOS 5.6 and RHEL 5. At the time this article wrote, the installed phpMyAdmin was phpMyAdmin version 2.11. This post assumed that third party repository RPMforge has been added, MySQL and Apache Httpd server also has been installed and configured as per guidelines below :

How to Install MySQL Database Server on CentOS 5.7
How to Install Httpd on CentOS 5.7
How to Add the RPMforge Repository on CentOS 5/RHEL 5 Linux Server

1. Simply run this command to install phpMyAdmin :

[root@CentOS57 ~]# yum install phpmyadmin -y
[root@CentOS57 ~]# yum install phpmyadmin -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.oscc.org.my
 * extras: mirror.oscc.org.my
 * rpmforge: ftp-stud.fht-esslingen.de
 * updates: mirror.oscc.org.my
base                                                                         | 1.1 kB     00:00
extras                                                                       | 2.1 kB     00:00
updates                                                                      | 1.9 kB     00:00
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package phpmyadmin.noarch 0:2.11.11.3-2.el5.rf set to be updated
--> Processing Dependency: php-mysql >= 4.1.0 for package: phpmyadmin
--> Processing Dependency: php-mbstring >= 4.1.0 for package: phpmyadmin
--> Processing Dependency: php-mcrypt for package: phpmyadmin
--> Running transaction check
---> Package php-mbstring.i386 0:5.1.6-32.el5 set to be updated
--> Processing Dependency: php-common = 5.1.6-32.el5 for package: php-mbstring
---> Package php-mcrypt.i386 0:5.1.6-15.el5.centos.1 set to be updated
--> Processing Dependency: php >= 5.1.6 for package: php-mcrypt
--> Processing Dependency: libmcrypt.so.4 for package: php-mcrypt
---> Package php-mysql.i386 0:5.1.6-32.el5 set to be updated
--> Processing Dependency: php-pdo for package: php-mysql
--> Running transaction check
---> Package libmcrypt.i386 0:2.5.8-4.el5.centos set to be updated
---> Package php.i386 0:5.1.6-32.el5 set to be updated
--> Processing Dependency: php-cli = 5.1.6-32.el5 for package: php
--> Processing Dependency: libcurl.so.3 for package: php
--> Processing Dependency: libgmp.so.3 for package: php
--> Processing Dependency: libidn.so.11 for package: php
--> Processing Dependency: libaspell.so.15 for package: php
--> Processing Dependency: libpspell.so.15 for package: php
---> Package php-common.i386 0:5.1.6-32.el5 set to be updated
---> Package php-pdo.i386 0:5.1.6-32.el5 set to be updated
--> Running transaction check
---> Package aspell.i386 12:0.60.3-12 set to be updated
--> Processing Dependency: aspell-en for package: aspell
---> Package curl.i386 0:7.15.5-15.el5 set to be updated
---> Package gmp.i386 0:4.1.4-10.el5 set to be updated
---> Package libidn.i386 0:0.6.5-1.1 set to be updated
---> Package php-cli.i386 0:5.1.6-32.el5 set to be updated
--> Running transaction check
---> Package aspell-en.i386 50:6.0-2.1 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================
 Package                Arch             Version                           Repository          Size
====================================================================================================
Installing:
 phpmyadmin             noarch           2.11.11.3-2.el5.rf                rpmforge           4.2 M
Installing for dependencies:
 aspell                 i386             12:0.60.3-12                      base               946 k
 aspell-en              i386             50:6.0-2.1                        base               1.6 M
 curl                   i386             7.15.5-15.el5                     base               235 k
 gmp                    i386             4.1.4-10.el5                      base               664 k
 libidn                 i386             0.6.5-1.1                         base               194 k
 libmcrypt              i386             2.5.8-4.el5.centos                extras             116 k
 php                    i386             5.1.6-32.el5                      base               2.3 M
 php-cli                i386             5.1.6-32.el5                      base               2.1 M
 php-common             i386             5.1.6-32.el5                      base               153 k
 php-mbstring           i386             5.1.6-32.el5                      base               996 k
 php-mcrypt             i386             5.1.6-15.el5.centos.1             extras              16 k
 php-mysql              i386             5.1.6-32.el5                      base                87 k
 php-pdo                i386             5.1.6-32.el5                      base                66 k

Transaction Summary
====================================================================================================
Install      14 Package(s)
Upgrade       0 Package(s)

Total download size: 14 M
Downloading Packages:
(1/14): php-mcrypt-5.1.6-15.el5.centos.1.i386.rpm                            |  16 kB     00:00
(2/14): php-pdo-5.1.6-32.el5.i386.rpm                                        |  66 kB     00:00
(3/14): php-mysql-5.1.6-32.el5.i386.rpm                                      |  87 kB     00:00
(4/14): libmcrypt-2.5.8-4.el5.centos.i386.rpm                                | 116 kB     00:01
(5/14): php-common-5.1.6-32.el5.i386.rpm                                     | 153 kB     00:01
(6/14): libidn-0.6.5-1.1.i386.rpm                                            | 194 kB     00:01
(7/14): curl-7.15.5-15.el5.i386.rpm                                          | 235 kB     00:01
(8/14): gmp-4.1.4-10.el5.i386.rpm                                            | 664 kB     00:05
(9/14): aspell-0.60.3-12.i386.rpm                                            | 946 kB     00:11
(10/14): php-mbstring-5.1.6-32.el5.i386.rpm                                  | 996 kB     00:08
(11/14): aspell-en-6.0-2.1.i386.rpm                                          | 1.6 MB     00:13
(12/14): php-cli-5.1.6-32.el5.i386.rpm                                       | 2.1 MB     00:20
(13/14): php-5.1.6-32.el5.i386.rpm                                           | 2.3 MB     00:23
(14/14): phpmyadmin-2.11.11.3-2.el5.rf.noarch.rpm                            | 4.2 MB     00:42
----------------------------------------------------------------------------------------------------
Total                                                               103 kB/s |  14 MB     02:14
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : php-common                                                                  1/14
  Installing     : libidn                                                                      2/14
  Installing     : curl                                                                        3/14
  Installing     : gmp                                                                         4/14
  Installing     : php-mbstring                                                                5/14
  Installing     : php-pdo                                                                     6/14
  Installing     : php-mysql                                                                   7/14
  Installing     : libmcrypt                                                                   8/14
  Installing     : aspell-en                                                                   9/14
  Installing     : aspell                                                                     10/14
  Installing     : php-cli                                                                    11/14
  Installing     : php                                                                        12/14
  Installing     : php-mcrypt                                                                 13/14
  Installing     : phpmyadmin                                                                 14/14

Installed:
  phpmyadmin.noarch 0:2.11.11.3-2.el5.rf

Dependency Installed:
  aspell.i386 12:0.60.3-12                           aspell-en.i386 50:6.0-2.1
  curl.i386 0:7.15.5-15.el5                          gmp.i386 0:4.1.4-10.el5
  libidn.i386 0:0.6.5-1.1                            libmcrypt.i386 0:2.5.8-4.el5.centos
  php.i386 0:5.1.6-32.el5                            php-cli.i386 0:5.1.6-32.el5
  php-common.i386 0:5.1.6-32.el5                     php-mbstring.i386 0:5.1.6-32.el5
  php-mcrypt.i386 0:5.1.6-15.el5.centos.1            php-mysql.i386 0:5.1.6-32.el5
  php-pdo.i386 0:5.1.6-32.el5

Complete!

2. Configure phpMyAdmin to allows connections not just from localhost by change the following line :

Allow from 127.0.0.1

to

Allow from all

New Configuration should as below :

#
#  Web application to manage MySQL
#

<Directory "/usr/share/phpmyadmin">
  Order Deny,Allow
  Deny from all
  Allow from all
</Directory>

Alias /phpmyadmin /usr/share/phpmyadmin
Alias /phpMyAdmin /usr/share/phpmyadmin
Alias /mysqladmin /usr/share/phpmyadmin

3. Change the authentication in phpMyAdmin from cookie to http :

/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'http';

4. Reload or restart the apache server :

[root@CentOS57 ~]# service httpd reload
  •  Apache: http://httpd.apache.org/
  • References :

  • PHP: http://www.php.net/
  • MySQL: http://www.mysql.com/
  • CentOS: http://www.centos.org/
  • phpMyAdmin: http://www.phpmyadmin.net/
  • How to Install and Configure yum-priorities on CentOS 5/RHEL 5 Linux Server

    In this post, i will show on how to install and configure yum-priorities on CentOS 5 or RHEL 5 Linux server. Theoretically, the repositories with the lowest numerical priority number have the highest priority. This is one of the method to prevents mistakes such as accidentally running yum upgrade with everything. This steps has been tested on CentOS 5.7, but it may working on CentOS 5.1, CentOS 5.2, CentOS 5.4, CentOS 5.5, CentOS 5.6 and RHEL 5.

    1. To Install the yum-priorities, simply run this command :

    [root@CentOS57 ~]# yum install yum-priorities -y
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
     * base: mirror.oscc.org.my
     * extras: mirror.oscc.org.my
     * rpmforge: ftp-stud.fht-esslingen.de
     * updates: mirror.oscc.org.my
    Setting up Install Process
    Resolving Dependencies
    --> Running transaction check
    ---> Package yum-priorities.noarch 0:1.1.16-21.el5.centos set to be updated
    --> Finished Dependency Resolution
    
    Dependencies Resolved
    
    ====================================================================================================
     Package                   Arch              Version                          Repository       Size
    ====================================================================================================
    Installing:
     yum-priorities            noarch            1.1.16-21.el5.centos             base             16 k
    
    Transaction Summary
    ====================================================================================================
    Install       1 Package(s)
    Upgrade       0 Package(s)
    
    Total download size: 16 k
    Downloading Packages:
    yum-priorities-1.1.16-21.el5.centos.noarch.rpm                               |  16 kB     00:00
    Running rpm_check_debug
    Running Transaction Test
    Finished Transaction Test
    Transaction Test Succeeded
    Running Transaction
      Installing     : yum-priorities                                                               1/1
    
    Installed:
      yum-priorities.noarch 0:1.1.16-21.el5.centos
    
    Complete!
    

    2. After the plugin is installed, make sure that it is enabled on /etc/yum/pluginconf.d/priorities.conf file.

    [root@CentOS57 ~]# cat /etc/yum/pluginconf.d/priorities.conf
    [main]
    enabled = 1
    

    If enabled = 0, you can enabled it using vi editor as below :

    [root@CentOS57 ~]# vi /etc/yum/pluginconf.d/priorities.conf
    

    3. With the plugin enabled, you may add priorities to the target repositories by adding the following line :

    priority=N
    

    Where N is an integer from 1 to 99. The lower the number the more important it is, so CentOS-Base.repo must always the lowest.

    [root@CentOS57 ~]# vi /etc/yum.repos.d/CentOS-Base.repo
    

    Add this line on base repo :

    priority = 1
    
    # CentOS-Base.repo
    #
    # The mirror system uses the connecting IP address of the client and the
    # update status of each mirror to pick mirrors that are updated to and
    # geographically close to the client.  You should use this for CentOS updates
    # unless you are manually picking other mirrors.
    #
    # If the mirrorlist= does not work for you, as a fall back you can try the
    # remarked out baseurl= line instead.
    #
    #
    
    
    [base]
    name=CentOS-$releasever - Base
    mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
    #baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
    priority = 1
    
    #released updates
    [updates]
    name=CentOS-$releasever - Updates
    mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
    #baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
    
    #additional packages that may be useful
    [extras]
    name=CentOS-$releasever - Extras
    mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
    #baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
    
    #additional packages that extend functionality of existing packages
    [centosplus]
    name=CentOS-$releasever - Plus
    mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
    #baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
    gpgcheck=1
    enabled=0
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
    
    #contrib - packages by Centos Users
    [contrib]
    name=CentOS-$releasever - Contrib
    mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
    #baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/
    gpgcheck=1
    enabled=0
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
    

    4. As an example, another 3rd party repository is RPMforge. Follow this steps to Add the RPMforge Repository on CentOS 5/RHEL 5 Linux Server :
    How to Add the RPMforge Repository on CentOS 5/RHEL 5 Linux Server

    Open the RPMforge configuration file and insert “priority = 5” after “enabled = 1” in the [rpmforge] section :

    [root@CentOS57 ~]# vi /etc/yum.repos.d/rpmforge.repo
    

    In this case, i will add the fifth highest possible priority which is “priority=5” :

    ### Name: RPMforge RPM Repository for RHEL 5 - dag
    ### URL: http://rpmforge.net/
    [rpmforge]
    name = RHEL $releasever - RPMforge.net - dag
    baseurl = http://apt.sw.be/redhat/el5/en/$basearch/rpmforge
    mirrorlist = http://apt.sw.be/redhat/el5/en/mirrors-rpmforge
    #mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge
    enabled = 1
    priority = 5
    protect = 0
    gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
    gpgcheck = 1
    
    [rpmforge-extras]
    name = RHEL $releasever - RPMforge.net - extras
    baseurl = http://apt.sw.be/redhat/el5/en/$basearch/extras
    mirrorlist = http://apt.sw.be/redhat/el5/en/mirrors-rpmforge-extras
    #mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge-extras
    enabled = 0
    protect = 0
    gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
    gpgcheck = 1
    
    [rpmforge-testing]
    name = RHEL $releasever - RPMforge.net - testing
    baseurl = http://apt.sw.be/redhat/el5/en/$basearch/testing
    mirrorlist = http://apt.sw.be/redhat/el5/en/mirrors-rpmforge-testing
    #mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge-testing
    enabled = 0
    protect = 0
    gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
    gpgcheck = 1
    

    How to Add the RPMforge Repository on CentOS 5/RHEL 5 Linux Server

    In this post i will show on how to add the RPMforge repository into CentOS 5 and Linux Red Hat Enterprise Linux 5 (RHEL 5) and also applicable on CentOS 5.1,CentOS 5.2,CentOS 5.3,CentOS 5.4,CentOS 5.5 and CentOS 5.6. RPMforge repository is a collaboration of Dag, Dries, and other packagers. This steps has been tested on CentOS 5.7 and should be working on RHEL 5.

    RHEL 5 and CentOS 5 x86 32bit
    RHEL 5 and CentOS 5 x86 64bit

    1. Import the RPMforge GPG key :

    [root@CentOS57 ~]# rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt
    
    [root@CentOS57 ~]# wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.i386.rpm
    [root@CentOS57 ~]# wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.i386.rpm
    --2012-03-13 03:36:08--  http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.i386.rpm
    Resolving pkgs.repoforge.org... 78.46.17.228
    Connecting to pkgs.repoforge.org|78.46.17.228|:80... connected.
    HTTP request sent, awaiting response... 302 Found
    Location: http://rpmforge.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.5.2-2.el5.rf.i386.rpm [following]
    --2012-03-13 03:36:09--  http://rpmforge.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.5.2-2.el5.rf.i386.rpm
    Resolving rpmforge.sw.be... 78.46.17.228
    Connecting to rpmforge.sw.be|78.46.17.228|:80... connected.
    HTTP request sent, awaiting response... 301 Moved Permanently
    Location: http://tree.repoforge.org/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.5.2-2.el5.rf.i386.rpm [following]
    --2012-03-13 03:36:10--  http://tree.repoforge.org/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.5.2-2.el5.rf.i386.rpm
    Resolving tree.repoforge.org... 78.46.17.228
    Connecting to tree.repoforge.org|78.46.17.228|:80... connected.
    HTTP request sent, awaiting response... 301 Moved Permanently
    Location: http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.5.2-2.el5.rf.i386.rpm [following]
    --2012-03-13 03:36:10--  http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.5.2-2.el5.rf.i386.rpm
    Resolving apt.sw.be... 193.1.193.67
    Connecting to apt.sw.be|193.1.193.67|:80... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 12680 (12K) [application/x-redhat-package-manager]
    Saving to: `rpmforge-release-0.5.2-2.el5.rf.i386.rpm'
    
    100%[==========================================================>] 12,680      23.3K/s   in 0.5s
    
    2012-03-13 03:36:13 (23.3 KB/s) - `rpmforge-release-0.5.2-2.el5.rf.i386.rpm' saved [12680/12680]
    

    3. Verify the rpmforge-release package you have downloaded :

    [root@CentOS57 ~]# rpm -K rpmforge-release-0.5.2-2.el5.rf.i386.rpm
    rpmforge-release-0.5.2-2.el5.rf.i386.rpm: (sha1) dsa sha1 md5 gpg OK
    

    4. Install the rpmforge-release package using this command :

    [root@CentOS57 ~]# rpm -ivh rpmforge-release-0.5.2-2.el5.rf.i386.rpm
    Preparing...                ########################################### [100%]
       1:rpmforge-release       ########################################### [100%]
    

    5. You can start using RPMforge Repository to install, remove and update the package as below :

    [root@CentOS57 ~]# yum install package-name -y
    [root@CentOS57 ~]#  yum remove package-name -y
    [root@CentOS57 ~]#  yum update package-name -y
    

    Resources :
    RPMforge CentOS Wiki

    How to Check Memory and I/O with vmstat on Linux CentOS 5/CentOS 6/RHEL 5/RHEL 6 server – System Performance

    vmstat command is a utility that will provides interesting information abaout processes, memory, i/O and CPU activity. When you run vmstat utility command without any arguments, you will see the output as below. This post will guide you on how to check memory and I/O with vmstat on Linux CentOS 5/CentOS 6/RHEL 5/RHEL 6 server to optimize the linux system performance.

    [root@rhel6 ~]# vmstat
    procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu-----
     r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
     0  0      0 888252  28976  63004    5    0     0    11   15   18  0  0 99  0  0
    

    Below are the description of above vmstat output :
    1. The procs fields show the number of processes
    – Waiting for run time (r)
    -Blocked (b)
    -Swapped out (w)

    2. The memory fields show the kilobytes of swap memory,free memory, buffered memory and Cached memory

    3. The swap fields show the kilobytes per second of memory
    -Swapped in from disk (si)
    -Swapped out to disk (so)

    4. The io fields show the number of blocks per second
    -Sent to block devices (bi)
    -Received from block devices (bo)

    5. The system shows the number of
    -Interrupts per second (in)
    -Context switches per second (cs)

    6. The cpu field shows the percentage of total CPU time as
    -User time (us)
    -System time (sy)
    -Idle (id) time

    To prints the vmstat version, run this command :

    [root@rhel6 ~]# vmstat -V
    procps version 3.2.8
    

    We can let the vmstat to run automatically by execute this command :

    [root@rhel6 ~]# vmstat 
    

    Where nsec is the number of seconds you want it to wait before another update.

    To run vmstat on every 10 seconds :

    [root@rhel6 ~]# vmstat 10
    procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu-----
     r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
     0  0      0 888072  29088  63004    4    0     0    11   14   18  0  0 99  0  0
     0  0      0 888064  29088  63004    0    0     0     0   12   15  0  0 100  0  0
     0  0      0 888064  29088  63004    0    0     0     0   13   16  0  0 100  0  0
    

    Other vmstat usage as below :

    usage: vmstat [-V] [-n] [delay [count]]
                  -V prints version.
                  -n causes the headers not to be reprinted regularly.
                  -a print inactive/active page stats.
                  -d prints disk statistics
                  -D prints disk table
                  -p prints disk partition statistics
                  -s prints vm table
                  -m prints slabinfo
                  -t add timestamp to output
                  -S unit size
                  delay is the delay between updates in seconds.
                  unit size k:1000 K:1024 m:1000000 M:1048576 (default is K)
                  count is the number of updates.
    

    How to Track System Activity With top Command on Linux CentOS 5/CentOS 6/RHEL 5/ RHEL 6 server – System Performance

    Top command is utility to monitor system activity interactively. When you run top from shell window, it will display all the activity processes and updates the screen. In this post i will show the usage of top command on CentOS 5/CentOS 6/RHEL 5/ RHEL 6 server to keep track system activity and to optimize the system performance.

    Display top command on RHEL 6 :

    [root@rhel6 ~]# top
    top - 18:54:19 up 13:29,  2 users,  load average: 0.00, 0.00, 0.00
    Tasks:  93 total,   1 running,  90 sleeping,   2 stopped,   0 zombie
    Cpu(s):  0.0%us,  0.0%sy,  0.0%ni,100.0%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
    Mem:   1031320k total,   225804k used,   805516k free,    31120k buffers
    Swap:  2064376k total,        0k used,  2064376k free,   116716k cached
    
      PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
     1375 root      20   0 97768 9796 5768 S  0.3  0.9   0:03.43 httpd
     3974 root      20   0  2632 1076  868 R  0.3  0.1   0:00.08 top
        1 root      20   0  2828 1392 1196 S  0.0  0.1   0:01.81 init
        2 root      20   0     0    0    0 S  0.0  0.0   0:00.00 kthreadd
        3 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 migration/0
        4 root      20   0     0    0    0 S  0.0  0.0   0:00.00 ksoftirqd/0
        5 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 watchdog/0
        6 root      20   0     0    0    0 S  0.0  0.0   0:00.25 events/0
        7 root      20   0     0    0    0 S  0.0  0.0   0:00.00 cpuset
        8 root      20   0     0    0    0 S  0.0  0.0   0:00.00 khelper
        9 root      20   0     0    0    0 S  0.0  0.0   0:00.00 netns
       10 root      20   0     0    0    0 S  0.0  0.0   0:00.00 async/mgr
       11 root      20   0     0    0    0 S  0.0  0.0   0:00.00 pm
       12 root      20   0     0    0    0 S  0.0  0.0   0:00.00 sync_supers
       13 root      20   0     0    0    0 S  0.0  0.0   0:00.00 bdi-default
       14 root      20   0     0    0    0 S  0.0  0.0   0:00.00 kintegrityd/0
       15 root      20   0     0    0    0 S  0.0  0.0   0:00.02 kblockd/0
       16 root      20   0     0    0    0 S  0.0  0.0   0:00.00 kacpid
       17 root      20   0     0    0    0 S  0.0  0.0   0:00.00 kacpi_notify
       18 root      20   0     0    0    0 S  0.0  0.0   0:00.00 kacpi_hotplug
       19 root      20   0     0    0    0 S  0.0  0.0   0:00.01 ata/0
       20 root      20   0     0    0    0 S  0.0  0.0   0:00.00 ata_aux
       21 root      20   0     0    0    0 S  0.0  0.0   0:00.00 ksuspend_usbd
       22 root      20   0     0    0    0 S  0.0  0.0   0:00.00 khubd
       23 root      20   0     0    0    0 S  0.0  0.0   0:00.00 kseriod
       25 root      20   0     0    0    0 S  0.0  0.0   0:00.00 khungtaskd
       26 root      20   0     0    0    0 S  0.0  0.0   0:00.00 kswapd0
       27 root      25   5     0    0    0 S  0.0  0.0   0:00.00 ksmd
       28 root      20   0     0    0    0 S  0.0  0.0   0:00.00 aio/0
       29 root      20   0     0    0    0 S  0.0  0.0   0:00.00 crypto/0
       34 root      20   0     0    0    0 S  0.0  0.0   0:00.00 pciehpd
       36 root      20   0     0    0    0 S  0.0  0.0   0:00.00 kpsmoused
       37 root      20   0     0    0    0 S  0.0  0.0   0:00.00 usbhid_resumer
       67 root      20   0     0    0    0 S  0.0  0.0   0:00.00 kstriped
      267 root      20   0     0    0    0 S  0.0  0.0   0:00.00 scsi_eh_0
      268 root      20   0     0    0    0 S  0.0  0.0   0:00.00 scsi_eh_1
      279 root      20   0     0    0    0 S  0.0  0.0   0:00.20 mpt_poll_0
    

    Display top command on CentOS 5.7 :

    [root@CentOS57 ~]# top
    top - 18:57:39 up 10:04,  2 users,  load average: 0.00, 0.00, 0.00
    Tasks:  73 total,   1 running,  70 sleeping,   2 stopped,   0 zombie
    Cpu(s):  0.0%us,  0.1%sy,  0.0%ni, 99.8%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
    Mem:   1034700k total,    86916k used,   947784k free,     7292k buffers
    Swap:  2096472k total,        0k used,  2096472k free,    36104k cached
    
      PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
        1 root      15   0  2160  676  584 S  0.0  0.1   0:00.93 init
        2 root      RT  -5     0    0    0 S  0.0  0.0   0:00.00 migration/0
        3 root      34  19     0    0    0 S  0.0  0.0   0:00.00 ksoftirqd/0
        4 root      10  -5     0    0    0 S  0.0  0.0   0:00.00 events/0
        5 root      10  -5     0    0    0 S  0.0  0.0   0:00.00 khelper
        6 root      20  -5     0    0    0 S  0.0  0.0   0:00.00 kthread
        9 root      10  -5     0    0    0 S  0.0  0.0   0:00.00 kblockd/0
       10 root      20  -5     0    0    0 S  0.0  0.0   0:00.00 kacpid
      173 root      17  -5     0    0    0 S  0.0  0.0   0:00.00 cqueue/0
      176 root      10  -5     0    0    0 S  0.0  0.0   0:00.00 khubd
      178 root      10  -5     0    0    0 S  0.0  0.0   0:00.00 kseriod
      244 root      21   0     0    0    0 S  0.0  0.0   0:00.00 khungtaskd
      245 root      22   0     0    0    0 S  0.0  0.0   0:00.00 pdflush
      246 root      15   0     0    0    0 S  0.0  0.0   0:00.01 pdflush
      247 root      17  -5     0    0    0 S  0.0  0.0   0:00.00 kswapd0
      248 root      17  -5     0    0    0 S  0.0  0.0   0:00.00 aio/0
      466 root      11  -5     0    0    0 S  0.0  0.0   0:00.00 kpsmoused
      492 root      10  -5     0    0    0 S  0.0  0.0   0:00.00 mpt_poll_0
      493 root      19  -5     0    0    0 S  0.0  0.0   0:00.00 mpt/0
      494 root      19  -5     0    0    0 S  0.0  0.0   0:00.00 scsi_eh_0
      497 root      19  -5     0    0    0 S  0.0  0.0   0:00.00 ata/0
      498 root      19  -5     0    0    0 S  0.0  0.0   0:00.00 ata_aux
      505 root      20  -5     0    0    0 S  0.0  0.0   0:00.00 kstriped
      514 root      10  -5     0    0    0 S  0.0  0.0   0:00.17 kjournald
      544 root      11  -5     0    0    0 S  0.0  0.0   0:00.00 kauditd
      577 root      21  -4  3004 1468  504 S  0.0  0.1   0:00.62 udevd
     1730 root      20  -5     0    0    0 S  0.0  0.0   0:00.00 kmpathd/0
     1731 root      20  -5     0    0    0 S  0.0  0.0   0:00.00 kmpath_handlerd
     1790 root      11  -5     0    0    0 S  0.0  0.0   0:00.00 kjournald
     1868 root      13  -5     0    0    0 S  0.0  0.0   0:00.00 iscsi_eh
     1896 root      18  -5     0    0    0 S  0.0  0.0   0:00.00 cnic_wq
     1911 root      15  -5     0    0    0 S  0.0  0.0   0:00.00 ib_addr
     1918 root      20  -5     0    0    0 S  0.0  0.0   0:00.00 ib_mcast
     1919 root      20  -5     0    0    0 S  0.0  0.0   0:00.00 ib_inform
     1920 root      20  -5     0    0    0 S  0.0  0.0   0:00.00 local_sa
     1923 root      20  -5     0    0    0 S  0.0  0.0   0:00.00 iw_cm_wq
    

    By default, top will update its screen in every seconds. You can change this interval by using d seconds options as below :

    To update the screen every 5 seconds, run the “top d 5” command :

    [root@rhel6 ~]# top d 5
    top - 18:56:51 up 13:32,  2 users,  load average: 0.00, 0.00, 0.00
    Tasks:  94 total,   1 running,  90 sleeping,   3 stopped,   0 zombie
    Cpu(s):  0.0%us,  0.1%sy,  0.0%ni, 99.7%id,  0.2%wa,  0.0%hi,  0.0%si,  0.0%st
    Mem:   1031320k total,   226064k used,   805256k free,    31136k buffers
    Swap:  2064376k total,        0k used,  2064376k free,   116716k cached
    

    To update the screen every 10 seconds, run the “top d 10” command :

    [root@rhel6 ~]# top d 10
    top - 18:57:21 up 13:32,  2 users,  load average: 0.00, 0.00, 0.00
    Tasks:  95 total,   1 running,  90 sleeping,   4 stopped,   0 zombie
    Cpu(s):  0.0%us,  0.1%sy,  0.0%ni, 99.7%id,  0.2%wa,  0.0%hi,  0.0%si,  0.0%st
    Mem:   1031320k total,   226448k used,   804872k free,    31144k buffers
    Swap:  2064376k total,        0k used,  2064376k free,   116716k cached
    

    The screen updates every 5 to 20 seconds interval is more usefull tha the default setting, 1 second. This because update every 1 second will lists itself in its own output as the main resource consumer. If you press the h key while top is running, you will see the following output screen :

    How to Backup and Restore MySQL Database on CentOS/RHEL

    In this post, i will share on how to backup and restore MySQL database on Linux server. I have tested this on my CentOS and RHEL servers.

    MySQLDump — A Database Backup Program, Click for more info.
    The mysqldump client is a backup program originally written by Igor Romanenko. It can be used to dump a database or a collection of databases for backup or transfer to another SQL server (not necessarily a MySQL server). The dump typically contains SQL statements to create the table, populate it, or both. However, mysqldump can also be used to generate files in CSV, other delimited text, or XML format.

    What is MySQLDump and how to use it :
    The MySQLDump is handy utility that can be used to quickly backup the MySQL Database to the text files. To use the MySQLDump utility it is required to logon to the System running the MySQL Databse. You can use Telnet to remotely logon to the system if you don’t have the physical access to the machine.

    Assumed that the MySQL server has been installed with the version/release as below :

    Name        : mysql
    Arch        : i686
    Version     : 5.1.52
    Release     : 1.el6_0.1

    Login to mysql to check the existing databases :

    [root@centos62 ~]# mysql -u root -p
    Enter password:
    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 4
    Server version: 5.1.52 Source distribution
    
    Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
    This software comes with ABSOLUTELY NO WARRANTY. This is free software,
    and you are welcome to modify and redistribute it under the GPL v2 license
    
    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

    Show available databases :

    mysql> show databases;
    +--------------------+
    | Database           |
    +--------------------+
    | information_schema |
    | mysql              |
    | phpmyadmin         |
    +--------------------+
    3 rows in set (0.00 sec)
    
    mysql> exit
    Bye

    1. Backup MySQL database to <databasebackupfiles>.sql

    <databasename> = Target existing database name
    <databasebackupfiles> = Preferred backed up file name (Optional and user defined)

    # mysqldump -u root -p <databasename> > <databasebackupfiles>.sql
    Enter password: <Type your mysql password and press enter>

    1.1 As Example, i will back up the database named “mysql” to mysql19022012.sql file. This will taking backed up all the tables including the data :

    [root@centos62 ~]# mysqldump -u root -p mysql > mysql19022012.sql
    Enter password:

    1.2 View the backed up file :

    [root@centos62 ~]# ls | grep mysql
    mysql19022012.sql

    1.3 View the content on mysql19022012.sql :

    [root@centos62 ~]# more mysql19022012.sql

    2. Restore the backed up database named “mysql19022012.sql” to new database named “mysqlnew” as below :

    # mysql -u root -p <mysqlpassword> <databasename> < <databasebackupfiles>.sql

    <mysqlpassword> = MySQL password
    <databasename> = Database name that will be restore
    <databasebackupfiles> = Backed up database file, normally .sql file

    2.1 Create the new database mysqlnew :

    mysql> CREATE DATABASE mysqlnew;
    Query OK, 1 row affected (0.01 sec)

    2.2 As example, i will restore the mysql19022012.sql backed up file to database named “mysqlnew” :

    [root@centos62 ~]# mysql -u root -p password mysqlnew < mysql19022012.sql

    or

    [root@centos62 ~]# mysql -u root -p mysqlnew < mysql19022012.sql
    Enter password:

    How to Install MySQL Database Server on CentOS 5.7

    In this post, i will show you on how to install MySQL server on CentOS 5.7. MySQL is a popular choice of database server that can stores and retrieves data for the blog, websites and applications. This post assumed that you have direct internet connection.

    Simply run this command to install MySQL server:

      root@CentOS57 ~]# yum install mysql mysql-server
      Loaded plugins: fastestmirror
      Loading mirror speeds from cached hostfile
       * base: centos.vr-zone.com
       * extras: centos.vr-zone.com
       * updates: mirror.yourconnect.com
      Setting up Install Process
      Resolving Dependencies
      --> Running transaction check
      ---> Package mysql.i386 0:5.0.77-4.el5_6.6 set to be updated
      --> Processing Dependency: perl(DBI) for package: mysql
      ---> Package mysql-server.i386 0:5.0.77-4.el5_6.6 set to be updated
      --> Processing Dependency: perl-DBD-MySQL for package: mysql-server
      --> Running transaction check
      ---> Package perl-DBD-MySQL.i386 0:3.0007-2.el5 set to be updated
      ---> Package perl-DBI.i386 0:1.52-2.el5 set to be updated
      --> Finished Dependency Resolution
      
      Dependencies Resolved
      
      ====================================================================================================
       Package                    Arch             Version                         Repository        Size
      ====================================================================================================
      Installing:
       mysql                      i386             5.0.77-4.el5_6.6                base             4.8 M
       mysql-server               i386             5.0.77-4.el5_6.6                base             9.8 M
      Installing for dependencies:
       perl-DBD-MySQL             i386             3.0007-2.el5                    base             148 k
       perl-DBI                   i386             1.52-2.el5                      base             600 k
      
      Transaction Summary
      ====================================================================================================
      Install       4 Package(s)
      Upgrade       0 Package(s)
      
      Total download size: 15 M
      Is this ok [y/N]: y
      Downloading Packages:
      (1/4): perl-DBD-MySQL-3.0007-2.el5.i386.rpm                                  | 148 kB     00:01
      (2/4): perl-DBI-1.52-2.el5.i386.rpm                                          | 600 kB     00:18
      (3/4): mysql-5.0.77-4.el5_6.6.i386.rpm                                       | 4.8 MB     02:19
      (4/4): mysql-server-5.0.77-4.el5_6.6.i386.rpm                                | 9.8 MB     03:54
      ----------------------------------------------------------------------------------------------------
      Total                                                                40 kB/s |  15 MB     06:34
      Running rpm_check_debug
      Running Transaction Test
      Finished Transaction Test
      Transaction Test Succeeded
      Running Transaction
        Installing     : perl-DBI                                                                     1/4
        Installing     : mysql                                                                        2/4
        Installing     : perl-DBD-MySQL                                                               3/4
        Installing     : mysql-server                                                                 4/4
      
      Installed:
        mysql.i386 0:5.0.77-4.el5_6.6                 mysql-server.i386 0:5.0.77-4.el5_6.6
      
      Dependency Installed:
        perl-DBD-MySQL.i386 0:3.0007-2.el5                   perl-DBI.i386 0:1.52-2.el5
      
      Complete!
      

    Start MySQL server :

      [root@CentOS57 ~]# service mysqld start
      Initializing MySQL database:  Installing MySQL system tables...
      120122 18:37:28 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
      120122 18:37:28 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
      OK
      Filling help tables...
      120122 18:37:28 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
      120122 18:37:28 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
      OK
      
      To start mysqld at boot time you have to copy
      support-files/mysql.server to the right place for your system
      
      PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
      To do so, start the server, then issue the following commands:
      /usr/bin/mysqladmin -u root password 'new-password'
      /usr/bin/mysqladmin -u root -h CentOS57 password 'new-password'
      
      Alternatively you can run:
      /usr/bin/mysql_secure_installation
      
      which will also give you the option of removing the test
      databases and anonymous user created by default.  This is
      strongly recommended for production servers.
      
      See the manual for more instructions.
      
      You can start the MySQL daemon with:
      cd /usr ; /usr/bin/mysqld_safe &
      
      You can test the MySQL daemon with mysql-test-run.pl
      cd mysql-test ; perl mysql-test-run.pl
      
      Please report any problems with the /usr/bin/mysqlbug script!
      
      The latest information about MySQL is available on the web at
      http://www.mysql.com
      Support MySQL by buying support/licenses at http://shop.mysql.com
                                                                 [  OK  ]
      Starting MySQL:                                            [  OK  ]
      

    Make MySQL Service auto-start at boot up :

      [root@CentOS57 ~]# chkconfig mysqld on
      

    How to Uninstall Webmin 1.570 on CentOS 5.7

    In this post, i will guide on how to properly remove the Webmin package that was installed from tar.gz file.

    Just run the command /etc/webmin/uninstall.sh

    [root@CentOS57 ~]# /etc/webmin/uninstall.sh
    Are you sure you want to uninstall Webmin? (y/n) : y
    
    Stopping Webmin server in /usr/local/webmin
    Running uninstall scripts ..
    Deleted init script /etc/rc.d/init.d/webmin
    Subroutine list_servers redefined at /usr/local/webmin/servers/servers-lib.pl line 91.
    Subroutine list_servers_sorted redefined at /usr/local/webmin/servers/servers-lib.pl line 110.
    Subroutine get_server redefined at /usr/local/webmin/servers/servers-lib.pl line 142.
    Subroutine save_server redefined at /usr/local/webmin/servers/servers-lib.pl line 157.
    Subroutine delete_server redefined at /usr/local/webmin/servers/servers-lib.pl line 174.
    Subroutine can_use_server redefined at /usr/local/webmin/servers/servers-lib.pl line 187.
    Subroutine list_all_groups redefined at /usr/local/webmin/servers/servers-lib.pl line 207.
    Subroutine logged_in redefined at /usr/local/webmin/servers/servers-lib.pl line 275.
    Subroutine get_server_types redefined at /usr/local/webmin/servers/servers-lib.pl line 300.
    Subroutine this_server redefined at /usr/local/webmin/servers/servers-lib.pl line 310.
    Subroutine get_my_address redefined at /usr/local/webmin/servers/servers-lib.pl line 329.
    Subroutine address_to_broadcast redefined at /usr/local/webmin/servers/servers-lib.pl line 358.
    Subroutine test_server redefined at /usr/local/webmin/servers/servers-lib.pl line 372.
    Subroutine find_cron_job redefined at /usr/local/webmin/servers/servers-lib.pl line 391.
    Subroutine find_servers redefined at /usr/local/webmin/servers/servers-lib.pl line 404.
    Deleting /usr/local/webmin ..
    Deleting /etc/webmin ..
    Done!
    

    How to Modify the Default Webmin’s Port Number on CentOS 5.7

    To improve the security on my linux centOS server, it is recommended to change the default port of the service and change it to custom webmin’s port number. In this post i will show you on how to modify the default port, 10000 to 10101.

    Check default port number :

    [root@CentOS57 ~]# netstat -plunt | grep perl
    tcp        0      0 0.0.0.0:10000               0.0.0.0:*                   LISTEN      4521/perl   
    udp        0      0 0.0.0.0:10000               0.0.0.0:*                               4521/perl  
    

    Where is the webmin port number stored?
    Webmin port number store in /etc/webmin/miniserv.conf

    To modify the default port, 10000 to 10101, open the /etc/webmin/miniserv.conf file and modify line 1 and 16.

    1 port=10101
    ..
    ..
    16 listen=10101
    ..
    

    Sample configuration file :

    [root@CentOS57 ~]# vi /etc/webmin/miniserv.conf
    
    port=10101
    root=/usr/local/webmin
    mimetypes=/usr/local/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=0
    env_WEBMIN_CONFIG=/etc/webmin
    env_WEBMIN_VAR=/var/webmin
    atboot=1
    logout=/etc/webmin/logout-flag
    listen=10101
    denyfile=\.pl$
    log=1
    blockhost_failures=5
    blockhost_time=60
    syslog=1
    session=1
    premodules=WebminCore
    server=MiniServ/1.570
    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
    

    Restart webmin service using this command:

    [root@CentOS57 ~]# /etc/webmin/restart
    Stopping Webmin server in /usr/local/webmin
    Starting Webmin server in /usr/local/webmin
    Pre-loaded WebminCore
    

    Check the modified webmin’s port number

    [root@CentOS57 ~]# netstat -plunt | grep perl
    tcp        0      0 0.0.0.0:10101               0.0.0.0:*                   LISTEN      4750/perl   
    udp        0      0 0.0.0.0:10101               0.0.0.0:*                               4750/perl
    

    Now you can access the Webmin through url with new custom port.
    http://serverip:10101

    How to Stop, Start and Reload Webmin Service on CentOS 5.7

    It would be a good idea to not have Webmin running all the time. You can start Webmin via ssh when you need it. Not also Webmin, it’s recommended to install the software or packages in linux when you need it. This will improve the security for your server. Less port opened, more secure your server. In this post i will show you on how to stop, start,reload and restart the Webmin service via ssh for CentOS 5.7. Assumed that the webmin has been install from the tar.gz file as documented on my previous post “How to Install Webmin 1.570 on CentOS 5.7 from tar.gz file

    1. Command to stop webmin service :

    [root@CentOS57 ~]# /etc/webmin/stop
    Stopping Webmin server in /usr/local/webmin
    

    2. Command to start webmin service :

    [root@CentOS57 ~]# /etc/webmin/start
    Starting Webmin server in /usr/local/webmin
    Pre-loaded WebminCore
    

    3. Command to reload webmin service :

    [root@CentOS57 ~]# /etc/webmin/reload
    Reloading Webmin server in /usr/local/webmin
    

    4. Command to restart webmin service :

    [root@CentOS57 ~]# /etc/webmin/restart
    Stopping Webmin server in /usr/local/webmin
    Starting Webmin server in /usr/local/webmin
    Pre-loaded WebminCore
    

    How to Install Webmin 1.570 on CentOS 5.7 from tar.gz file

    In this post, i will share on how to install the Webmin, a web-based interface for system administration for Linux, on CentOS 5.7 server. Different from my previous post on “How to Install Webmin 1.570-1 on CentOS 6.2 using RPM“, this post will show you the steps on installing the webmin from the tar.gz file.

    Download the tar.gz file.

    [root@CentOS57 ~]# cd /tmp
    [root@CentOS57 tmp]# wget http://prdownloads.sourceforge.net/webadmin/webmin-1.570.tar.gz
    --2012-01-21 08:22:30--  http://prdownloads.sourceforge.net/webadmin/webmin-1.570.tar.gz
    Resolving prdownloads.sourceforge.net... 216.34.181.59
    Connecting to prdownloads.sourceforge.net|216.34.181.59|:80... connected.
    HTTP request sent, awaiting response... 301 Moved Permanently
    Location: http://downloads.sourceforge.net/project/webadmin/webmin/1.570/webmin-1.570.tar.gz [following]
    --2012-01-21 08:22:31--  http://downloads.sourceforge.net/project/webadmin/webmin/1.570/webmin-1.570.tar.gz
    Resolving downloads.sourceforge.net... 216.34.181.59
    Reusing existing connection to prdownloads.sourceforge.net:80.
    HTTP request sent, awaiting response... 302 Found
    Location: http://cdnetworks-kr-1.dl.sourceforge.net/project/webadmin/webmin/1.570/webmin-1.570.tar.gz [following]
    --2012-01-21 08:22:31--  http://cdnetworks-kr-1.dl.sourceforge.net/project/webadmin/webmin/1.570/webmin-1.570.tar.gz
    Resolving cdnetworks-kr-1.dl.sourceforge.net... 211.39.135.162
    Connecting to cdnetworks-kr-1.dl.sourceforge.net|211.39.135.162|:80... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 15200156 (14M) [application/x-gzip]
    Saving to: `webmin-1.570.tar.gz'
    
    100%[==========================================================>] 15,200,156  81.3K/s   in 3m 10s
    
    2012-01-21 08:25:42 (78.2 KB/s) - `webmin-1.570.tar.gz' saved [15200156/15200156]
    

    Extract the file.

    [root@CentOS57 tmp]# tar xzvf webmin-1.570.tar.gz
    [root@CentOS57 tmp]# cd webmin-1.570
    

    When the setup.sh script is run, it will ask the following questions :

    The Webmin configuration directory
    -The directory in which all Webmin configuration information is stored. This is now separate from the Webmin install directory, so that configurations are saved when you upgrade.
    If you have previously installed Webmin and use the same config directory, this will be the only question asked.

    The Webmin log directory
    -The location for pid and webserver log files.

    The full path to perl on your system
    -This is usually /usr/bin/perl or /usr/local/bin/perl

    Your Operating system type
    -In Webmin versions 0.990 and above, this question is only asked if your operating system cannot be automatically determined.
    The setup script will display a list of supported systems. If your OS is not on the list, you can try choosing the closest match. However this may not work properly, and may even cause serious problems!

    Web server port
    -The TCP port that the Webmin web server will listen on.

    Web server login and password
    -The login name and password used to acess the Webmin web server.

    Web server hostname
    -The hostname of the machine on which Webmin will run.

    Use SSL
    -This question will only be asked if your system has the Perl SSL libraries installed. See below for more..

    Start Webmin at boot time
    -If your OS is supported, Webmin will ask if you want to have it automatically started at boot time.

    [root@CentOS57 webmin-1.570]# ./setup.sh /usr/local/webmin
    ***********************************************************************
    *            Welcome to the Webmin setup script, version 1.570        *
    ***********************************************************************
    Webmin is a web-based interface that allows Unix-like operating
    systems and common Unix services to be easily administered.
    
    Installing Webmin from /tmp/webmin-1.570 to /usr/local/webmin ...
    
    ***********************************************************************
    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]:
    Log file directory [/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:    CentOS Linux
    Operating system version: 5.7
    
    ***********************************************************************
    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):
    Login password:
    Password again:
    The Perl SSLeay library is not installed. SSL not available.
    Start Webmin at boot time (y/n): y
    ***********************************************************************
    Copying files to /usr/local/webmin ..
    ..done
    
    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 /etc/webmin/uninstall.sh ..
    ..done
    
    Changing ownership and permissions ..
    ..done
    
    Running postinstall scripts ..
    PID file /var/webmin/miniserv.pid does not exist
    Subroutine setup_ca redefined at /usr/local/webmin/webmin/webmin-lib.pl line 72.
    Subroutine install_webmin_module redefined at /usr/local/webmin/webmin/webmin-lib.pl line 122.
    Subroutine grant_user_module redefined at /usr/local/webmin/webmin/webmin-lib.pl line 419.
    Subroutine delete_webmin_module redefined at /usr/local/webmin/webmin/webmin-lib.pl line 460.
    Subroutine file_basename redefined at /usr/local/webmin/webmin/webmin-lib.pl line 569.
    Subroutine gnupg_setup redefined at /usr/local/webmin/webmin/webmin-lib.pl line 583.
    Subroutine list_standard_modules redefined at /usr/local/webmin/webmin/webmin-lib.pl line 611.
    Subroutine standard_chooser_button redefined at /usr/local/webmin/webmin/webmin-lib.pl line 643.
    Subroutine list_third_modules redefined at /usr/local/webmin/webmin/webmin-lib.pl line 656.
    Subroutine third_chooser_button redefined at /usr/local/webmin/webmin/webmin-lib.pl line 688.
    Subroutine get_webmin_base_version redefined at /usr/local/webmin/webmin/webmin-lib.pl line 699.
    Subroutine base_version redefined at /usr/local/webmin/webmin/webmin-lib.pl line 709.
    Subroutine get_newmodule_users redefined at /usr/local/webmin/webmin/webmin-lib.pl line 720.
    Subroutine save_newmodule_users redefined at /usr/local/webmin/webmin/webmin-lib.pl line 742.
    Subroutine get_miniserv_sockets redefined at /usr/local/webmin/webmin/webmin-lib.pl line 766.
    Subroutine fetch_updates redefined at /usr/local/webmin/webmin/webmin-lib.pl line 814.
    Subroutine check_update_signature redefined at /usr/local/webmin/webmin/webmin-lib.pl line 881.
    Subroutine find_cron_job redefined at /usr/local/webmin/webmin/webmin-lib.pl line 912.
    Subroutine get_ipkeys redefined at /usr/local/webmin/webmin/webmin-lib.pl line 924.
    Subroutine save_ipkeys redefined at /usr/local/webmin/webmin/webmin-lib.pl line 945.
    Subroutine validate_key_cert redefined at /usr/local/webmin/webmin/webmin-lib.pl line 977.
    Subroutine detect_operating_system redefined at /usr/local/webmin/webmin/webmin-lib.pl line 998.
    Subroutine show_webmin_notifications redefined at /usr/local/webmin/webmin/webmin-lib.pl line 1033.
    Subroutine get_webmin_notifications redefined at /usr/local/webmin/webmin/webmin-lib.pl line 1049.
    Subroutine get_system_uptime redefined at /usr/local/webmin/webmin/webmin-lib.pl line 1238.
    Subroutine list_operating_systems redefined at /usr/local/webmin/webmin/webmin-lib.pl line 1285.
    Subroutine shared_root_directory redefined at /usr/local/webmin/webmin/webmin-lib.pl line 1310.
    Subroutine submit_os_info redefined at /usr/local/webmin/webmin/webmin-lib.pl line 1347.
    Subroutine get_webmin_id redefined at /usr/local/webmin/webmin/webmin-lib.pl line 1375.
    Subroutine ip_match redefined at /usr/local/webmin/webmin/webmin-lib.pl line 1391.
    Subroutine prefix_to_mask redefined at /usr/local/webmin/webmin/webmin-lib.pl line 1463.
    Subroutine valid_allow redefined at /usr/local/webmin/webmin/webmin-lib.pl line 1477.
    Subroutine get_preloads redefined at /usr/local/webmin/webmin/webmin-lib.pl line 1522.
    Subroutine save_preloads redefined at /usr/local/webmin/webmin/webmin-lib.pl line 1534.
    Subroutine get_tempdirs redefined at /usr/local/webmin/webmin/webmin-lib.pl line 1545.
    Subroutine save_tempdirs redefined at /usr/local/webmin/webmin/webmin-lib.pl line 1562.
    Subroutine get_module_install_type redefined at /usr/local/webmin/webmin/webmin-lib.pl line 1581.
    Subroutine get_install_type redefined at /usr/local/webmin/webmin/webmin-lib.pl line 1598.
    Subroutine list_cached_files redefined at /usr/local/webmin/webmin/webmin-lib.pl line 1628.
    Subroutine show_restart_page redefined at /usr/local/webmin/webmin/webmin-lib.pl line 1647.
    Subroutine cert_info redefined at /usr/local/webmin/webmin/webmin-lib.pl line 1665.
    Subroutine cert_pem_data redefined at /usr/local/webmin/webmin/webmin-lib.pl line 1706.
    Subroutine cert_pkcs12_data redefined at /usr/local/webmin/webmin/webmin-lib.pl line 1721.
    Subroutine get_blocked_users_hosts redefined at /usr/local/webmin/webmin/webmin-lib.pl line 1747.
    Subroutine show_ssl_key_form redefined at /usr/local/webmin/webmin/webmin-lib.pl line 1775.
    Subroutine parse_ssl_key_form redefined at /usr/local/webmin/webmin/webmin-lib.pl line 1819.
    Subroutine build_installed_modules redefined at /usr/local/webmin/webmin/webmin-lib.pl line 1892.
    Subroutine get_latest_webmin_version redefined at /usr/local/webmin/webmin/webmin-lib.pl line 1934.
    Subroutine filter_updates redefined at /usr/local/webmin/webmin/webmin-lib.pl line 1967.
    Subroutine list_keys redefined at /usr/local/webmin/webmin/gnupg-lib.pl line 23.
    Subroutine list_keys_sorted redefined at /usr/local/webmin/webmin/gnupg-lib.pl line 74.
    Subroutine list_secret_keys redefined at /usr/local/webmin/webmin/gnupg-lib.pl line 82.
    Subroutine key_fingerprint redefined at /usr/local/webmin/webmin/gnupg-lib.pl line 88.
    Subroutine get_passphrase redefined at /usr/local/webmin/webmin/gnupg-lib.pl line 105.
    Subroutine put_passphrase redefined at /usr/local/webmin/webmin/gnupg-lib.pl line 116.
    Subroutine encrypt_data redefined at /usr/local/webmin/webmin/gnupg-lib.pl line 128.
    Subroutine decrypt_data redefined at /usr/local/webmin/webmin/gnupg-lib.pl line 167.
    Subroutine sign_data redefined at /usr/local/webmin/webmin/gnupg-lib.pl line 224.
    Subroutine verify_data redefined at /usr/local/webmin/webmin/gnupg-lib.pl line 283.
    Subroutine read_entire_file redefined at /usr/local/webmin/webmin/gnupg-lib.pl line 327.
    Subroutine write_entire_file redefined at /usr/local/webmin/webmin/gnupg-lib.pl line 339.
    Subroutine get_trust_level redefined at /usr/local/webmin/webmin/gnupg-lib.pl line 349.
    Subroutine delete_key redefined at /usr/local/webmin/webmin/gnupg-lib.pl line 371.
    Subroutine default_email_address redefined at /usr/local/webmin/webmin/gnupg-lib.pl line 398.
    Subroutine fetch_gpg_key redefined at /usr/local/webmin/webmin/gnupg-lib.pl line 415.
    Subroutine search_gpg_keys redefined at /usr/local/webmin/webmin/gnupg-lib.pl line 442.
    ..done
    
    Enabling background status collection ..
    PID file /var/webmin/miniserv.pid does not exist
    ..done
    
    Attempting to start Webmin mini web server..
    Starting Webmin server in /usr/local/webmin
    Pre-loaded WebminCore
    ..done
    
    ***********************************************************************
    Webmin has been installed and started successfully. Use your web
    browser to go to
    
      http://CentOS57:10000/
    
    and login with the name and password you entered previously.