How to Install CentOS 5.7 Server Part 2

This tutorial shows how to install CentOS 5.7 32 x86 server. This steps may be similar with other version of CentOS or RHEL and i do not issue any guarantee that this will work for you. Assume that you already done the steps 1 until 12 as explained from this link.

How to Install CentOS 5.7 Server Part 1

13.  Set configuration for boot loader if you need. In this case, click next to proceed.
CentOS 5.7

14. Install bootloader on /dev/sda.
CentOS 5.7

15. By default, the setting of the network interfaces is DHCP, but it is recommended to set static IP addresses for server installation.
CentOS 5.7

16. Under IPV4, uncheck “Dynamic IP configuration (DHCP)”. Enter prefer static ip address and netmask. Don’t forget to uncheck “Enable IPv6 support”.
CentOS 5.7

17. Input your server’s Hostname, Gateway and DNS servers.
CentOS 5.7

18. Choose your time zone.
CentOS 5.7

19. Set root password and click next.
CentOS 5.7

20. Select softwares you would like to install. It’s recommended to perform minimal installation. Check a box “Customize now” and click next.
CentOS 5.7

21. To perfome minimal installation, unselect all package groups.
CentOS 5.7

22. Click next to proceed.
CentOS 5.7

23. The installer checks the dependencies of the selected packages and the format file system.
CentOS 5.7

24. Installation has been completed. Click ‘Reboot’ button.
CentOS 5.7

How to Install telnet on CentOS

Question : When i try to perform the troubleshooting using telnet command, the following error appeared. How to fix this ?

[root@centos62 ~]# telnet localhost 25
-bash: telnet: command not found

Answer : Simply install telnet using this command :

[root@centos62 ~]# yum install telnet
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.ipserverone.com
 * epel: ftp.cuhk.edu.hk
 * extras: centos.ipserverone.com
 * rpmforge: ftp-stud.fht-esslingen.de
 * updates: centos.ipserverone.com
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package telnet.i686 1:0.17-47.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

==========================================================================================
 Package         Arch          Version                Repository                     Size
==========================================================================================
Installing:
 telnet          i686          1:0.17-47.el6          CentOS6.2-Repository           56 k

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

Total download size: 56 k
Installed size: 102 k
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : 1:telnet-0.17-47.el6.i686                                              1/1

Installed:
  telnet.i686 1:0.17-47.el6

Complete!

How to Install Which Command On CentOS

In this post, I will guide you on how to install which command on CentOS. The purpose of which command is to search the user’s $path for a program file or shows the full path of shell commands found. For example, if you want to know exactly where the “grep” command is located on the filesystem, you can type “which perl”. The output should be something
like:

    [root@CentOS57 ~]# which perl
    /usr/bin/perl
    

Question : Why i get the following error when i try to run which command my system ? How do I
install it?

    [root@CentOS57 ~]# which grep
    -bash: which: command not found
    

or

    [root@CentOS57 ~]# which grep
    -bash: /usr/bin/which: No such file or directory
    

Answer : Simply run this command to install which command :

    [root@CentOS57 ~]# yum install which
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
     * base: centos.ipserverone.com
     * extras: centos.ipserverone.com
     * updates: centos.ipserverone.com
    Setting up Install Process
    Resolving Dependencies
    --> Running transaction check
    ---> Package which.i386 0:2.16-7 set to be updated
    --> Finished Dependency Resolution
    
    Dependencies Resolved
    
    ===================================================================================================
     Package                Arch                  Version                  Repository             Size
    ===================================================================================================
    Installing:
     which                  i386                  2.16-7                   base                   23 k
    
    Transaction Summary
    ===================================================================================================
    Install       1 Package(s)
    Upgrade       0 Package(s)
    
    Total download size: 23 k
    Is this ok [y/N]: y
    Downloading Packages:
    which-2.16-7.i386.rpm                                                       |  23 kB     00:00
    Running rpm_check_debug
    Running Transaction Test
    Finished Transaction Test
    Transaction Test Succeeded
    Running Transaction
      Installing     : which                                                                       1/1
    
    Installed:
      which.i386 0:2.16-7
    
    Complete!
    

How to Install gcc on CentOS 6.2

In this post, i will show you on how to install gcc package. The GNU Compiler Collection (GCC) is a compiler system produced by the GNU Project supporting various programming languages. The compiler is designed to support multiple front-ends and multiple back-ends by translating first into Register Transfer Language and from there into assembly code for the target architecture. 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

Simply run yum command to install the gcc.

    [root@centos6 ~]# yum install gcc
    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 gcc.i686 0:4.4.6-3.el6 will be installed
    --> Finished Dependency Resolution
    
    Dependencies Resolved
    
    ============================================================================================
     Package       Arch           Version                  Repository                      Size
    ============================================================================================
    Installing:
     gcc           i686           4.4.6-3.el6              CentOS6.2-Repository           8.2 M
    
    Transaction Summary
    ============================================================================================
    Install       1 Package(s)
    
    Total download size: 8.2 M
    Installed size: 15 M
    Is this ok [y/N]: y
    Downloading Packages:
    Running rpm_check_debug
    Running Transaction Test
    Transaction Test Succeeded
    Running Transaction
      Installing : gcc-4.4.6-3.el6.i686                                                     1/1
    
    Installed:
      gcc.i686 0:4.4.6-3.el6
    
    Complete!
    

How to Modify Date and Timestamps Using touch on CentOS

This post will guide you on how to modify date and time stamps using “touch” command. The touch command is easy to use and there are two reason to use it.

1. To create a file.
2. To update a file’s modification date.

The touch command is part file utilities package and has several options.

How to modify date and timestamps using touch ?
Touch can update a file’s date and time. you can even use touch to change a file’s date or time to the past or the future, for example:

a)Change date to past time:

    [root@server ~]# touch -t 0101141400 newtestfile1
    [root@server ~]# ls -l --full-time newtestfile1
    -rw-r--r-- 1 root root 0 2001-01-14 14:00:00.000000000 +0800 newtestfile1
    

Description:
The –full-time option and long format listing of the ls command show that the file newtestfile1 now has a timestamp of (2.00PM, 14 January 2001)

b)Change date to future time:

    [root@server ~]# touch -t 1212261400 newtestfile1
    [root@server ~]# ls -l --full-time newtestfile1
    -rw-r--r-- 1 root root 0 2012-12-26 14:00:00.000000000 +0800 newtestfile1
    

Description:
The –full-time option and long format listing of the ls command show that the file newtestfile1 now has a timestamp of (2.00PM, 26 December 2012)

How to Create a File With a touch Command on CentOS

This post will guide you on how to create a file using “touch” command. The touch command is easy to use and there are two reason to use it.

1. To create a file.
2. To update a file’s modification date.

The touch command is part file utilities package and has several options.

How to create new files using touch ?

    [root@server ~]# touch newtestfile1
    [root@server ~]# ls -l
    total 0
    -rw-r--r-- 1 root root 0 Jan 11 10:43 newtestfile1
    

Descriptions :
As you can see, touch creates a file with a length, or size, of zero