Tuesday, October 30, 2007

NFS Configuration

We will configure NFS, whereby we will mount /test directory on the other machine

NFS Server Configuration:

Create a Directory which we need to Mount using NFS

#mkdir /test

Start the following services :

#service portmap start

#service nfs start

#service nfslock start

Edit the following file:

#vi /etc/exportfs

/test xxx.xxx.xxx.xxx(ro,sync,no_root_squash)

(xxx.xxx.xxx.xxx replace it with NFS client IP address)

save the file

#export -avr

NFS Client Configuration:

Start the following services

#service nfs start

#service nfslock start

#service portmap start

Create a directory:

#mkdir test1

#mount xxx.xxx.xxx.xxx:/test /test1

(xxx.xxx.xxx.xxx replace it with NFS server IP Address)

Squid Proxy Configuration

The SQUID is a Linux based utility that can be used to distribute internet to all the computers within the network

Squid configuration file : squid.conf

Location: /etc/squid

Edit the squid.conf file

#vi squid.conf

(Search for the default acl list and add the following)

acl mynetwork src xxx.xxx.xxx.xxxx / xxx.xxx.xxx.xxx (subnet)
acl mynetwork src xxx.xxx.xxx.xxx / xxx.xxx.xxx.xxx (for individual IP)

Then add acl (access control list) to the "http_access list" with the following line

http_access allow mynetwork

Default port is always 3128

You can comment this line and add any specific port we require

http_port 3128

Once the above mentioned changes has been done, save the file

Restart the squid service

#/etc/rc.d/init.d/squid restart

or we can use the following command

#squid -z

#squid

One the client system , just all the proxy IP address (Squid Server IP address) and port 3128 or any other port specified in squid.conf file

Sunday, October 21, 2007

Changing Kernel Parameters

To Display all the available Kernel Parameters

# sudo sysctl -a | sort | more

Each Kernel parameters are in a field = value format

For Example:

Kernel.threads-max = 16379

Decreasing the PID value will improve the performance

To change the parameter

# sudo sysctl -w kernel.threads-max=16000

The above command will change the parameter temporarily, once the machine reboots the parameters will come back to its previous value.

To make the new changes permanently , Edit the following

# /etc/sysctl.conf

Enter in the parameter changes

For example:

#vi /etc/sysctl.conf

kernel.threads-max=16000

save the file

Thursday, October 18, 2007

Change Linux Server date from GST to GMT

Edit the following :

# vi /etc/sysconfig/clock
Zone="GMT0"
UTC=true
ARC=false
:wq!

Delete file name localtime

#cd /etc

#rm -i localtime

Create a softlink

#ln -s /usr/share/zoneinfo/GMT0 /etc/localtime

Now check the date

Synchronise hardware clock with system clock

#hwclock --show

#hwclock --set --date="today's date time"

eg:

#hwclock --set --date="02/19/207 18:10:00"

#hwclock --show

#date

Synchronise hardware clock to system clock

#hwclock --hctosys

Wednesday, October 17, 2007

Compile and Install a New Linux Kernel

Download the latest kernel from www.kernel.org

#wget http://www.kernel.org/pub/linux/kernel/v2.4/linux-2.4.19.tar.gz

#tar zxvf linux-2.4.19.tar.gz

#cd linux-2.4.19

Now you have to configure the kernel options
This is place where you select all the features you want to compile into the kernel. If you have an existing configuration from the older kernel, copy the old .config file to the top level of your source and use make oldconfig instead of menuconfig. This oldconfig process will carry over your previous settings and prompt you if, there are new features not covered by the earlier .config file.
We will presently follow a technique whereby we are just Compiling and Installing a new Kernel.

#make menuconfig

Now you will have to build all the dependencies for your chosen configuration.

#make dep

Now we can compile the actual Kernel

#make bzImage

The resulting kernel file is : arch/i386/boot/bzImage

Now you have to load the modules

#make modules

Install the modules

#make modules_install

Due to some reason you want to re-compile the whole kernel once again. You can use make command to delete intermediate file.
make mrproper command will delete he .config file

Task are as follows:

make mrproper
make menuconfig
make dep
make clean
make bzImage
make modules
make modules_install

Once the task is completed, now we have to boot from the new kernel. I take into consideration that LILO is installed in boot sector.

Before changing its better practice to take a backup

#cp arch/i386/boot/bzImage/vmlinuz-2.4.19

#cp system.map /boot

Now once the above mentioned steps are done we can tell the LILO about the new kernel

Edit the following lilo.conf file

#vi /etc/lilo.conf

image=/boot/vmlinuz-2.4.19
label="Linux 2.4.19"

:wq!

To apply the changes and boot from the new kernel

# lilo -v

Reboot the server.

Wednesday, October 10, 2007

Network Bonding Configuration

1. #/etc/sysconfig/network-scripts

2. create a file
# touch ifcfg-bond0

3. Edit the file
#vi ifcfg-bond0

4. Enter in the details
DEVICE=bond0
USERCTL=no
ONBOOT=yes
BROADCAST=xxx.xxx.xxx.xxx
NETWORK=xxx.xxx.xxx.xxx
NETMASK=xxx.xxx.xxx.xxx
GATEWAY=xxx.xxx.xxx.xxx
IPADDR=xxx.xxx.xxx.xxx

5. Edit ifcfg-eth0
#vi ifcfg-eth0

6. Enter in the details
DEVICE=eth0
USERCTL=no
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPROTO=none

7. Edit ifcfg-eth1
#vi ifcfg-eth1

8. Enter in the details
DEVICE=eth1
USERCTL=no
ONBOOT=yes
MASTER=bond0
SLAVE=yes
BOOTPROTO=none

if the operating system is RHEL 32-bit then edit the following

1. #vi /etc/modules.conf
alias bond0 bonding
options bonding miimon=100 mode=0

if the operating system is RHEL 64-bit then edit the following

1. #vi /etc/modprobe.com
alias bond0 bonding
options bonding miimon=100 mode=0

Restart the network services

# service network restart