Archive

Archive for the ‘CentOS’ Category

Save Power using Wake On Lan

March 8th, 2010 Dhaval Thakar No comments

Apart from Virtulization we can shut servers whenever it is not being used to save power.

At my office, we used to keep Antivirus server running 24×7, to get latest definition updates & to let users fetch. This was not necessary to keep server ON whole night as there was no user. Also we had same situation for Squid server & Samba, NFS share.

All these servers were required to be up & running before employees enters office.
In other words we required to keep all servers running 5 days a week. It was of no use to keep it running during nights & weekend.

Using Wake-on-lan we could get all server up before office hours.

We use NAGIOS, this one is ON 24×7 to monitor links & live servers.
By configuring Cronjob on Nagios we got all servers UP before office hours.

etherwake / ether-wake is available on almost all distro. you can get server up
ether-wake MACADD

to install ether-wake
Centos – yum install ether-wake
Ubuntu – apt-get install etherwake

Apache Web using POP3 Auth

January 21st, 2010 Dhaval Thakar No comments

One fine day one the project leader asked that he we to share files over internet to employees, he was looking for some auth system where only existing employee can login. Since we have hosted mail server & no auth system in office the convenient way we found was to use POP3 Auth.

Following is the configuration I am sharing to use pop3 auth for web site running over apache.
Install Auth mechanism.
Refer

cpan
install Apache::AuthPOP3
install Net::POP3

Apache configuration

httpd.conf

ServerName userweb.linuxreaders.com
DocumentRoot /home/userweb
DirectoryIndex index.html
PerlModule Apache::AuthDBI

AuthName "Enter your Email ID & Password"
AuthType Basic
PerlAuthenHandler Apache::AuthPOP3
PerlSetVar        MailHost pop.linuxreaders.com
#PerlSetVar        UserMap pop3user1=>realname1,pop3user2=>realname2
Require valid-user

Resize LVM -Centos

January 18th, 2010 Dhaval Thakar No comments

Here We are sharing guide to resize LVM size.

create new partition

ADD PHYSICAL VOLUME

pvcreate /dev/new_partition

Verify new physical volume

pvdisplay
Or
pvscan

Extend existing VOLUME GROUP

vgextend VolGroup00 /dev/xvda3

make sure vg free size is = new partition size using vgdisplay command

Extend existing LVM by adding new partition

lvextend /dev/VolGroup00/LogVol00 /dev/xvda3

make sure lv size is increased, use lvdisplay

RESIZE FILE SYSTEM

resize2fs /dev/VolGroup00/LogVol00

Easiest way for Interface Bonding – CentOS

January 12th, 2010 Dhaval Thakar No comments

There is preferred way of bonding using ifcfg- files.
But I prefer following method as it is very easy to setup.

Here I am using 192.168.3.2 for the bond0.
eth0 & eth1 are used for bonding.
We’ll enter following lines in /etc/rc.local

modprobe bonding mode=balance-rr miimon=100
ifconfig bond0 192.168.3.2 netmask 255.255.255.0 up
ifenslave bond0 eth0
ifenslave bond0 eth1
route add -net 0.0.0.0 netmask 0.0.0.0 gw 192.168.3.1

To verify bonding

cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.4.0 (October 7, 2008)

Bonding Mode: load balancing (round-robin)
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0

Slave Interface: eth0
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:19:5b:fd:0f:e7

Slave Interface: eth1
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:16:76:d2:c7:8d

Create OCS Inventory Auto-Installer

January 5th, 2010 Dhaval Thakar No comments

We have already covered Installation of OCS Inventory.

For any of us server installation is easy task, but when it comes to install client agent on all windows systems its going to take long. The easiest way I see is to create client installer using ocs packager, this package will have server info, tags, cert. And installation is easy, so that your users can take care of it.

Download & extract ocs packager.

Run packager.

Define source ocs windows client agent installer path, Label, Command line options & cert if required.
here /server:=your_ocs_server_ip_or_fqdn

Next

Define path to store package file. Now you can run this on every windows clients.

This will help you save time & quickly have agents installed on every windows client systems.