Sunday, January 31, 2010

Squid Proxy server

The Squid is a good proxy server. Its configuration is very simple. Please use the following procedures.

1) Most of the standard distributions have squid packages in its repository. If you are using fedora, RHEL or centos please do the following procedurea

# yum install squid -y

If your in debian or Ubundu please use the following,

# apt-get install squid

2) Now open the squid configuration file “squid.conf” . In general it will be in /etc/squid/squid.conf . Now modify/ add the following lines.

visible_hostname machine-name
http_port 3128
cache_dir ufs /var/spool/squid 1000 16 256
access_log /var/log/squid/access.log squid

3) Now add the following in the acl section.

acl our_networks src
http_access allow our_networks

Here the is your local IP /netmask

4) Now start the squid server

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

5) Now configure your web browser as follows. ( It is my firefox configuration )

Go to Preferences -> connection settings -> manual Proxy configurations
Now configure your proxy server IP and port ( 3128)
Now click Ok.

This is the most simplest proxy server configurations over network.

Saturday, January 30, 2010

What is the difference between "su -" and "su" ?

The main difference between su - and su is that the former makes the shell a login shell. This is very important especially if the user is going to su from a regular user account to a root (superuser) account. Normal users do not usually have /sbin/ and /usr/sbin/ in their search path. Therefore if a normal user wants to execute the command ifconfig, for example, after doing su, he usually gets the error message:

bash: ifconfig: command not found

With su -, on the other hand, root's .bashrc and .bash_profile and other special environment settings get sourced and this puts the sbin directories into the search path. Below is a sample session:

[testuser@localhost ~]$ su
[root@localhost testuser]# echo $PATH
[root@localhost testuser]# ifconfig
bash: ifconfig: command not found
[root@localhost testuser]# exit
[testuser@localhost ~]$ su -
[root@localhost ~]# echo $PATH
[root@localhost ~]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:A0:CC:39:75:41
inet addr: Bcast: Mask:
inet6 addr: fe80::2a0:ccff:fe39:7541/64 Scope:Link
RX packets:21619559 errors:1 dropped:0 overruns:0 frame:87
TX packets:21190195 errors:4 dropped:0 overruns:4 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1509569968 (1.4 GiB) TX bytes:2280347397 (2.1 GiB)
Interrupt:177 Base address:0x6800

lo Link encap:Local Loopback
inet addr: Mask:
inet6 addr: ::1/128 Scope:Host
RX packets:6159 errors:0 dropped:0 overruns:0 frame:0
TX packets:6159 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:3784618 (3.6 MiB) TX bytes:3784618 (3.6 MiB)

Change hostname in Linux without rebooting server

Change hostname in Linux without rebooting server

First you need to find out your hostname, you can do this with

$ hostname

Edit /etc/hosts

You need to edit /etc/hosts and add a line for your host name

$ cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail. localhost.localdomain localhost

My new server IP is, i need to assign it hostname, to do this, i have edited /etc/hosts as follows.

# Do not remove the following line, or various programs
# that require network functionality will fail. localhost.localdomain localhost fedora

Edit /etc/sysconfig/network

First lets see what is in the file

$ cat /etc/sysconfig/network

To change servers hostname to, change the file as follows.

$ cat /etc/sysconfig/network


$service syslog restart

after you can logout and login back

Saturday, January 23, 2010

RedHat/CentOS Cluster HP ilo

Posted by Picasa

1. root#mkqdisk -c /dev/sda1 -l qdisk_rac
2. root#chkconfig --level 345 qdiskd on
3. root#service qdiskd start
4. root#system-config-cluster
5. Cluster Name : apache-cluster and selected quorum disk with following options
Interval = 1
TKO = 10
votes =1
Minimum score = 3
Device = /dev/sda1
Label = qdisk_rac
6. Quorum Disk Heuristic
Program = ping -c 2
Score =1
Interval = 2
7. Add new node to cluster
Node Name =
Quorum votes = 1
Node Name =
Quorum votes = 1
8. New Fence Device
HP ILO Device
Name = ILOGB89xxxxxx
user = manage
password = manage
Hostname =
HP ILO Device
Name = ILOGB88xxxxxx
user = manage
password = manage
Hostname =

9. selected Node1 and "Manage fencing for this node"
Add New Fencing level -> Add Fencing to this Level. selected ILOGB89xxxxxx

10. selected Node2 and "Manage fencing for this node"
Add New Fencing level -> Add Fencing to this Level. selected ILOGB88xxxxxx
11. Created failover domains "failover-cluster" and selected
" and" from menu, and selected
"Restrict to this Failover Domain"

12. Create Resource
New Resource = Apache Server
Name = Apache HTTP Server service
Server Root = /etc/httpd
Config File = /etc/httpd/conf/httpd.conf
httpd options = /etc/rc.d/init.d/httpd

13. Create a new Resource "File system"
Name = httpd-content
File System type = ext3
Mount point = /var/www/html
device = /dev/sdb1

14. Create a new Resource "IP "

15. Create a New Service "Web-Service"
Failover Domain = failover-cluster
And selected "Add shared resource to this service"
A. Apache HTTP Server Service
B. Httpd-Content
C. IP Address (

#[node1@node1]scp /etc/cluster/cluster.conf node2:/etc/cluster/cluster.conf


#md5sum /etc/clsuter/cluster.conf

541b1dc67392b18aad7e1df3612a6afe cluster.conf (both node )

on both node

#service cman start
#service rgmanager start


#chkconfig cman on
#chkconfig rgmanager on

Posted by Picasa


# fence_ilo -a -l Administrator -p password -o status -v

# fence_ilo -a -l Administrator -p password -o reboot -v