How to Install MySQL Database Server on CentOS 6.2

In this post, i will show you on how to install MySQL server using yum command. Assume that you have installed minimal installation type CentOS 6.2 and has setup your own local yum repository. You can use internet CentOS yum repository instead if you have direct internet connection to your server.

How to Setup Local Yum Repository from CD-ROM/DVD-ROM image on CentOS 6.2

    [root@centos6 ~]# yum install mysql mysql-server
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
    Setting up Install Process
    Resolving Dependencies
    --> Running transaction check
    ---> Package mysql.i686 0:5.1.52-1.el6_0.1 will be installed
    ---> Package mysql-server.i686 0:5.1.52-1.el6_0.1 will be installed
    --> Processing Dependency: perl-DBI for package: mysql-server-5.1.52-1.el6_0.1.i686
    --> Processing Dependency: perl-DBD-MySQL for package: mysql-server-5.1.52-1.el6_0.1.i686
    --> Processing Dependency: perl(DBI) for package: mysql-server-5.1.52-1.el6_0.1.i686
    --> Running transaction check
    ---> Package perl-DBD-MySQL.i686 0:4.013-3.el6 will be installed
    ---> Package perl-DBI.i686 0:1.609-4.el6 will be installed
    --> Finished Dependency Resolution
    
    Dependencies Resolved
    
    =================================================================================================
     Package                Arch         Version                  Repository                    Size
    =================================================================================================
    Installing:
     mysql                  i686         5.1.52-1.el6_0.1         CentOS6.2-Repository         898 k
     mysql-server           i686         5.1.52-1.el6_0.1         CentOS6.2-Repository         8.3 M
    Installing for dependencies:
     perl-DBD-MySQL         i686         4.013-3.el6              CentOS6.2-Repository         134 k
     perl-DBI               i686         1.609-4.el6              CentOS6.2-Repository         705 k
    
    Transaction Summary
    =================================================================================================
    Install       4 Package(s)
    
    Total download size: 10 M
    Installed size: 27 M
    Is this ok [y/N]: y
    Downloading Packages:
    -------------------------------------------------------------------------------------------------
    Total                                                             13 MB/s |  10 MB     00:00
    Running rpm_check_debug
    Running Transaction Test
    Transaction Test Succeeded
    Running Transaction
      Installing : perl-DBI-1.609-4.el6.i686                                                     1/4
      Installing : perl-DBD-MySQL-4.013-3.el6.i686                                               2/4
      Installing : mysql-5.1.52-1.el6_0.1.i686                                                   3/4
      Installing : mysql-server-5.1.52-1.el6_0.1.i686                                            4/4
    
    Installed:
      mysql.i686 0:5.1.52-1.el6_0.1               mysql-server.i686 0:5.1.52-1.el6_0.1
    
    Dependency Installed:
      perl-DBD-MySQL.i686 0:4.013-3.el6                  perl-DBI.i686 0:1.609-4.el6
    
    Complete!
    

How to Install php on CentOS 6.2

In This post, I will show you on how to install the php packages on CentOS 6.2. Assume that you have installed minimal installation type CentOS 6.2 and has setup your own local yum repository. You can use internet CentOS yum repository instead if you have direct internet connection to your server.

How to Setup Local Yum Repository from CD-ROM/DVD-ROM image on CentOS 6.2

    [root@centos6 ~]# yum install php*
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
    CentOS6.2-Repository                                                            | 1.3 kB     00:00 ...
    Setting up Install Process
    Resolving Dependencies
    --> Running transaction check
    ---> Package php.i686 0:5.3.3-3.el6_1.3 will be installed
    ---> Package php-cli.i686 0:5.3.3-3.el6_1.3 will be installed
    --> Processing Dependency: libedit.so.0 for package: php-cli-5.3.3-3.el6_1.3.i686
    ---> Package php-common.i686 0:5.3.3-3.el6_1.3 will be installed
    ---> Package php-gd.i686 0:5.3.3-3.el6_1.3 will be installed
    --> Processing Dependency: libpng12.so.0(PNG12_0) for package: php-gd-5.3.3-3.el6_1.3.i686
    --> Processing Dependency: libpng12.so.0 for package: php-gd-5.3.3-3.el6_1.3.i686
    --> Processing Dependency: libjpeg.so.62 for package: php-gd-5.3.3-3.el6_1.3.i686
    --> Processing Dependency: libfreetype.so.6 for package: php-gd-5.3.3-3.el6_1.3.i686
    --> Processing Dependency: libXpm.so.4 for package: php-gd-5.3.3-3.el6_1.3.i686
    --> Processing Dependency: libX11.so.6 for package: php-gd-5.3.3-3.el6_1.3.i686
    ---> Package php-ldap.i686 0:5.3.3-3.el6_1.3 will be installed
    ---> Package php-mysql.i686 0:5.3.3-3.el6_1.3 will be installed
    ---> Package php-odbc.i686 0:5.3.3-3.el6_1.3 will be installed
    --> Processing Dependency: libodbc.so.2 for package: php-odbc-5.3.3-3.el6_1.3.i686
    ---> Package php-pdo.i686 0:5.3.3-3.el6_1.3 will be installed
    ---> Package php-pear.noarch 1:1.9.4-4.el6 will be installed
    ---> Package php-pecl-apc.i686 0:3.1.3p1-1.2.el6.1 will be installed
    ---> Package php-pecl-memcache.i686 0:3.0.5-3.el6 will be installed
    ---> Package php-pgsql.i686 0:5.3.3-3.el6_1.3 will be installed
    --> Processing Dependency: libpq.so.5 for package: php-pgsql-5.3.3-3.el6_1.3.i686
    ---> Package php-soap.i686 0:5.3.3-3.el6_1.3 will be installed
    ---> Package php-xml.i686 0:5.3.3-3.el6_1.3 will be installed
    --> Processing Dependency: libxslt.so.1(LIBXML2_1.0.24) for package: php-xml-5.3.3-3.el6_1.3.i686
    --> Processing Dependency: libxslt.so.1(LIBXML2_1.0.18) for package: php-xml-5.3.3-3.el6_1.3.i686
    --> Processing Dependency: libxslt.so.1(LIBXML2_1.0.13) for package: php-xml-5.3.3-3.el6_1.3.i686
    --> Processing Dependency: libxslt.so.1(LIBXML2_1.0.11) for package: php-xml-5.3.3-3.el6_1.3.i686
    --> Processing Dependency: libxslt.so.1 for package: php-xml-5.3.3-3.el6_1.3.i686
    --> Processing Dependency: libexslt.so.0 for package: php-xml-5.3.3-3.el6_1.3.i686
    ---> Package php-xmlrpc.i686 0:5.3.3-3.el6_1.3 will be installed
    --> Running transaction check
    ---> Package freetype.i686 0:2.3.11-6.el6_1.7 will be installed
    ---> Package libX11.i686 0:1.3-2.el6 will be installed
    --> Processing Dependency: libX11-common = 1.3-2.el6 for package: libX11-1.3-2.el6.i686
    --> Processing Dependency: libxcb.so.1 for package: libX11-1.3-2.el6.i686
    ---> Package libXpm.i686 0:3.5.8-2.el6 will be installed
    ---> Package libedit.i686 0:2.11-4.20080712cvs.1.el6 will be installed
    ---> Package libjpeg.i686 0:6b-46.el6 will be installed
    ---> Package libpng.i686 2:1.2.46-1.el6_1 will be installed
    ---> Package libxslt.i686 0:1.1.26-2.el6 will be installed
    ---> Package postgresql-libs.i686 0:8.4.9-1.el6_1.1 will be installed
    ---> Package unixODBC.i686 0:2.2.14-11.el6 will be installed
    --> Processing Dependency: libltdl.so.7 for package: unixODBC-2.2.14-11.el6.i686
    --> Running transaction check
    ---> Package libX11-common.noarch 0:1.3-2.el6 will be installed
    ---> Package libtool-ltdl.i686 0:2.2.6-15.5.el6 will be installed
    ---> Package libxcb.i686 0:1.5-1.el6 will be installed
    --> Processing Dependency: libXau.so.6 for package: libxcb-1.5-1.el6.i686
    --> Running transaction check
    ---> Package libXau.i686 0:1.0.5-1.el6 will be installed
    --> Finished Dependency Resolution
    
    Dependencies Resolved
    
    =======================================================================================================
     Package                 Arch         Version                         Repository                  Size
    =======================================================================================================
    Installing:
     php                     i686         5.3.3-3.el6_1.3                 CentOS6.2-Repository       1.1 M
     php-cli                 i686         5.3.3-3.el6_1.3                 CentOS6.2-Repository       2.2 M
     php-common              i686         5.3.3-3.el6_1.3                 CentOS6.2-Repository       522 k
     php-gd                  i686         5.3.3-3.el6_1.3                 CentOS6.2-Repository       102 k
     php-ldap                i686         5.3.3-3.el6_1.3                 CentOS6.2-Repository        35 k
     php-mysql               i686         5.3.3-3.el6_1.3                 CentOS6.2-Repository        76 k
     php-odbc                i686         5.3.3-3.el6_1.3                 CentOS6.2-Repository        47 k
     php-pdo                 i686         5.3.3-3.el6_1.3                 CentOS6.2-Repository        71 k
     php-pear                noarch       1:1.9.4-4.el6                   CentOS6.2-Repository       393 k
     php-pecl-apc            i686         3.1.3p1-1.2.el6.1               CentOS6.2-Repository        93 k
     php-pecl-memcache       i686         3.0.5-3.el6                     CentOS6.2-Repository        60 k
     php-pgsql               i686         5.3.3-3.el6_1.3                 CentOS6.2-Repository        66 k
     php-soap                i686         5.3.3-3.el6_1.3                 CentOS6.2-Repository       138 k
     php-xml                 i686         5.3.3-3.el6_1.3                 CentOS6.2-Repository        98 k
     php-xmlrpc              i686         5.3.3-3.el6_1.3                 CentOS6.2-Repository        50 k
    Installing for dependencies:
     freetype                i686         2.3.11-6.el6_1.7                CentOS6.2-Repository       362 k
     libX11                  i686         1.3-2.el6                       CentOS6.2-Repository       585 k
     libX11-common           noarch       1.3-2.el6                       CentOS6.2-Repository       188 k
     libXau                  i686         1.0.5-1.el6                     CentOS6.2-Repository        22 k
     libXpm                  i686         3.5.8-2.el6                     CentOS6.2-Repository        58 k
     libedit                 i686         2.11-4.20080712cvs.1.el6        CentOS6.2-Repository        73 k
     libjpeg                 i686         6b-46.el6                       CentOS6.2-Repository       133 k
     libpng                  i686         2:1.2.46-1.el6_1                CentOS6.2-Repository       184 k
     libtool-ltdl            i686         2.2.6-15.5.el6                  CentOS6.2-Repository        45 k
     libxcb                  i686         1.5-1.el6                       CentOS6.2-Repository       104 k
     libxslt                 i686         1.1.26-2.el6                    CentOS6.2-Repository       448 k
     postgresql-libs         i686         8.4.9-1.el6_1.1                 CentOS6.2-Repository       201 k
     unixODBC                i686         2.2.14-11.el6                   CentOS6.2-Repository       382 k
    
    Transaction Summary
    =======================================================================================================
    Install      28 Package(s)
    
    Total download size: 7.8 M
    Installed size: 26 M
    Is this ok [y/N]: y
    Downloading Packages:
    -------------------------------------------------------------------------------------------------------
    Total                                                                  7.2 MB/s | 7.8 MB     00:01
    Running rpm_check_debug
    Running Transaction Test
    Transaction Test Succeeded
    Running Transaction
    Warning: RPMDB altered outside of yum.
      Installing : libX11-common-1.3-2.el6.noarch                                                     1/28
      Installing : php-common-5.3.3-3.el6_1.3.i686                                                    2/28
      Installing : php-pdo-5.3.3-3.el6_1.3.i686                                                       3/28
      Installing : libxslt-1.1.26-2.el6.i686                                                          4/28
      Installing : postgresql-libs-8.4.9-1.el6_1.1.i686                                               5/28
      Installing : libedit-2.11-4.20080712cvs.1.el6.i686                                              6/28
      Installing : php-cli-5.3.3-3.el6_1.3.i686                                                       7/28
      Installing : 1:php-pear-1.9.4-4.el6.noarch                                                      8/28
      Installing : libjpeg-6b-46.el6.i686                                                             9/28
      Installing : libtool-ltdl-2.2.6-15.5.el6.i686                                                  10/28
      Installing : unixODBC-2.2.14-11.el6.i686                                                       11/28
      Installing : 2:libpng-1.2.46-1.el6_1.i686                                                      12/28
      Installing : freetype-2.3.11-6.el6_1.7.i686                                                    13/28
      Installing : libXau-1.0.5-1.el6.i686                                                           14/28
      Installing : libxcb-1.5-1.el6.i686                                                             15/28
      Installing : libX11-1.3-2.el6.i686                                                             16/28
      Installing : libXpm-3.5.8-2.el6.i686                                                           17/28
      Installing : php-gd-5.3.3-3.el6_1.3.i686                                                       18/28
      Installing : php-odbc-5.3.3-3.el6_1.3.i686                                                     19/28
      Installing : php-pecl-apc-3.1.3p1-1.2.el6.1.i686                                               20/28
      Installing : php-pecl-memcache-3.0.5-3.el6.i686                                                21/28
      Installing : php-5.3.3-3.el6_1.3.i686                                                          22/28
      Installing : php-pgsql-5.3.3-3.el6_1.3.i686                                                    23/28
      Installing : php-xml-5.3.3-3.el6_1.3.i686                                                      24/28
      Installing : php-mysql-5.3.3-3.el6_1.3.i686                                                    25/28
      Installing : php-xmlrpc-5.3.3-3.el6_1.3.i686                                                   26/28
      Installing : php-ldap-5.3.3-3.el6_1.3.i686                                                     27/28
      Installing : php-soap-5.3.3-3.el6_1.3.i686                                                     28/28
    
    Installed:
      php.i686 0:5.3.3-3.el6_1.3                        php-cli.i686 0:5.3.3-3.el6_1.3
      php-common.i686 0:5.3.3-3.el6_1.3                 php-gd.i686 0:5.3.3-3.el6_1.3
      php-ldap.i686 0:5.3.3-3.el6_1.3                   php-mysql.i686 0:5.3.3-3.el6_1.3
      php-odbc.i686 0:5.3.3-3.el6_1.3                   php-pdo.i686 0:5.3.3-3.el6_1.3
      php-pear.noarch 1:1.9.4-4.el6                     php-pecl-apc.i686 0:3.1.3p1-1.2.el6.1
      php-pecl-memcache.i686 0:3.0.5-3.el6              php-pgsql.i686 0:5.3.3-3.el6_1.3
      php-soap.i686 0:5.3.3-3.el6_1.3                   php-xml.i686 0:5.3.3-3.el6_1.3
      php-xmlrpc.i686 0:5.3.3-3.el6_1.3
    
    Dependency Installed:
      freetype.i686 0:2.3.11-6.el6_1.7                libX11.i686 0:1.3-2.el6
      libX11-common.noarch 0:1.3-2.el6                libXau.i686 0:1.0.5-1.el6
      libXpm.i686 0:3.5.8-2.el6                       libedit.i686 0:2.11-4.20080712cvs.1.el6
      libjpeg.i686 0:6b-46.el6                        libpng.i686 2:1.2.46-1.el6_1
      libtool-ltdl.i686 0:2.2.6-15.5.el6              libxcb.i686 0:1.5-1.el6
      libxslt.i686 0:1.1.26-2.el6                     postgresql-libs.i686 0:8.4.9-1.el6_1.1
      unixODBC.i686 0:2.2.14-11.el6
    
    Complete!
    

How to Setup Local Yum Repository from CD-ROM/DVD-ROM image on CentOS 6.2

In this post, i will share on how to update and install the RPM packages from CD-ROM/DVD-ROM image on CentOS 6.2. This will very useful when you are running on slow internet connection. Instead of go through the internet connection, it is possible to use Local CD/DVD-ROM as your yum repository. There are two methods to install and configure local CentOS 6.2 yum repository. Both methods have been tested and working on CentOS 6.2 linux server. You can select any method that you most preferred. This may be also applicable on other version of CentOS server.

Method 1:
1. Insert DVD/ISO into DVD-Drive.
2. Mount the ISO from the DVD-ROM into /mnt directory :

    [root@centos62 ~]# mount /dev/cdrom /mnt
    mount: block device /dev/sr0 is write-protected, mounting read-only
    

3. Create centos62.repo text file in /etc/yum.repos.d/ with the following content. Please create something as follow:

    [root@centos62 ~]# vi /etc/yum.repos.d/centos62.repo
    
    [CentOS6.2-Repository]
    name=DVD-CentOS6.2 repository
    baseurl=file:///mnt
    enabled=1
    gpgcheck=0
    

4. Finish. You can start install, remove and update using yum command :
Example :

    [root@centos62 ~]# yum install httpd -y
    

Method 2 :
1. Check the existing partition on your CentOS 6.2 server

    [root@centos6 ~]# df
    Filesystem           1K-blocks      Used Available Use% Mounted on
    /dev/mapper/VolGroup-lv_root
                          18102140   1165764  16016824   7% /
    tmpfs                   515444         0    515444   0% /dev/shm
    /dev/sda1               495844     29842    440402   7% /boot
    

2. Create localrepo directory in /mnt :

    [root@centos6 ~]# mkdir /mnt/localrepo
    

3. Create 1 2 3 directory in /mnt/localrepo

    [root@centos6 ~]# mkdir -p /mnt/localrepo/{1,2,3}
    

4. Mount the ISO from the DVDROM into /mnt/localrepo/1 directory

    [root@centos6 ~]# mount -o loop /dev/cdrom /mnt/localrepo/1
    
    [root@centos6 ~]# df -lh
    Filesystem            Size  Used Avail Use% Mounted on
    /dev/mapper/VolGroup-lv_root
                           18G  1.2G   16G   7% /
    tmpfs                 504M     0  504M   0% /dev/shm
    /dev/sda1             485M   30M  431M   7% /boot
    /dev/sr0              3.6G  3.6G     0 100% /mnt/localrepo/1
    

5. Create Temporary repo folder under /tmp to put required rpm’s packages for createrepo installation.

    [root@centos6 ~]# mkdir /tmp/repo
    

6. Copy the require pacckages to install create repo:

    [root@centos6 ~]# cp /mnt/localrepo/1/Packages/createrepo* /tmp/repo
    [root@centos6 ~]# cp /mnt/localrepo/1/Packages/deltarpm* /tmp/repo
    [root@centos6 ~]# cp /mnt/localrepo/1/Packages/libxml2-python* /tmp/repo
    [root@centos6 ~]# cp /mnt/localrepo/1/Packages/python-deltarpm* /tmp/repo
    [root@centos6 ~]# ls /tmp/repo
    createrepo-0.9.8-4.el6.noarch.rpm          libxml2-python-2.7.6-4.el6.i686.rpm
    deltarpm-3.5-0.5.20090913git.el6.i686.rpm  python-deltarpm-3.5-0.5.20090913git.el6.i686.rpm
    

7. Install the rpm packages using below command:

    [root@centos6 ~]# rpm -ivh /tmp/repo/*
    Preparing...                ########################################### [100%]
       1:deltarpm               ########################################### [ 25%]
       2:python-deltarpm        ########################################### [ 50%]
       3:libxml2-python         ########################################### [ 75%]
       4:createrepo             ########################################### [100%]
    

8. Go to /mnt/localrepo directory.

    [root@centos6 ~]# cd /mnt/localrepo/
    

9. Run createrepo command :

    [root@centos6 localrepo]# createrepo .
    2704/3042 - 1/Packages/system-config-users-docs-1.0.8-1.el6.noarch.rpm
    iso-8859-1 encoding on Ville Skyttä  - 2.8.2-2
    
    3042/3042 - 1/Packages/zsh-4.3.10-4.1.el6.i686.rpm
    Saving Primary metadata
    Saving file lists metadata
    Saving other metadata
    [root@centos6 localrepo]# ls
    1  2  3  repodata
    

10. Clean up the repo :

    [root@centos6 ~]# yum clean all
    Loaded plugins: fastestmirror
    Cleaning up Everything
    Cleaning up list of fastest mirrors
    

11. Create a repo config file in /etc/yum.repos.d/ directory :

    [root@centos6 ~]# vi /etc/yum.repos.d/local.repo
    
    [CentOS6.2-Repository]
    name=CentOS6.2 repository
    baseurl=file:///mnt/localrepo
    enabled=1
    gpgcheck=0
    

How to Change the Current Date and Time on CentOS 6.2

Symptom:
My CentOS 6.2 time is not correct.

Solution:
Change the current time manually as below:

1. To display the current:

    [root@centos6 ~]# date
    Fri Jan  6 11:28:23 MYT 2012
    

2. To Change the current date:

    [root@centos6 ~]# date 010611272012
    Fri Jan  6 11:27:00 MYT 2012
    
    MM - Two digit month number
    DD - Two digit date
    hh - Two digit 24 hour system hour
    mm - Two digit minute
    YYYY - Four digit year code
    

How to Uninstall Webmin on CentOS 6.2

In this post, i will guide on how to properly remove the Webmin package.

Check the webmin installed version, so that you can easily remove the package by specified exact package name.

    [root@centos6 ~]# rpm -qa webmin
    webmin-1.570-1.noarch
    

Remove rpm package using this command :

    [root@centos6 ~]# rpm -e webmin-1.570-1.noarch
    Running uninstall scripts ..
    Deleted init script /etc/rc.d/init.d/webmin
    Subroutine list_servers redefined at /usr/libexec/webmin/servers/servers-lib.pl line 91.
    Subroutine list_servers_sorted redefined at /usr/libexec/webmin/servers/servers-lib.pl line 110.
    Subroutine get_server redefined at /usr/libexec/webmin/servers/servers-lib.pl line 142.
    Subroutine save_server redefined at /usr/libexec/webmin/servers/servers-lib.pl line 157.
    Subroutine delete_server redefined at /usr/libexec/webmin/servers/servers-lib.pl line 174.
    Subroutine can_use_server redefined at /usr/libexec/webmin/servers/servers-lib.pl line 187.
    Subroutine list_all_groups redefined at /usr/libexec/webmin/servers/servers-lib.pl line 207.
    Subroutine logged_in redefined at /usr/libexec/webmin/servers/servers-lib.pl line 275.
    Subroutine get_server_types redefined at /usr/libexec/webmin/servers/servers-lib.pl line 300.
    Subroutine this_server redefined at /usr/libexec/webmin/servers/servers-lib.pl line 310.
    Subroutine get_my_address redefined at /usr/libexec/webmin/servers/servers-lib.pl line 329.
    Subroutine address_to_broadcast redefined at /usr/libexec/webmin/servers/servers-lib.pl line 358.
    Subroutine test_server redefined at /usr/libexec/webmin/servers/servers-lib.pl line 372.
    Subroutine find_cron_job redefined at /usr/libexec/webmin/servers/servers-lib.pl line 391.
    Subroutine find_servers redefined at /usr/libexec/webmin/servers/servers-lib.pl line 404.
    

How to Install Webmin 1.570-1 on CentOS 6.2 using RPM

In this post, i will share you on how to install Webmin, a web-based interface for system administration for Linux, on CentOS 6.2. Assumed that you have root access and understand the basic usage of the webmin software.

1. Download Webmin:

    [root@centos6 ~]# wget http://prdownloads.sourceforge.net/webadmin/webmin-1.570-1.noarch.rpm
    --2012-01-07 05:28:08--  http://prdownloads.sourceforge.net/webadmin/webmin-1.570-1.noarch.rpm
    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-1.noarch.rpm [following]
    --2012-01-07 05:28:09--  http://downloads.sourceforge.net/project/webadmin/webmin/1.570/webmin-1.570-1.noarch.rpm
    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-2.dl.sourceforge.net/project/webadmin/webmin/1.570/webmin-1.570-1.noarch.rpm [following]
    --2012-01-07 05:28:09--  http://cdnetworks-kr-2.dl.sourceforge.net/project/webadmin/webmin/1.570/webmin-1.570-1.noarch.rpm
    Resolving cdnetworks-kr-2.dl.sourceforge.net... 211.39.135.163
    Connecting to cdnetworks-kr-2.dl.sourceforge.net|211.39.135.163|:80... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 16358730 (16M) [application/x-rpm]
    Saving to: âwebmin-1.570-1.noarch.rpmâ
    
    100%[======================================================>] 16,358,730  16.8K/s   in 15m 45s
    
    2012-01-07 05:43:55 (16.9 KB/s) - âwebmin-1.570-1.noarch.rpmâ
    

2. Add the GPG Key:

    [root@centos6 ~]# rpm --import http://www.webmin.com/jcameron-key.asc
    

3. Install webmin :

    [root@centos6 ~]# rpm -U webmin-1.570-1.noarch.rpm
    Operating system is CentOS Linux
    Webmin install complete. You can now login to http://youripaddress:10000/
    as root with your root password.
    

4. Start webmin service :

    [root@centos6 ~]# service webmin start
    

or

    [root@centos6 ~]# /etc/init.d/webmin start
    

5. Make webmin auto start after reboot the centOS server:

    [root@centos6 ~]# chkconfig webmin on
    [root@centos6 ~]# chkconfig --list
    webmin          0:off   1:off   2:on    3:on    4:on    5:on    6:off
    

6. Login the webmin web interface :

http://youripaddress:10000

How to Install Perl in CentOS 6.2

When you try to install the rpm packages that was depend on the perl, you will get this error. The best practice is to check up if perl is already installed on your server before start the installation for the software that depend on perl to run.

Symptom :

    [root@centos6 ~]# rpm -U webmin-1.570-1.noarch.rpm
    warning: webmin-1.570-1.noarch.rpm: Header V3 DSA/SHA1 Signature, key ID 11f63c51: NOKEY
    error: Failed dependencies:
            /usr/bin/perl is needed by webmin-1.570-1.noarch
    

This is how you fix this problem. This command will install the perl and the dependencies.

    [root@centos6 ~]# yum install perl
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
     * base: mirrors.hostemo.com
     * extras: mirrors.hostemo.com
     * updates: mirrors.hostemo.com
    Setting up Install Process
    Resolving Dependencies
    --> Running transaction check
    ---> Package perl.i686 4:5.10.1-119.el6_1.1 will be installed
    --> Processing Dependency: perl-libs = 4:5.10.1-119.el6_1.1 for package: 4:perl-5.10.1-119.el6_1.1.i686
    --> Processing Dependency: perl-libs for package: 4:perl-5.10.1-119.el6_1.1.i686
    --> Processing Dependency: perl(Pod::Simple) for package: 4:perl-5.10.1-119.el6_1.1.i686
    --> Processing Dependency: libperl.so for package: 4:perl-5.10.1-119.el6_1.1.i686
    --> Processing Dependency: perl(version) for package: 4:perl-5.10.1-119.el6_1.1.i686
    --> Processing Dependency: perl(Module::Pluggable) for package: 4:perl-5.10.1-119.el6_1.1.i686
    --> Running transaction check
    ---> Package perl-Module-Pluggable.i686 1:3.90-119.el6_1.1 will be installed
    ---> Package perl-Pod-Simple.i686 1:3.13-119.el6_1.1 will be installed
    --> Processing Dependency: perl(Pod::Escapes) >= 1.04 for package: 1:perl-Pod-Simple-3.13-119.el6_1.1.i686
    ---> Package perl-libs.i686 4:5.10.1-119.el6_1.1 will be installed
    ---> Package perl-version.i686 3:0.77-119.el6_1.1 will be installed
    --> Running transaction check
    ---> Package perl-Pod-Escapes.i686 1:1.04-119.el6_1.1 will be installed
    --> Finished Dependency Resolution
    
    Dependencies Resolved
    
    ================================================================================================
     Package                        Arch          Version                       Repository     Size
    ================================================================================================
    Installing:
     perl                           i686          4:5.10.1-119.el6_1.1          base          9.7 M
    Installing for dependencies:
     perl-Module-Pluggable          i686          1:3.90-119.el6_1.1            base           37 k
     perl-Pod-Escapes               i686          1:1.04-119.el6_1.1            base           30 k
     perl-Pod-Simple                i686          1:3.13-119.el6_1.1            base          209 k
     perl-libs                      i686          4:5.10.1-119.el6_1.1          base          590 k
     perl-version                   i686          3:0.77-119.el6_1.1            base           49 k
    
    Transaction Summary
    ================================================================================================
    Install       6 Package(s)
    
    Total download size: 11 M
    Installed size: 30 M
    Is this ok [y/N]: y
    Downloading Packages:
    (1/6): perl-5.10.1-119.el6_1.1.i686.rpm                                  | 9.7 MB     02:26
    (2/6): perl-Module-Pluggable-3.90-119.el6_1.1.i686.rpm                   |  37 kB     00:00
    (3/6): perl-Pod-Escapes-1.04-119.el6_1.1.i686.rpm                        |  30 kB     00:00
    (4/6): perl-Pod-Simple-3.13-119.el6_1.1.i686.rpm                         | 209 kB     00:03
    (5/6): perl-libs-5.10.1-119.el6_1.1.i686.rpm                             | 590 kB     00:09
    (6/6): perl-version-0.77-119.el6_1.1.i686.rpm                            |  49 kB     00:00
    ------------------------------------------------------------------------------------------------
    Total                                                            67 kB/s |  11 MB     02:41
    Running rpm_check_debug
    Running Transaction Test
    Transaction Test Succeeded
    Running Transaction
      Installing : 1:perl-Pod-Escapes-1.04-119.el6_1.1.i686                                     1/6
      Installing : 3:perl-version-0.77-119.el6_1.1.i686                                         2/6
      Installing : 4:perl-libs-5.10.1-119.el6_1.1.i686                                          3/6
      Installing : 1:perl-Pod-Simple-3.13-119.el6_1.1.i686                                      4/6
      Installing : 1:perl-Module-Pluggable-3.90-119.el6_1.1.i686                                5/6
      Installing : 4:perl-5.10.1-119.el6_1.1.i686                                               6/6
    
    Installed:
      perl.i686 4:5.10.1-119.el6_1.1
    
    Dependency Installed:
      perl-Module-Pluggable.i686 1:3.90-119.el6_1.1     perl-Pod-Escapes.i686 1:1.04-119.el6_1.1
      perl-Pod-Simple.i686 1:3.13-119.el6_1.1           perl-libs.i686 4:5.10.1-119.el6_1.1
      perl-version.i686 3:0.77-119.el6_1.1
    
    Complete!
    

Check the installed perl version using this command:

    [root@centos6 ~]# rpm -qa perl
    perl-5.10.1-119.el6_1.1.i686
    

How to Install wget on CentOS 6.2

If your CentOS 6.2 server has been installed with minimal installation, wget command will not exist. Wget is a free network utility for linux to download files from the Web. Therefore, there is simple step to install the wget command utility into your CentOS 6.2 server.

Symptom/error message:

    [root@centos6 ~]# wget http://prdownloads.sourceforge.net/webadmin/webmin-1.570-1.noarch.rpm
    bash: wget: command not found
    

Install wget using yum install command:

    [root@centos6 ~]# yum install wget
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
     * base: mirror.issp.co.th
     * extras: mirror.yourconnect.com
     * updates: mirror.yourconnect.com
    base                                                                     | 3.7 kB     00:00
    extras                                                                   | 3.5 kB     00:00
    updates                                                                  | 3.5 kB     00:00
    Setting up Install Process
    Resolving Dependencies
    --> Running transaction check
    ---> Package wget.i686 0:1.12-1.4.el6 will be installed
    --> Finished Dependency Resolution
    
    Dependencies Resolved
    
    ================================================================================================
     Package             Arch                Version                      Repository           Size
    ================================================================================================
    Installing:
     wget                i686                1.12-1.4.el6                 base                481 k
    
    Transaction Summary
    ================================================================================================
    Install       1 Package(s)
    
    Total download size: 481 k
    Installed size: 1.8 M
    Is this ok [y/N]: y
    Downloading Packages:
    wget-1.12-1.4.el6.i686.rpm                                               | 481 kB     00:04
    warning: rpmts_HdrFromFdno: Header V3 RSA/SHA256 Signature, key ID c105b9de: NOKEY
    Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
    Importing GPG key 0xC105B9DE:
     Userid : CentOS-6 Key (CentOS 6 Official Signing Key) 
     Package: centos-release-6-2.el6.centos.7.i686 (@anaconda-CentOS-201112130233.i386/6.2)
     From   : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
    Is this ok [y/N]: y
    Running rpm_check_debug
    Running Transaction Test
    Transaction Test Succeeded
    Running Transaction
    Warning: RPMDB altered outside of yum.
      Installing : wget-1.12-1.4.el6.i686                                                       1/1
    
    Installed:
      wget.i686 0:1.12-1.4.el6
    
    Complete!
    

How to Configure Static IP Address on CentOS 6.2 Linux Server

After you have installed CentOS 6.2 linux server, the network configuration will be like this.

    DEVICE="eth0"
    HWADDR="xx:xx:xx:xx:xx:xx"
    NM_CONTROLLED="yes"
    ONBOOT="no"
    

The system will no get the ip automatically and the network interface will not auto start even after the server rebooted. Follow this steps to set static ip and set it auto start once rebooted in CentOS 6.2 :

1. Configure eth0:

    [root@centos6 ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
    
    DEVICE="eth0"
    HWADDR="00:0C:29:67:51:B1"
    NM_CONTROLLED="yes"
    ONBOOT="yes"
    IPADDR=192.168.1.44
    BOOTPRO=static
    NETMASK=255.255.255.0
    

2. Configure Default gateway:

    [root@centos6 ~]# vi /etc/sysconfig/network
    
    NETWORKING=yes
    HOSTNAME=centos6.2
    GATEWAY=192.168.1.1
    

3. Restart Network interface:

    [root@centos6 ~]# /etc/init.d/network restart
    

or

    [root@centos6 ~]# Service network restart
    

4. Configure DNS server:

    [root@centos6 ~]# vi /etc/resolv.conf
    
    nameserver 8.8.8.8
    nameserver 192.168.1.1