Tuesday, February 16, 2010

YUM configuration and XEN virtulization in RedHat 5.

Hi friends,

Please see the step by step yum configuration and XEN virtulization configuration. I wish this will help you more.
Your comments are welcome.



1.Yum configuration in Red Hat 5.x and XEN Virtualization

Here is a step by step Yum configuration.

Either you can make a separate partition or make a separate folder in / directory
Here in my case I am making /data/redhat directory
I am coping all 5 CDs of Red Hat 5.2 OS to /data/redhat folder using following command.
1.mount CD 1 and give this command
# cd /media/RHEL-5.3\ i386\ Disc\ 1/
2.# cp -av * /data/redhat/
3.Repeat step 1 and step 2 for rest of all CDs (CD2, CD3, CD4, CD5).
4.# createrepo -v /data/redhat for to create a local Yum Repository.
5.Configure ftp server with following steps.
6.Open /etc/vsftpd/vsftpd.conf file and make necessary changes.
anonymous_enable=YES
local_enable=YES
anon_root=/data/redhat/Server
7.Open /etc/yum.repos.d/base.repo
[Server--RHEL5]

name = RHEL 5.3

baseurl=file:///data/redhat/
#ftp service not require.
Or
baseurl=ftp://SERVER-IP/ # ftp service require to install client side.
enabled=1

gpgcheck=0

8.service vsftpd restart
9.service yum-updatesd restart
10.If you are trying to install and configure yum on same server ftp server will not require even if you configure ftp service on same server this will work, it is optional .
11.Now you can install rpms and dependency using yum.
12.yum clean all
13.yum update
14.yum install
15.Here I am doing xen virtulization .
16.yum install xen virt-manager kernel-xen
17.restart your server
18.make sure your system in booting form kernel /xen.gz-2.6.18-128.el5
19.To check your system boot in new kernel use command uname -a
20.use command to '#virt-manager & ' for Create new domains.
21.On command prompt type following command.
22.# virt-install --paravirt --name OSNAME --ram 512 --file /data/vm/OS.img --file-size 9 --network network:default --vnc --cdrom /dev/cdrom-sr0
23.In my system I used following example..
]# virt-install

What is the name of your virtual machine? RedHat5.3

How much RAM should be allocated (in megabytes)? 512

What would you like to use as the disk (file path)? /data/vm/rhel.img

How large would you like the disk (/data/vm/rhel.img) to be (in gigabytes)? 9

Would you like to enable graphics support? (yes or no) yes

What is the install location? /dev/cdrom-sr0

24.You view all system using xm list command.


Good Luck

Anand.

Saturday, January 9, 2010

Configure DNS in REDHAT Enterprise Linux 5 / CENTOS 5

Hi,

Here I have given easy step by step DNS configuration methods in Linux, I hope this will useful for you also.

1. First change or assign a host Name to your server; in this example my host Name is server.anand.com and my IP address is 192.168.50.196.

files /etc/hosts , /etc/sysconfig/network.
2. Download or Install following RPMS from CD/DVD of Linux OS.
RPMS :-
bind-utils-9.3.4-10.P1.el5

bind-sdb-9.3.4-10.P1.el5

bind-libs-9.3.4-10.P1.el5

bind-9.3.4-10.P1.el5

system-config-bind-4.0.3-4.el5.centos

bind-chroot-9.3.4-10.P1.el5

bind-libbind-devel-9.3.4-10.P1.el5

bind-devel-9.3.4-10.P1.el5

caching-nameserver-9.3.4-10.P1.el5


3. My DNS server IP address is 192.168.50.196

# cd /var/named/chroot/etc

copy file named.caching-nameserver.conf to named.conf

# cp named.caching-nameserver.conf named.conf

Make the following changes (It's require).

options {

listen-on port 53 { 127.0.0.1; 192.168.50.196; };

listen-on-v6 port 53 { ::1; };

directory "/var/named";

dump-file "/var/named/data/cache_dump.db";

statistics-file "/var/named/data/named_stats.txt";

memstatistics-file "/var/named/data/named_mem_stats.txt";

query-source port 53;

query-source-v6 port 53;

allow-query { 127.0.0.1; 192.168.50.0/24; };

allow-transfer { 127.0.0.1; 192.168.50.196; };

forwarders { 127.0.0.1; 192.168.50.196; };

forward only;

};

logging {

channel default_debug {

file "data/named.run";

severity dynamic;

};

};

view localhost_resolver {

match-clients { localhost; 192.168.50.0/24; };

match-destinations { localhost; 192.168.50.0/24; };

recursion yes;

include "/etc/named.rfc1912.zones";

};

Save this file and exit

4. Save this file and exit

copy named.conf file to /etc directory.

# cp /var/named/chroot/etc/named.conf /etc/

5. # cd /etc

6. Open /etc/named.rfc1912.zones

zone "anand.com" IN {

type master;

file "anand.zone";

allow-update { none; };

allow-query { any; };

};


zone "50.168.192.in-addr.arpa" IN {

type master;

file "anand.local";

allow-update { none; };

allow-query { any; };

};

7. cd /var/named/chroot/var/named

8. cp localhost.zone anand.zone
9. cp named.local anand.local
10. Edit anand.zone and make the following changes.


$TTL 86400

@ IN SOA server.anand.com. root.server.anand.com. (

42 ; serial (d. adams)

3H ; refresh

15M ; retry

1W ; expiry

1D ) ; minimum

@ IN NS server.anand.com.

server.anand.com. IN A 192.168.50.196

ldaplinux.anand.com. IN A 192.168.50.115 # Client

myclient-no1 IN A 192.168.50.141 # Client

www IN CNAME server.anand.com.

ftp IN CNAME server.anand.com.

Save this file and exit


11. Edit anand.local and make the following changes

$TTL 86400

@ IN SOA server.anand.com. root.server.anand.com. (

1997022700 ; Serial

28800 ; Refresh

14400 ; Retry

3600000 ; Expire

86400 ) ; Minimum

@ IN NS server.anand.com.

196 IN PTR server.anand.com.

115 IN PTR ldaplinux.anand.com. # Client

141 IN PTR myclient-no1. # Client


Save this file and exit.

12. chown root:named anand.zone Permission 775
13. chown root:named anand.local Permission 775
14. chown root:named /var/named/chroot/etc/named.conf permission 775
15. chown root:named /etc/named.conf permission 775
16. chown root:named /etc/named.rfc1912.zones permission 775 This file link with /var/named/chroot/etc/named.rfc1912.zones

On Final DNS server.

# service named start
# chkconfig named on

To check DNS configuration is correct or wrong use following command.

# dig anand.com or dig -x 192.168.50.196

Here I am using dig -x 192.168.50.196

dig -x 192.168.50.196

; <<>> DiG 9.3.4-P1 <<>> -x 192.168.50.196

;; global options: printcmd

;; Got answer:

;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 29928

;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1

;; QUESTION SECTION:

;196.50.168.192.in-addr.arpa. IN PTR

;; ANSWER SECTION:

196.50.168.192.in-addr.arpa. 86400 IN PTR server.anand.com.

;; AUTHORITY SECTION:

50.168.192.in-addr.arpa. 86400 IN NS server.anand.com.

;; ADDITIONAL SECTION:

server.anand.com. 86400 IN A 192.168.50.196

;; Query time: 11 msec

;; SERVER: 192.168.50.196#53(192.168.50.196)

;; WHEN: Sat Jan 9 20:29:30 2010

;; MSG SIZE rcvd: 105


QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1

All the four sections means Query: 1, Answer: 1, Authority: 1, Additional: 1 .

If it is 0 then you have to check all steps again properly.

Client Configuration:-

1.

Edit file /etc/resolv.conf
2.

make the following changes

search anand.com

nameserver 192.168.50.196 # DNS server IP Address



I hope these all steps will help you to configure DNS.

Anand Mane.