How to Install GNOME Desktop on Linux CentOS

In this post, i will share on how to install GNOME Desktop on Linux CentOS server. GNOME is a desktop environment and graphical user interface that runs on top of a computer operating system. It is composed entirely of free and open source software. It is an international project that includes creating software development frameworks, selecting application software for the desktop, and working on the programs that manage application launching, file handling, and window and task management. This steps has been tested on linux CentOS 5.8 server and may working on other versions as well.

Simply run the following command :

[root@centos58 ~]# yum groupinstall "X Window System" "GNOME Desktop Environment" -y

How to Install MySQL Server on CentOS 5.8

In this post, i will show on how to install MySQL database server on linux CentOS 5.8 server. MySQL server is a database server that can stores and retrieves data for the blog, websites and applications. It is one of the most popular most used in the internet especially for content management and blogging site. MySQL is a Relational Database Management System (RDBMS) that runs as a server providing multi-user access to a number of databases. For more information on MySQL, you can visit their website at www.mysql.com.

First of all, to install mysql server, you can simply execute this command :

[root@centos58 ~]# yum install mysql-server -y

Examples :

[root@centos58 ~]# yum install mysql-server -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.oscc.org.my
 * extras: mirror.issp.co.th
 * updates: mirror.issp.co.th
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package mysql-server.i386 0:5.0.95-1.el5_7.1 set to be updated
--> Processing Dependency: mysql = 5.0.95-1.el5_7.1 for package: mysql-server
--> Processing Dependency: perl-DBD-MySQL for package: mysql-server
--> Processing Dependency: perl(DBI) for package: mysql-server
--> Processing Dependency: libmysqlclient.so.15(libmysqlclient_15) for package: mysql-server
--> Processing Dependency: perl-DBI for package: mysql-server
--> Processing Dependency: libmysqlclient_r.so.15(libmysqlclient_15) for package: mysql-server
--> Processing Dependency: libmysqlclient.so.15 for package: mysql-server
--> Processing Dependency: libmysqlclient_r.so.15 for package: mysql-server
--> Running transaction check
---> Package mysql.i386 0:5.0.95-1.el5_7.1 set to be updated
---> 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-server               i386             5.0.95-1.el5_7.1             updates             9.8 M
Installing for dependencies:
 mysql                      i386             5.0.95-1.el5_7.1             updates             4.9 M
 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
Downloading Packages:
http://mirror.oscc.org.my/centos/5.8/os/i386/CentOS/perl-DBD-MySQL-3.0007-2.el5.i386.rpm: [Errno 12] Timeout: 
Trying other mirror.
(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:12
(3/4): mysql-5.0.95-1.el5_7.1.i386.rpm                                       | 4.9 MB     02:36
(4/4): mysql-server-5.0.95-1.el5_7.1.i386.rpm                                | 9.8 MB     03:48
----------------------------------------------------------------------------------------------------
Total                                                                37 kB/s |  15 MB     07:09
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-server.i386 0:5.0.95-1.el5_7.1

Dependency Installed:
  mysql.i386 0:5.0.95-1.el5_7.1   perl-DBD-MySQL.i386 0:3.0007-2.el5   perl-DBI.i386 0:1.52-2.el5

Complete!

Note : MySQL server service daemon is mysqld.

To check Mysqld status :

[root@centos58 ~]# service mysqld status
mysqld is stopped

Start MySQL service :

[root@centos58 ~]# service mysqld start

Start MySQL service at first time :

[root@centos58 ~]# service mysqld start
Initializing MySQL database:  WARNING: The host 'centos58.ehowtuff.local' could not be looked up with resolveip.
This probably means that your libc libraries are not 100 % compatible
with this binary MySQL version. The MySQL daemon, mysqld, should work
normally with the exception that host name resolving will not work.
This means that you should use IP addresses instead of hostnames
when specifying MySQL privileges !
Installing MySQL system tables...
OK
Filling help tables...
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 centos58.ehowtuff.local 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  ]

Stop MySQL service :

[root@centos58 ~]# service mysqld stop

Make mysqld daemon start at boot :

[root@centos58 ~]# chkconfig mysqld on

How to Install Perl on CentOS 5.8

Perl is an interpreted language that is very popular in the Unix community because it has a rich and powerful feature set, but is still easy to use. In this post, i will show the quick steps to install perl on linux CentOS 5.8 server.

Simply run the following command to install perl :

[root@centos58 ~]# yum install perl -y

Examples :

[root@centos58 ~]# yum install perl -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.oscc.org.my
 * extras: mirror.oscc.org.my
 * updates: mirror.oscc.org.my
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package perl.i386 4:5.8.8-38.el5 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

=====================================================================================================
 Package              Arch                 Version                        Repository            Size
=====================================================================================================
Installing:
 perl                 i386                 4:5.8.8-38.el5                 base                  12 M

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

Total download size: 12 M
Downloading Packages:
perl-5.8.8-38.el5.i386.rpm                                                    |  12 MB     01:58
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : perl                                                                          1/1

Installed:
  perl.i386 4:5.8.8-38.el5

Complete!

How to Install Vim on CentOS 5.8

Vim is an alternative to vi editor. Meaning, vim is a text editor that is upwards compatible to Vi. Vim can be used to edit all kinds of plain text. It is especially useful for editing programs. In this post, i will show how to install vim on linux CentOS 5.8 server. This steps may working on other linux distribution as well.

Simply run this command to install vim :

[root@centos58 ~]# yum install vim-enhanced -y

Example :

[root@centos58 ~]# yum install vim-enhanced -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.oscc.org.my
 * extras: mirror.oscc.org.my
 * updates: mirror.oscc.org.my
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package vim-enhanced.i386 2:7.0.109-7.el5 set to be updated
--> Processing Dependency: vim-common = 2:7.0.109-7.el5 for package: vim-enhanced
--> Processing Dependency: libperl.so for package: vim-enhanced
--> Processing Dependency: libgpm.so.1 for package: vim-enhanced
--> Running transaction check
---> Package gpm.i386 0:1.20.1-74.1 set to be updated
---> Package perl.i386 4:5.8.8-38.el5 set to be updated
---> Package vim-common.i386 2:7.0.109-7.el5 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

=====================================================================================================
 Package                   Arch              Version                         Repository         Size
=====================================================================================================
Installing:
 vim-enhanced              i386              2:7.0.109-7.el5                 base              1.2 M
Installing for dependencies:
 gpm                       i386              1.20.1-74.1                     base              184 k
 perl                      i386              4:5.8.8-38.el5                  base               12 M
 vim-common                i386              2:7.0.109-7.el5                 base              6.4 M

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

Total download size: 20 M
Downloading Packages:
(1/4): gpm-1.20.1-74.1.i386.rpm                                               | 184 kB     00:01
(2/4): vim-enhanced-7.0.109-7.el5.i386.rpm                                    | 1.2 MB     00:11
(3/4): vim-common-7.0.109-7.el5.i386.rpm                                      | 6.4 MB     00:58
(4/4): perl-5.8.8-38.el5.i386.rpm                                             |  12 MB     01:57
-----------------------------------------------------------------------------------------------------
Total                                                                106 kB/s |  20 MB     03:09
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : perl                                                                          1/4
  Installing     : vim-common                                                                    2/4
  Installing     : gpm                                                                           3/4
  Installing     : vim-enhanced                                                                  4/4

Installed:
  vim-enhanced.i386 2:7.0.109-7.el5

Dependency Installed:
  gpm.i386 0:1.20.1-74.1       perl.i386 4:5.8.8-38.el5       vim-common.i386 2:7.0.109-7.el5

Complete!

To use vim, type vim instead of vi :

[root@centos58 ~]# vim /etc/httpd/conf/httpd.conf

How to Install Apache Httpd on CentOS 5.8

Apache httpd is one of the most popular web servers and has a lot of features that make it very extensible and useful for many different types of websites.This steps has been tested on CentOS 5.8. Assume that you have installed minimal installation type CentOS 5.8 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.

To install apache httpd, simply run the following command :

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

Example :

[root@centos58 ~]# yum install httpd -y
Loaded plugins: fastestmirror
Determining fastest mirrors
 * base: mirror.oscc.org.my
 * extras: mirror.oscc.org.my
 * updates: mirror.oscc.org.my
base                                                                         | 1.1 kB     00:00
extras                                                                       | 2.1 kB     00:00
updates                                                                      | 1.9 kB     00:00
updates/primary_db                                                           | 263 kB     00:01
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package httpd.i386 0:2.2.3-63.el5.centos.1 set to be updated
base/filelists                                                               | 3.0 MB     00:28
extras/filelists_db                                                          | 212 kB     00:02
updates/filelists_db                                                         | 1.1 MB     00:09
--> Processing Dependency: /etc/mime.types for package: httpd
--> Processing Dependency: libapr-1.so.0 for package: httpd
--> Processing Dependency: libaprutil-1.so.0 for package: httpd
--> Running transaction check
---> Package apr.i386 0:1.2.7-11.el5_6.5 set to be updated
---> Package apr-util.i386 0:1.2.7-11.el5_5.2 set to be updated
--> Processing Dependency: libpq.so.4 for package: apr-util
---> Package mailcap.noarch 0:2.1.23-1.fc6 set to be updated
--> Running transaction check
---> Package postgresql-libs.i386 0:8.1.23-1.el5_7.3 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================
 Package                   Arch             Version                         Repository         Size
====================================================================================================
Installing:
 httpd                     i386             2.2.3-63.el5.centos.1           updates           1.2 M
Installing for dependencies:
 apr                       i386             1.2.7-11.el5_6.5                base              124 k
 apr-util                  i386             1.2.7-11.el5_5.2                base               80 k
 mailcap                   noarch           2.1.23-1.fc6                    base               14 k
 postgresql-libs           i386             8.1.23-1.el5_7.3                base              197 k

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

Total download size: 1.6 M
Downloading Packages:
(1/5): mailcap-2.1.23-1.fc6.noarch.rpm                                       |  14 kB     00:00
(2/5): apr-util-1.2.7-11.el5_5.2.i386.rpm                                    |  80 kB     00:00
(3/5): apr-1.2.7-11.el5_6.5.i386.rpm                                         | 124 kB     00:00
(4/5): postgresql-libs-8.1.23-1.el5_7.3.i386.rpm                             | 197 kB     00:01
(5/5): httpd-2.2.3-63.el5.centos.1.i386.rpm                                  | 1.2 MB     00:12
----------------------------------------------------------------------------------------------------
Total                                                               108 kB/s | 1.6 MB     00:15
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : apr                                                                          1/5
  Installing     : postgresql-libs                                                              2/5
  Installing     : mailcap                                                                      3/5
  Installing     : apr-util                                                                     4/5
  Installing     : httpd                                                                        5/5

Installed:
  httpd.i386 0:2.2.3-63.el5.centos.1

Dependency Installed:
  apr.i386 0:1.2.7-11.el5_6.5                 apr-util.i386 0:1.2.7-11.el5_5.2
  mailcap.noarch 0:2.1.23-1.fc6               postgresql-libs.i386 0:8.1.23-1.el5_7.3

Complete!

Start httpd service :

[root@centos58 ~]# service httpd start

Stop httpd service :

[root@centos58 ~]# service httpd stop

Check httpd status :

[root@centos58 ~]# service httpd status
httpd (pid  2411) is running...

Make httpd auto start at boot :

[root@centos58 ~]# chkconfig httpd on

How to Change Hostname on CentOS 5.8

In this post, i will show you the basic guides on how to change the hostname on linux CentOS 5.8 server. Assumed that you have root account access on this CentOS server and this steps may working on RHEL 6, RHEl 5, CentOS 5.5, CentOS 5.6, CentOS 5.7, CentOS 6.0, CentOS 6.1 and CentOS 6.2.

1. Check current hostname :

[root@localhost ~]# hostname
localhost.localdomain

2. Modify “/etc/sysconfig/network” to change hostname :

[root@localhost ~]# vi /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=localhost.localdomain

Change the hostname to the following :

NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=centos58.ehowtuff.local

Alternatively, you can execute the following command :

[root@localhost ~]# hostname centos58.ehowtuff.local

3. Change host file :

[root@localhost ~]# vi /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1               localhost.localdomain localhost
::1             localhost6.localdomain6 localhost6

127.0.0.1 centos58.ehowstuff.local centos58

4. Reboot the server.

[root@localhost ~]# reboot

How To Disable The IPv6 on CentOS 5.8

By default, IPv6 has been set to enabled on linux CentOS 5.8 minimum installation. If you plan to disable this feature, you can follow these steps to completely disable it. This can avoid accidentally loaded IPv6 module. This steps may working on other CentOS version.

1. Create disable-ipv6.conf on /etc/modprobe.d/ and add the following line :

[root@centos58 ~]# vi /etc/modprobe.d/disable-ipv6.conf

Add the following line :

install ipv6 /bin/true

Whenever the system needs to load the ipv6 kernel module, it is forced to execute the command true instead of actually loading the module.

2. Edit /etc/sysconfig/network and modify as below :

Set NETWORKING_IPV6 value to “no” :

NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=localhost.localdomain

3. Do not forget to disable and stop the IPv6 firewall if exist :

Disable auto start at boot :

[root@centos58 ~]# /sbin/chkconfig ip6tables off

Stop ip6tables service if running :

[root@centos58 ~]# service ip6tables stop

4. Add “net.ipv6.conf.all.disable_ipv6 = 1” into /etc/sysctl.conf

[root@centos58 ~]# echo "net.ipv6.conf.all.disable_ipv6 = 1" >> /etc/sysctl.conf

or

[root@centos58 ~]# vi /etc/sysctl.conf

Add the following line at the bottom of sysctl.conf file :

..
...
net.ipv4.tcp_syncookies = 1
...

5. Reboot the server is required to complete the steps above.

How to Configure Static IP Address on CentOS 5.8 x86

In this post, i will share the quick steps on how to configure static ip address on linux CentOS 5.8 server. This post assumed that you have installed linux CentOS 5.8 with minimum type of installation. If you planned to run this CentOS as a server, it better to configure static ip address.

After you have installed CentOS 5.8 linux server, the default DHCP ip configuration will be as below :

[root@centos58 ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0

Example:

# Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE]
DEVICE=eth0
BOOTPROTO=dhcp
HWADDR=00:0C:29:A1:17:AD
ONBOOT=yes

Please follow the following steps to configure static ip address on your linux CentOS 5.8 server.

1. Configure eth0 ip address and default gateway :

[root@centos58 ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
# Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE]
DEVICE=eth0
BOOTPROTO=static
HWADDR=00:0C:29:A1:17:AD
ONBOOT=yes
IPADDR=192.168.1.53
NETMASK=255.255.255.0
NETWORK=192.168.1.0
GATEWAY=192.168.1.1
TYPE=Ethernet
PEERDNS=yes
USERCTL=no

2. Restart Network interface:

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

or

[root@centos58 ~]# service network restart

3. Configure DNS server:

[root@centos58 ~]# vi /etc/resolv.conf
nameserver 8.8.8.8
nameserver 8.8.4.4