Thursday, November 29, 2007

Exchange Backup - Online vs Offline

Hi friends,

This article explains the two different strtegy available in the exchange 2000 and 2003 server. The Netbackup is the backup tool used for backup and restore in the windows environment with excellent features.

Backup exchange 2000/2003 in 2 ways: Online backup and Offline backup.

Online Backup:

An Online backup is performed while the Information Store is still mounted and the Exchange server is operational. The Exchange is Online and available for transactions, therefore it still allows users to work without interruption. Online backups also automatically clear the database logs upon completion.

Another major advantage of the Online backup method is the fact that the Exchange store is checked for corruption at the file-system level. This check is done by verifying the checksums on each 4 KB (Kilobyte) block or page in the database. If there is a checksum failure, backup will terminate. Exchange will not allow you to back up an Exchange store with a wrong checksum in it.

Therefore, after an online backup is complete, you should check the Event Viewer to find out whether your Exchange store is corrupted. If you see a failed backup with a page read error event in Event Viewer, this may be an early indication of a problem in the database.

Offline Backup:

Offline backup is performed by shutting down the Exchange Information Store service and performing COPY procedures on the Exchange databases (Public Folder or Mailbox stores). Using an Offline Backup provides a method to restore the Exchange system to its last known state or specific "point in time", and is usually considered to be less attractive than the Online backup.

However, you may need to perform an Offline backup in the following situations:

* Your Online backup failed. You can complete an Offline backup in situations where an Online backup might fail (for example, due to an error such as a checksum1018 JET_errReadVerifyFailure).
* Your backup software does not support Exchange Online backup APIs, requiring you to dismount the Exchange 2000/2003 mailbox and public folder stores before you backup the server.

Some disadvantages to performing an Offline backup include:

* You must stop IS services (You do not need to stop the IS if you only want to backup the store, for that you can simply just dismount it. However if you want to backup the log files you do need to stop the IS service).
* Users will not be able to access their mailboxes during the offline backup.
* Log files that contain transactions already written to the database files will not be purged after the completion of the backup.
* The database is not checked for corruption during an Offline backup. You might have a corrupt database and backup sets that cannot be used to restore your server to full functionality.
* An increased chance of data loss due to files being copied to and from a backup location.


Wednesday, November 28, 2007

Configuring SNMP in routers

Hi Friends,

This articles explains the role of SNMP in the networks and also how to configure SNMP in the router to get the monitoring updates from the client using the tools like PRTG traffic analyser, etc.

The Simple Network Management Protocol (SNMP) is an application layer protocol that facilitates the exchange of management information between network devices. It is part of the Transmission Control Protocol/Internet Protocol (TCP/IP) protocol suite. SNMP enables network administrators to manage network performance, find and solve network problems, and plan for network growth.

SNMP Versions:

Version 1 has been criticized for its poor security. The passwords are sent in cleartext.


It revises version 1 and includes improvements in the areas of performance, security, confidentiality, and manager-to-manager communications.


SNMPv3 provides three important services: authentication, privacy and access control.

Configuring SNMP Access in Routers:

Router(config)#snmp-server community public RO

Router(config)#snmp-server community private RW

Configuring SNMP Traps in Routers:

Router(config)#snmp-server host public

Router(config)#snmp-server enable traps

In case accessing this snmp from the windows client machine, should enable snmp service from the add or remove components. Having the firewall in between the client and router device will disturb the connection. Configure the firewall so that the respective port numbers are open.


Saturday, November 24, 2007


Hi friends

This article explains the basic configuration of sendmail. In this example, i use the sendmail package from the RHEL 5 and use and as fqdn for this mail server and dns server. Lemme give you the step by step procedure for building the sendmail server.

1. Install the sendmail package:

# yum install sendmail

2. Check the Existence of package:

# rpm -qa | grep sendmail

3. Services:

# chkconfig --level 345 sendmail on
# service sendmail start|stop|restart|status or
# /etc/init.d/sendmail start|stop|restart|status

4. Sendmail configuration file :

# /etc/mail/ //main sendmail config file
# /etc/mail/ //file used to edit and push the updates to the main file

All configuration changes can be done only at /etc/mail/ and with the help of macro push it to the file /etc/mail/

5. Macro m4 :

To find the macro path
# locate cf.m4
#m4 /usr/share/sendmail-cf/m4/cf.m4 /etc/mail/ > /etc/mail/
and then restart to make the changes to take effect.

6. Disabling line in /etc/mail/ file:

These statements are disabled by dnl commenting.
dnl DAEMON_OPTIONS(`Port=smtp,Addr=, Name=MTA')
dnl # DAEMON_OPTIONS(`Port=smtp,Addr=, Name=MTA')

This statement is incorrectly disabled:
# DAEMON_OPTIONS(`Port=smtp,Addr=, Name=MTA')

This statement is active:
DAEMON_OPTIONS(`Port=smtp,Addr=, Name=MTA')

7. DNS Server

The proper implementation of DNS server is important before configuring the sendmail. Please test the dns name resoultion with the tools like nslookup, host and dig tool.In this eg, consider the ( as primary dns server.

# host has address
#host address

8. Check /etc/resolv.conf file:
make sure /etc/resolv.conf file contains the correct dns server details
# vi /etc/resolv.conf

9. Check /etc/hosts file:
# vi /etc/hosts localhost.localdomain localhost mailserver

10. Edit /etc/mail/ file:

First, using dnl disable the line like
dnl "DAEMON_OPTIONS(`Port=smtp,Addr=, Name=MTA')"

Second, disable the smarthost option
dnl define(`SMART_HOST',`')

Use macro and restart the sendmail daemon

Check the local NIC card is enabled for receive all packets by
# netstat -an | grep :25 | grep tcp
tcp 0 0* LISTEN

11. Edit /etc/mail/access file:

# vi /etc/mail/access
localhost.localdomain RELAY
localhost RELAY RELAY
192.168.30 REJECT // rejects the mails from n/w RELAY // relay the mails from the host
192.168.10 RELAY // relay the mails from n/w RELAY // relay the mails from the suffix

12. Edit /etc/mail/local-host-names file:

add hostnames or domain names for which the sendmail accept mail for local delivery.

# vi /etc/mali/local-host-names

13. Edit /etc/mail/virtusertable file:

# vi /etc/mail/virtusertable
// first column is the target email address
// second column may be created user mailbox in the mailserver, aliase name or groupname created in the /etc/aliase or even remote email address. logu // logu - local user sonia test testaliase // testaliase entry created in /etc/aliase error:nouser User Unknown // answer for other than the above user

14. Edit /etc/aliases file:

add the below lines at the bottom of the file

# vi /etc/aliases

#setting new aliase
testaliase: logu,test

As per virtusertable above, the mail to will go to and

15. Configuring POP3/IMAP :
By configuring the sendmail for pop3/imap, we will be able to acces mail from thunderbird, evolution, Outlook, etc.

First, check the existence of dovecot and services using

# chkconfig --level 345 dovecot on
# service dovecot start|stop|restart|status or
# /etc/init.d/dovecot start|stop|restart|status

Second, edit the /etc/dovecot.conf file

# vi /etc/dovecot.conf
//search for protocols
//protocols = imap imaps pop3 pop3s
protocols = pop3 // configure pop3 or imap as per your need

Third, test the NIC listening for pop3 using,

# netstat -a | egrep -i 'pop|imap'
tcp 0 0 *:pop3 *:* LISTEN

Fourth, use Outlook or any client tool to test the mail flow.

16. Troubleshooting via telnet:

Please refer this article in my blog.


Thursday, November 22, 2007


Bugzilla is server software designed to help you manage software development. It is a bug tracking tool.

1. Download
Download the bugzilla tar ball from the link

2. Install Perl and some dependent modules.

Install Perl v5.6.0 and above. The perl comprises large number of modules and deploying the bugzilla need some modules to be configured prior.

Required Perl modules:
1. CGI 2.93 or CGI 3.11 if using mod_perl
2. Date::Format (2.21)
3. DBI (1.41)
4. DBD::mysql (2.9003) if using MySQL
5. DBD::Pg (1.45) if using PostgreSQL
6. File::Spec (0.84)
7. Template (2.12)
8. Email::Send (2.00)
9. Email::MIME::Modifier (any)

Optional Perl modules:
1. GD (1.20) for bug charting
2. Template::Plugin::GD::Image (1.20) for Graphical Reports
3. Chart::Base (1.0) for bug charting
4. GD::Graph (any) for bug charting
5. GD::Text (any) for bug charting
6. XML::Twig (any) for bug import/export
7. MIME::Parser (5.406) for bug import/export
8. LWP::UserAgent (any) for Automatic Update Notifications
9. PatchReader (0.9.4) for pretty HTML view of patches
10. Image::Magick (any) for converting BMP image attachments to PNG
11. Net::LDAP (any) for LDAP Authentication
12. SOAP::Lite (any) for the web service interface
13. HTML::Parser (3.40) for More HTML in Product/Group Descriptions
14. HTML::Scrubber (any) for More HTML in Product/Group Descriptions
15. Email::MIME::Attachment::Stripper (any) for Inbound Email
16. Email::Reply (any) for Inbound Email
17. mod_perl2 (1.999022) for mod_perl
18. CGI (2.93) for mod_perl
19. Apache::DBI (0.96) for mod_perl2

CPAN is the best tool for installing the perl modules.

# perl -MCPAN -e shell

Once the Perl interpreter has loaded (and been configured), you can install modules by issuing the command install MODULENAME.please use /var/spool/CPAN as the primary location for building the CPAN repository. The interpreter will ask for more options and preferably provide with the default values. After getting lot of inputs, it ends with the prompt "cpan>".

The first thing you should do is upgrade your CPAN:
cpan> install Bundle::CPAN (take's time to complete)

Once it's done, type:
cpan> reload cpan

Now, enter the following command to retrieve all of the required modules:
cpan> install MODULENAME
cpan> install DBI
cpan> install DBD::mysql

2. Install MySQL version 3.23.41 or later.

3. Install Apache Webserver - "httpd".

4. Install Sendmail 8.7 or later.

5. Final Check for prerequisites before deploying bugzilla source

Start mysql,sendmail and apache service

#perl -v
#mysql -V

In browser : http://localhost (should have apache test page)

At this point, conclude that prerequisites for bugzilla installation is done.

6. Unpack bugzilla

# cd /var/www/html/
# tar zxvf bugzilla-2.18rc3.tgz
# mv bugzilla-2.18rc3/ bugzilla/ (for simplicity purpose)

7. Checking the perl modules by script

# cd /var/www/html/bugzilla
# ./

Executing the script gives the status of the perl modules installed.Try to install the modules that failed the test and rerun the script.(Even after installing some modules, it may show failed test for some optional perl modules.There is no problem start continuing the next step)

8. Create a DB account for bugzilla user

# mysql

9. Edit the bugzilla config file:

# vi /var/www/html/bugzilla/localconfig

search for $db_pass and replace with 'enterpassword'

10. Last Compile ./ (it will ask for bugzilla's administrative account details at the end)

11. Edit apache configuration file:

# vi /etc/httpd/conf/httpd.conf

a. uncomment the line "AddHandler cgi-script .cgi"

b. add the below two lines.
Document root
Options ExecCGI FollowSymLinks <---- add this line.
AllowOverride Limit <---- add this line.

/document root
c. add "index.cgi" in the below line
DirectoryIndex index.html index.html.var index.cgi

#/etc/init.d/httpd restart

12. Open browser http://localhost/bugzilla , gives you the home page of the bugzilla application successfully.

Please mail me if you have any questions.


Basic DNS Server - BIND

Hi friends,

This article gives you the basic configuration of Dns-bind server in linux distribution. In this example i have used the chroot bind package.

1. Install the DNS Package
(either regular BIND or with BIND chroot):
Check the existence with the command

# rpm -qa | grep bind

2. Services:

# chkconfig --list | grep named
# chkconfig --level 345 named on
# /etc/init.d/named start|stop|status|restart or
# service named start|stop|status|restart

3. Firewall - open dns Port:

Open the tcp & udp port 53 from the firewall for the inbound DNS name resolution.

4. vi /etc/hosts:

Set proper name for the dns server host as shown below dns1 localdomain.loalhost localhost

5. Common location of dns configuration files:

In regular BIND server
named.conf file --> /etc/named.conf
zone files --> /var/named/
In chroot BIND server
named.conf file --> /var/named/chroot/etc/named.conf
zone files --> /var/named/chroot/var/named/

6. Getting the Test Sample File:
Find test sample file configuration using the locate command.

for eg.,

# locate named.conf
# locate .zone

7. For simpler configuration create a symbolic link as

# ln -s /var/named/chroot/etc/named.conf /etc/named.conf

8. configuring : /etc/named.conf

// options for configuring the forwarders
options {
forwarders {; };
statistics-file "/var/named/data/named_stats.txt" ;
dump-file "/var/named/data/cache_dump.db" ;
directory "/var/named" ;
// root hints details
zone "." {
file "/var/named/named.root";
type hint;
// Forward lookup zone details
zone "" IN {
type master;
file "";
allow-update { none; };
// reverse lookup zone details
zone "" IN {
type master;
file "";
allow-update { none; };

9. configuring : /var/named/chroot/var/named/

# vi /var/named/chroot/var/named/

$TTL 86400
@ IN SOA (
2002022401 ; serial
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum


IN MX 10


dns1 IN A
server2 IN A
client1 IN A

server1 IN CNAME dns1
mail IN CNAME server2

10. configuring : /var/named/chroot/var/named/

# vi /var/named/chroot/var/named/

$TTL 86400
@ IN SOA (
2002022401 ; serial
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum



11. Restart the "named" Services.

12. Client side configuration :

In Linux Client:

# vi /etc/resolv.conf


In Windows Client:

Configure the preferred DNS server with DNS server ip address (

13. Check the name resolution with the following tool



Sunday, November 18, 2007

Linux/UNIX Basic Commands - Part 2

Hi Friends,

Here is the continuation of the topic Linux/UNIX Basic Commands Part 1.


ssh user@host – connect to host as user
ssh -p port user@host – connect to host on port as user
ssh-copy-id user@host – add your key to host for user to enable a keyed or passwordless login


grep pattern files – search for pattern in files
grep -r pattern dir – search recursively for pattern in dir
command | grep pattern – search for pattern in the output of command
locate file – find all instances of file


tar cf file.tar files – create a tar named file.tar containing files
tar xf file.tar – extract the files from file.tar
tar czf file.tar.gz files – create a tar with Gzip compression
tar xzf file.tar.gz – extract a tar using Gzip
tar cjf file.tar.bz2 – create a tar with Bzip2 compression
tar xjf file.tar.bz2 – extract a tar using Bzip2
gzip file – compresses file and renames it to file.gz
gzip -d file.gz – decompresses file.gz back to file


ping host – ping host and output results
whois domain – get whois information for domain
dig domain – get DNS information for domain
dig -x host – reverse lookup host
wget file – download file
wget -c file – continue a stopped download


Install from source:
make install
dpkg -i pkg.deb – install a package (Debian)
rpm -ivh pkg.rpm – install a package (RPM)
yum install pkgname - using the yum tool


Ctrl+C – halts the current command
Ctrl+Z – stops the current command, resume with fg in the foreground or bg in the background
Ctrl+D – log out of current session, similar to exit
Ctrl+W – erases one word in the current line
Ctrl+U – erases the whole line
Ctrl+R – type to bring up a recent command
!! - repeats the last command
exit – log out of current session



Linux/UNIX Basic Commands - Part 1

Hi friends

Please find the Basic linux/Unix commands below for your reference

File Commands:

ls – directory listing
ls -al – formatted listing with hidden files
cd dir - change directory to dir
cd – change to home
pwd – show current directory
mkdir dir – create a directory dir
rm file – delete file
rm -r dir – delete directory dir
rm -f file – force remove file
rm -rf dir – force remove directory dir *
cp file1 file2 – copy file1 to file2
cp -r dir1 dir2 – copy dir1 to dir2; create dir2 if it doesn't exist
mv file1 file2 – rename or move file1 to file2 if file2 is an existing directory, moves file1 into directory file2
ln -s file link – create symbolic link link to file
touch file – create or update file
cat > file – places standard input into file
more file – output the contents of file
head file – output the first 10 lines of file
tail file – output the last 10 lines of file
tail -f file – output the contents of file as it grows, starting with the last 10 lines.

System Info:

date – show the current date and time
cal – show this month's calendar
uptime – show current uptime
w – display who is online
whoami – who you are logged in as
finger user – display information about user
uname -a – show kernel information
cat /proc/cpuinfo – cpu information
cat /proc/meminfo – memory information
man command – show the manual for command
df – show disk usage
du – show directory space usage doesn't exist
free – show memory and swap usage
whereis app – show possible locations of app
which app – show which app will be run by default
locate filename - to find the location of the file
find / -name filename or namespace - to find the file with some namespace

Process Management:

ps – display your currently active processes
top – display all running processes
kill pid – kill process id pid
killall proc – kill all processes named proc *
bg – lists stopped or background jobs; resume a stopped job in the background
fg – brings the most recent job to foreground
fg n – brings job n to the foreground

File Permissions:

chmod octal file – change the permissions of file to octal, which can be found separately for user, group, and world by adding:
  • 4 – read (r)
  • 2 – write (w)
  • 1 – execute (x)
chmod 777 – read, write, execute for all
chmod 755 – rwx for owner, rx for group and world
For more options, see man chmod.

Please read Linux/UNIX Basic Commands - Part 2 also.



Tuesday, November 13, 2007

Mysql - copy table from one database to other

Hi friends

This article explains how to move the particular table from the database to other database of same machine or different machine.Obviously, the user should have sufficient access for the database.

Copy the Table

# mysqldump --opt databasename table1 table2 tablen > tableexport.sql

For eg.,
# mysqldump --opt projectdbname tablename > anybackupname.sql

Moving to Remote machine using SCP:

# scp anybackupname.sql root@remotename_or_ip:/tmp


# mysql resultantdbname < anybackupname.sql


Sunday, November 4, 2007

Installing Ruby on Rails

Hi friends,

This article explains the step by step procedure for installing the ruby on rails application in the Linux machines. The installation guidelines are found in the ruby on rail's home site. Please follow the below steps for deploying this developer suite.

Step1: Installing ruby-1.8.6

Download from the ruby on rail's home site or use
# wget
# tar -xzf ruby-1.8.6.tar.gz
# cd ruby-1.8.6
# ./configure
# make
# make install
# ruby -v or # ruby --version (to check the installed version)

Note: make sure the availability of any c compiler, if not please use "# yum install gcc" to install the compiler.

Step2: Installing rubygems

Download from the ruby on rail's home site or use
# wget
# tar -zxvf rubygems-0.8.11.tgz
# cd rubygems-0.8.11
# ruby setup.rb

Step3: Install rails using gem

# gem install rails

Step4: test

Please check the installation logs for successfully completion. Can use the following command also
# rails test
# cd rails
# ruby script/server