Thursday, August 10, 2017

DNS configuration history in RHEL 5

   18  rpm -qa |bind
   19  rpm -qa |grep bind
   20  rpm -ivh bind-9.3.3-7.el5.i386.rpm 
   21  rpm -ivh bind-devel-9.3.3-7.el5.i386.rpm 
   22  rpm -ivh bind-libbind-devel-9.3.3-7.el5.i386.rpm 
   23  rpm -ivh bind-libs-9.3.3-7.el5.i386.rpm 
   24  rpm -ivh |grep bind
   25  rpm -qa |grep bind
   26  rpm -ivh bind-libbind-devel-9.3.3-7.el5.i386.rpm 
   27  rpm -ivh bind-libs-9.3.3-7.el5.i386.rpm 
   28  cd /var/named/chroot/var/named/
   32  rpm -qa |grep bind
   33  rpm -ivh bind-sdb-9.3.3-7.el5.i386.rpm 
   36  cd /var/named/chroot/
   42  ls named .conf
   43  ls named.conf
   44  service xinetd status
   45  cd /var/named/chroot/var/named/
   46  ls
   47  service iptables stop
   48  service iptables save
   49  setenforce 0
   50  ls
   57  ifconfig 
   58  ping 172.24.0.1
   59  chcon -R -t samba_share_t /data
   71  rpm -ivh caching-nameserver-9.3.3-7.el5.i386.rpm 
   72  cd /var/named/chroot/var/named/
   73  ls
   74  vi /var/named/chroot/etc/
   75  cd /var/named/chroot/etc/
   76  ls
   77  vi named.caching-nameserver.conf 
   78  ls
   79  cd /var/named/chroot/var/named/
   80  ls
   81  cp localdomain.zone for.example.com
   82  cp named.local rev.example.com
   83  chown root:named for.example.com
   84  chown root:named rev.example.com
   85  vi /etc/resolv.conf 
   86  vi /etc/hosts
   87  vi /etc/sysconfig/network-scripts/ifcfg-eth0 
   88  cd /var/named/chroot/etc
   89  cp named.caching-nameserver.conf named.conf
   90  chown root:named named.conf
   91  vi named.conf
   92  ls
   93  vi named.rfc1912.zones 
   94  cd /var/named/chroot/var/named/
   95  ls
   96  vi for.example.com 
   97  vi named.rfc1912.zones 
   98  vi rev.example.com 
   99  service named restart
  100  chkconfig named on
  101  dig -x 172.24.0.254

Thursday, March 31, 2011

RAID 5 Configuration in RHEL5.3

Step 1: Create 3 partitions by using #fdisk /dev/sda (say /dev/sda6, /dev/sda7, /dev/sda8) and change the system id as fd (Linux raid autodetect)
Step 2: #partprobe or #reboot -f
Step 3: #mdadm -C /dev/md0 -l 5 -n 3 /dev/sda6 /dev/sda7 /dev/sda8
            #mkfs.ext3 /dev/md0
Step 4: #mkdir /raid5
            mount in /etc/fstab (/dev/md0  /raid5 ext3 defaults 0 0) (add an entry in /etc/fstab)
            #mount -a
Step 5: #mdadm --detail /dev/md0 (viewing the raid device)
            #cat /proc/mdstat (viewing the raid device configuration)
Step 6: #mdadm -f /dev/md0 /dev/sda8 (disabling device from the existing RAID)
           #mdadm -a /dev/md0 /dev/sda9 (adding a new device in the existing RAID)
           #mdadm -r /dev/md0 /dev/sda8 (for removing a device from the existing RAID)

Friday, January 15, 2010

What is kernel compilation in Linux & How can do in RHEL5

What is kernel Compilation:
Linux is not a user friendly operating system, however it is more flexible than other operating systems. So you can tune the kernel to the desirable style for better performance to work with new hardware or network as well as new configurations with the existing hardware or network.

Kernel compilation has the following 8 steps to do:
1. Download the latest kernel from http://kernel.org
# cd /tmp
# wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-x.y.z.tar.bz2
2.Extract the compressed file into the specified directory It is usually /usr/src/
  # tar -xjvf linux-2.6.25.tar.bz2 -C /usr/src
  # cd /usr/src

3.Install gcc package through yum in RHEL5
  # yum install gcc
You can use anyone of these commands for compiling the kernel in your desirable style
  • # make menuconfig - Text based color menus, radiolists & dialogs. This option also useful on remote server if you wanna compile kernel remotely.
  • # make xconfig - X windows (Qt) based configuration tool, works best under KDE desktop
  • # make gconfig - X windows (Gtk) based configuration tool, works best under Gnome Dekstop.
  # make menuconfig
4.Compile kernel
    Start compiling to create a compressed kernel image, enter:
    # make
    Start compiling to kernel modules:
    #make modules
    Install kernel modules (become a root user, use su command):
   # make modules_install
  # make install
 5. Install kernel
    It will install three files into /boot directory as well as modification to your kernel grub configuration file:
  • System.map-2.6.25
  • config-2.6.25
  • vmlinuz-2.6.25
6. Create on image
  # cd /boot
  # mkinitrd -o initrd.img-2.6.25 2.6.25

7. Modify Grub configuration file - /boot/grub/grub.conf
  title           Redhat Enterprise Linux, kernel 2.6.25 Default
  root            (hd0,0)
  kernel          /boot/vmlinuz root=/dev/hdb1 ro
  initrd          /boot/initrd.img-2.6.25

The following are not commands in the file.These are steps in the kernel compilation.
  savedefault
  boot
8. Reboot the system and boot into your new kernel that you have compiled just now 
    # reboot

Friday, February 6, 2009

Installation Server Setup in RHEL5


1.NFS method

  1. system-config-network for setting a static ipaddress

  2. Configure dhcp server with bootp option – refer dhcp installation

  3. Copy the entire dvd contents to /var/ftp/pub

  4. #vi /etc/exports

    /var/ftp/pub *(ro,sync)

  5. #service portmap restart

  6. #chkconfig portmap on

  7. #service nfs restart

  8. #chkconfig nfs on

  9. #cd /var/ftp/pub/Server

  10. #rpm -ivh tftp*

    this rpm has the dependency with xinetd rpm. So install xinetd rpm first.

  11. #cp -avrf /var/ftp/pub/isolinux /tftpboot/

  12. #cp /usr/lib/syslinux/pxelinux.0 /tftpboot/

  13. #cd /tftpboot

  14. #mkdir pxelinux.cfg

  15. #cp /tftpboot/isolinux.cfg /tftpboot/pxelinux.cfg/default

  16. #service xinetd restart

  17. #chkconfig xinetd on

  18. #chkconfig tftp on

2.FTP method

  1. Same steps of NFS method

  2. Create one user and make the path specified /var/ftp/pub/ as the home directory of that user.

    #useradd -d /var/ftp/pub prasanna

    #passwd prasanna

  3. Choose the ftp option while installing, and choose un anonymous option, then provide the username and password that you have created.


Note:

1. Please disable the firewall if any of the methods not working properly. Follow the following steps to disable firewall in RHEL5. You can set your own firewall setup, if you know very well on that.

# iptables -F

# service iptables save

2. PXE (Pre eXecutable Environment) boot ROM required. However these methods can be used in linux askmethod installation also.

3. You cannot do the same method for creating the bootable pendrive.

Monday, January 26, 2009

Delete all other OS & no package Kickstart file

#platform=x86, AMD64, or Intel EM64T
# System authorization information
auth  --useshadow  --enablemd5 
# System bootloader configuration
bootloader --location=mbr --md5pass=$1$.9UebnNJ$hkbfHsfgw0JDYVGnVWWTq.
# Partition clearing information
clearpart --linux
# Use text mode install
text
# Firewall configuration
firewall --enabled   
# Run the Setup Agent on first boot
firstboot --disable
# System keyboard
keyboard us
# System language
lang en_US
# Installation logging level
logging --level=info
# Use NFS installation media
nfs --server=192.168.0.254 --dir=/var/ftp/pub
# Network information
network --bootproto=dhcp --device=eth0 --onboot=on
# Reboot after installation
reboot
#Root password
rootpw --iscrypted $1$bdml0V4e$dTffJK3n.0h0Slimi8XBl.

# SELinux configuration
selinux --enforcing
# System timezone
timezone --isUtc Asia/Calcutta
# Install OS instead of upgrade
install
# X Window System configuration information
xconfig  --defaultdesktop=GNOME --depth=24 --resolution=800x600
# Disk partitioning information
part / --fstype ext3 --size=10000 --asprimary
part swap --size=512 --asprimary

No Packages Kickstart files

#platform=x86, AMD64, or Intel EM64T
# System authorization information
auth  --useshadow  --enablemd5
# System bootloader configuration
bootloader --location=mbr --md5pass=$1$.9UebnNJ$hkbfHsfgw0JDYVGnVWWTq.
# Partition clearing information
clearpart --none
# Use text mode install
text
# Firewall configuration
firewall --enabled
# Run the Setup Agent on first boot
firstboot --disable
# System keyboard
keyboard us
# System language
lang en_US
# Installation logging level
logging --level=info
# Use NFS installation media
nfs --server=192.168.0.254 --dir=/var/ftp/pub
# Network information
network --bootproto=dhcp --device=eth0 --onboot=on
# Reboot after installation
reboot
#Root password
rootpw --iscrypted $1$bdml0V4e$dTffJK3n.0h0Slimi8XBl.

# SELinux configuration
selinux --enforcing
# System timezone
timezone --isUtc Asia/Calcutta
# Install OS instead of upgrade
install
# X Window System configuration information
xconfig  --defaultdesktop=GNOME --depth=24 --resolution=800x600
# Disk partitioning information
part / --bytes-per-inode=4096 --fstype="ext3" --size=6000
part swap --bytes-per-inode=4096 --fstype="swap" --size=1000

Minimal Packages Kickstart file

#platform=x86, AMD64, or Intel EM64T
# System authorization information
auth  --useshadow  --enablemd5 
# System bootloader configuration
bootloader --location=mbr --md5pass=$1$.9UebnNJ$hkbfHsfgw0JDYVGnVWWTq.
# Partition clearing information
clearpart --none  
# Use text mode install
text
# Firewall configuration
firewall --enabled   
# Run the Setup Agent on first boot
firstboot --disable
# System keyboard
keyboard us
# System language
lang en_US
# Installation logging level
logging --level=info
# Use NFS installation media
nfs --server=192.168.0.254 --dir=/var/ftp/pub
# Network information
network --bootproto=dhcp --device=eth0 --onboot=on
# Reboot after installation
reboot
#Root password
rootpw --iscrypted $1$bdml0V4e$dTffJK3n.0h0Slimi8XBl.

# SELinux configuration
selinux --enforcing
# System timezone
timezone --isUtc Asia/Calcutta
# Install OS instead of upgrade
install
# X Window System configuration information
xconfig  --defaultdesktop=GNOME --depth=24 --resolution=800x600
# Disk partitioning information
part / --bytes-per-inode=4096 --fstype="ext3" --size=6000
part swap --bytes-per-inode=4096 --fstype="swap" --size=1000

%packages
@admin-tools
@base
@base-x
@core
@dialup
@editors
@games
@gnome-desktop
@graphical-internet
@java
@office
@printing
@sound-and-video
@text-internet

Full Packages Kickstart file

#platform=x86, AMD64, or Intel EM64T
# System authorization information
auth  --useshadow  --enablemd5 
# System bootloader configuration
bootloader --location=mbr --md5pass=$1$.9UebnNJ$hkbfHsfgw0JDYVGnVWWTq.
# Partition clearing information
clearpart --none  
# Use text mode install
text
# Firewall configuration
firewall --enabled   
# Run the Setup Agent on first boot
firstboot --disable
# System keyboard
keyboard us
# System language
lang en_US
# Installation logging level
logging --level=info
# Use NFS installation media
nfs --server=192.168.0.254 --dir=/var/ftp/pub
# Network information
network --bootproto=dhcp --device=eth0 --onboot=on
# Reboot after installation
reboot
#Root password
rootpw --iscrypted $1$bdml0V4e$dTffJK3n.0h0Slimi8XBl.

# SELinux configuration
selinux --enforcing
# System timezone
timezone --isUtc Asia/Calcutta
# Install OS instead of upgrade
install
# X Window System configuration information
xconfig  --defaultdesktop=GNOME --depth=24 --resolution=800x600
# Disk partitioning information
part / --bytes-per-inode=4096 --fstype="ext3" --size=6000
part swap --bytes-per-inode=4096 --fstype="swap" --size=1000

%packages
@admin-tools
@authoring-and-publishing
@base
@base-x
@core
@development-libs
@development-tools
@dialup
@dns-server
@editors
@engineering-and-scientific
@ftp-server
@games
@gnome-desktop
@gnome-software-development
@graphical-internet
@graphics
@hindi-support
@java
@java-development
@kannada-support
@kde-desktop
@kde-software-development
@legacy-network-server
@legacy-software-development
@legacy-software-support
@mail-server
@mysql
@network-server
@news-server
@office
@printing
@ruby
@server-cfg
@smb-server
@sound-and-video
@sql-server
@system-tools
@tamil-support
@text-internet
@web-server
@x-software-development
kernel-devel

Saturday, January 3, 2009

DHCP & NFS Configuration in RHEL5

RHEL 5

 

DHCP Server Configuration

 

Step1  :           # rpm –q dhcp*

                        # rpm –ivh dhcp*

Step 2 :           # cd /usr/share/doc/dhcp-3.0.1

# ls

                        # dhcpd.conf.sample

                        # cp dhcpd.conf.sample /etc/dhcpd.conf

Step 3 :           # vi /etc/dhcpd.conf

                       

                        option domain-name           dns      server ip

                        range  172.24.0.10     172.24.0.20

Step 4 :                       # vi /etc/sysconfig/network-scripts/ifcfg-eth0

                        onbootpro=static

Step 5 :           # service dhcpd restart

                        # chkconfig dhcpd on

 

Client Configuration

 

# vi /etc/sysconfig/network-script/ifcfg-eth0

onbootpro=dhcp                                                                 

 

 


NFS Server Configuration

 

Step1  :           # rpm –ivh nf*

Step 2 :           # vi /etc/exports

/test *(rw,sync)

:wq

                        Step3  :           # exportfs –av

                        Step4  :           # service portmap restart

                                                # chkconfig portmap on

                        Step 5 :           # service nfs restart

                                                # chkconfig nfs on


Client Configuration

 

Step1  :           # mount 172.24.0.254:/test /mnt

                        # cd /mnt               


Wednesday, December 10, 2008

YUM Server Configuration in RHEL5 (Yellow Dog Updater Modified)

YUM Server Configuration in RHEL5 (Yellow Dog Updater Modified) -for increasing the package integrity.

Step 1: install createrepo.rpm from the DVD for creating repository.
# rpm -ivh createrepo.rpm

Step 2: copy all rpms form the DVD and past over the hard disk share them up in NFS.
#createrepo /path-to-rpms
eg: createrepo /var/ftp/pub
It will take several minutes that depends upon the number of rpms that you have copied from the DVD specified and the configuration of your machine.

Step 3: Touch the following file with the contents specified.
#vi /etc/yum.repos.d/somename.repo
[base]
name=friendly name
enabled=1
gpgcheck=0

Step 4: Use the yum server in the same machine because server is the first client of the same service most of the times
the following command is used for install gcc compiler
#yum install gcc

Note: Remember ftp or http service has to be running in the yum server.

Client configuration:
Step 1: Touch the following file with the contents specified in case of ftp server is running in the server machine
#vi /etc/yum.repos.d/somename.repo
[base]
name=friendly name
enabled=1
gpgcheck=0

Step 2:
the following command is used for install gcc compiler
#yum install gcc
these are the commands for removing the service specified
#yum erase gcc
#yum remove gcc
for mail server
#yum install sendmail

Monday, December 1, 2008

DNS Configuration in RHEL 5

DNS Configuration in RHEL 5
Step 1:
set static ipaddress by using these commands
system-config-network
or
ifconfig eth0 192.168.0.254

Step 2:

Install all these following rpms

rpm -ivh bind-9.3.3-7.el5.i386.rpm
rpm -ivh bind-chroot-9.3.4-9.P1.el5.i386.rpm
rpm -ivh bind-devel-9.3.3-7.el5.i386.rpm
rpm -ivh bind-libbind-devel-9.3.3-7.el5.i386.rpm
rpm -ivh bind-libs-9.3.3-7.el5.i386.rpm
rpm -ivh bind-sdb-9.3.3-7.el5.i386.rpm
rpm -ivh caching-nameserver-9.3.3-7.el5.i386.rpm

Step 3:

cd /var/named/chroot/var/named/
cp localdomain.zone for.prasanna.com
cp named.local rev.prasanna.com
chown root:named for.prasanna.com
chown root:named rev.prasanna.com

Step 4:

Edit the following files and add the respective lines in those
vi /etc/sysconfig/network

vi /etc/sysconfig/network-scripts/ifcfg-eth0
peerdns=no

vi /etc/resolv.conf
search prasanna.com
nameserver 192.168.0.254
vi /etc/hosts
cd /var/named/chroot/etc
cp named.caching-nameserver.conf named.conf
chown root:named named.conf
vi named.conf
option{
listen-on pot 53{127.0.0.1; 192.168.0.254;};

allow-query{ localhost; 192.168.0.0/24;}
match-clients {localhost; 192.168.0.0/24;};
match-destination {localhost; 192.168.0.0/24;};

vi /etc/named.rfc1912.zones

zone "prasanna.com" IN {
type master;
allow-update {none;};
};

zone "0.168.192.in-addr.arpa" IN {
type master;
allow-update { none; };
};

Step 5:
Edit for.prasanna.com and rev.prasanna.com in the respective location /var/named/chroot/var/named
in the following way.

$TTL 86400
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum

server IN A 192.168.0.254
client8 IN A 192.168.0.108
client1 IN A 192.168.0.101
client2 IN A 192.168.0.102
client3 IN A 192.168.0.103
client4 IN A 192.168.0.104
client5 IN A 192.168.0.105
client6 IN A 192.168.0.106
client7 IN A 192.168.0.107



$TTL 86400
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum


Step 6:
service named restart
chkconfig named on


if you get all the four sections question, answer,additional, authority as 1, you got it. Otherwise, some check the steps properly.


Step 7:
Client side: in station1.prasanna.com
just touch these files with the existing details
vi /etc/resolv.conf
search prasanna.com
nameserver 192.168.0.254
vi /etc/hosts

you should get the same sections like the server, Otherwise check the steps properly.

Saturday, November 29, 2008

Swat in Samba

SCENARIO: Configure a SAMBA Server on RHEL5 with a NETBIOS name STATION2-NIX. Create a SHARE in it having name STATION2-RHEL5-VM and mapped to the directory /network-places/station2. Windows Machine workgroup being WORKGROUP. The share should be writeable to the user "root"

STEPS

Before you configure SAMBA SERVER make sure following packages are installed:
system-config-samba-
samba-common-
samba-
samba-swat-
samba-client-

The easiest way to configure SAMBA server is to use samba-swat utility. By default it is turned off. First check whether it has been bind to port 901 or not using:
#cat /etc/services | grep swat

After this you need to start the swat service. Use #system-config-services and check mark "swat". Save the changes and closed the window.

Open a web-browser and type the link given below:
http://localhost:901/

It will ask for username and password. It's always advisable to login with root credentials. You will presented with a Web Based GUI.

Configuring a SAMBA server is just a 3 step process:

STEP 1: Go to "GLOBAL" section. Change the workgroup to the workgroup being used by Windows Machine. It can be anything like MSHOME, MYWORKGROUP,MYGROUP etc. But both Windows and Linux should use the same workgroup name. In my case workgroup="WORKGROUP". Change the netbios name to "STATION2-NIX". Change the security to "USER". Commit the changes.

STEP 2: Go to "SHARES" tab. Create a new share having the name "STATION2-RHEL5-VM". Set the path to "/network-places/station2". Make sure this directory path exits. Also make sure "browsable" and "available" options are set to yes. Add the user "root" to "write list". Commit the changes.

STEP 3: Go to the "PASSWORD" section. For the user "root" set the password and click "Add New User". You can now verify that a new entry must have been added to /etc/samba/smbpasswd. Start the smb service.
#service smb start

You all set to access the Linux Machine from Windows. Just go to Windows Box and your share would be browsable in "My Network Places"(XP) or "Network"(VISTA). Just double click the icon having you netbios name and login using "root" credentials.

Thursday, June 12, 2008

Procdure to configure dhcp and nfs servers in RHEL5

RHEL 5

DHCP Server Configuration

Step1 : # rpm –q dhcp*
# rpm –ivh dhcp*
Step 2 : # cd /usr/share/doc/dhcp-3.0.1
# ls
# dhcpd.conf.sample
# cp dhcpd.conf.sample /etc/dhcpd.conf
Step 3 : # vi /etc/dhcpd.conf

option domain-name dns server ip
range 172.24.0.10 172.24.0.20
Step 4 : # vi /etc/sysconfig/network-scripts/ifcfg-eth0
onbootpro=static
Step 5 : # service dhcpd restart
# chkconfig dhcpd on

Client Configuration

# vi /etc/sysconfig/network-script/ifcfg-eth0
onbootpro=dhcp


NFS Server Configuration

Step1 : # rpm –ivh nf*
Step 2 : # vi /etc/exports
/test *(rw,sync)
:wq
Step3 : # exportfs –av
Step4 : # service portmap restart
# chkconfig portmap on
Step 5 : # service nfs restart
# chkconfig nfs on

Client Configuration

Step1 : # mount 172.24.0.254:/test /mnt
# cd /mnt

Saturday, May 17, 2008

RHEL5 DHCP Configuration file

ddns-update-style interim;
ignore client-updates;

subnet 172.24.0.0 netmask 255.255.0.0 {

# --- default gateway
option routers 172.24.0.1;
option subnet-mask 255.255.0.0;

option nis-domain "domain.org";
option domain-name "prasanna.org";
option domain-name-servers 172.24.0.1;

option time-offset -18000; # Eastern Standard Time
# option ntp-servers 192.168.1.1;
# option netbios-name-servers 192.168.1.1;
# --- Selects point-to-point node (default is hybrid). Don't change this unless
# -- you understand Netbios very well
# option netbios-node-type 2;

range dynamic-bootp 172.24.0.10 172.24.0.20;
default-lease-time 21600;
max-lease-time 43200;

# we want the nameserver to appear at a fixed address
host ns {
next-server marvin.redhat.com;
hardware ethernet 12:34:56:78:AB:CD;
fixed-address 207.175.42.254;
}
}