Infoaddict Just another site for Infoaddict's

1Feb/140

Mod Evasive for Apache (First line of defence against DOS attacks)

Posted by Infoaddict

Though I wanted my first howto to be quite powerful and explanatory, here is what I am starting with, with a short one.

Mod Evasive (mod_evasive) is a module for Apache web server. Within this, you can define certain limits on it for people trying to access a page on your website. Such as ability to access the same page (more than once) within a second. This is normally an idication of DOS attack. Mod_evasive successfully intercepts such attack and returns a 403 (Forbidden) message to the attacker. Here is how it will be implemented.

System / OS: CentOS 5.0

Homepage of mod_evasive : http://www.zdziarski.com/projects/mod_evasive/
Make sure you have httpd-devel installed before you continue. Otherwise you will not get apxs utlity. You have been warned.

cd ~
wget http://www.zdziarski.com/projects/mod_evasive/mod_evasive_1.10.1.tar.gz
tar xzf mod_evasive_1.10.1.tar.gz

cd mod_evasive

apxs -i -a -c mod_evasive20.c

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

<IfModule mod_evasive20.c>
DOSHashTableSize    3097
DOSPageCount        2
DOSSiteCount        50
DOSPageInterval     1
DOSSiteInterval     1
DOSBlockingPeriod   10
DOSEmailNotify      webmaster@yourdomain.com
#     DOSSystemCommand    "su - someuser -c '/sbin/... %s ...'" # this is firewall command maybe
DOSLogDir           "/var/log/httpd/mod_evasive.log"
</IfModule>

service httpd restart

Time to test it:

Make sure your website's document Root has an index.html, otherwise you will not get correct results. I had to adjust a line in test.pl to get /mrtg/index.html .

# chmod +x test.pl  # supplied by source code of mod_evasive.

Execute this test script:

# ./test.pl
HTTP/1.1 200 OK
HTTP/1.1 200 OK
HTTP/1.1 200 OK
HTTP/1.1 200 OK
...
...
HTTP/1.1 200 OK
HTTP/1.1 200 OK
HTTP/1.1 200 OK
HTTP/1.1 403 Forbidden
HTTP/1.1 403 Forbidden
..
...
HTTP/1.1 403 Forbidden
HTTP/1.1 403 Forbidden

Print Friendly
Filed under: RHEL No Comments
1Feb/140

Apache PHP and Oracle Howto

Posted by Infoaddict

Note: This is also a year old. But helps understand the basic principle of combining Apache, PHP and Oracle.

 

NOTE: NOTE: NOTE: REMOVE APACHE RPM, or else you will be pulling your hair afterwards.
YOU HAVE BEEN WARNED!

Oracle 10gR2 client was installed in /oracle as type: "Run Time"

After installation of Oracle software is completed, it is better to run ldconfig once.

~]# ldconfig

Apache was installed using :

~]# mkdir /www

~]# cd /tmp/httpd-2.2.4

httpd-2.2.4]# ./configure --prefix=/www --exec-prefix=/www --bindir=/www/bin --sysconfdir=/www/conf --libdir=/www/lib  --enable-module=so

httpd-2.2.4]# make && make install && echo "Apache Installation Success" || echo "Apache FAILED"

~]# cd /tmp/php-4.4.5

php-4.4.5]# export ORACLE_HOME=/oracle/product/10.2.0/db_1

php-4.4.5]# export ORACLE_SID=orcl

The following will work for "Administrator" and "Runtime" versions of Oracle Client software installation only :

php-4.4.5]# ./configure --prefix=/www/php --with-apxs2=/www/bin/apxs --with-config-file-path=/www/php --with-oci8=$ORACLE_HOME --enable-shared=$ORACLE_HOME/lib --disable-xml --without-pear --enable-sigchild

php-4.4.5]# make && make install && echo "PHP Installation Success" || echo "PHP FAILED"

php-4.4.5]# libtool --finish /tmp/php-4.4.5/libs

This step is not required:-

~]# chmod o+rx  /oracle -R

~]# vi /www/conf/httpd.conf

(Make the following changes:-)

ServerAdmin webmaster@yourdomain.com
ServerName dbserver.yourdomain.com

AddType application/x-httpd-php .php .phtml

DirectoryIndex index.php index.html index.html.var

LoadModule php4_module        modules/libphp4.so  # (Normally it already exists, you don't have to write yourself)

~]# vi /www/bin/envvars

# This file is generated from envvars-std.in
#
export ORACLE_HOME="/oracle/product/10.2.0/db_1"
export ORACLE_BASE="/oracle/"
export ORACLE_SID="orcl"
LD_LIBRARY_PATH="/www/lib:$LD_LIBRARY_PATH:$ORACLE_HOME/lib"
export LD_LIBRARY_PATH

To check PHP:

~]# vi /www/htdocs/index.php

~]# vi /www/htdocs/test.php

if ($conn=OCILogon("scott", "tiger", "orcl")) {
echo "

Active

";
}else {
$err = OCIError();
echo "

Failed

";
}
?>

( Test your entire setup by this script. Should show you "Active" on your web page. )

Now this is the part which made me too mad for a week. It gave nme all kind of weird messages, like: "unable to retrieve text", etc etc.

The application developers were over-riding the variable settings of my apache server

~]# vi /www/htdocs/dsn/conn.php

# #########################################################################################
# As you can see these settings from application were causing all stupid errors
# So I commented them and things become all ok.
# There is no need to setup these variables here as they are setup in /www/bin/envvars file
# #########################################################################################

#putenv("ORACLE_BASE=/u01/app/oracle/product/10.1.0/Db_1");
#putenv("ORACLE_HOME=/u01/app/oracle/product/10.1.0/Db_1");
#putenv("ORACLE_SID=FPSC");
#putenv("NLS_LANGUAGE=FRENCH_FRANCE.WE8ISO8859P1");
#putenv("TNS_ADMIN=/u01/app/oracle/product/10.1.0/Db_1/network/admin");
#putenv("TNS_ADMIN=/u01/app/oracle/product/10.1.0/Db_1");
#putenv("ORA_NLS33=/u01/app/oracle/product/10.1.0/Db_1/ocommon/nls/admin/data");
#putenv("LD_LIBRARY_PATH=/u01/app/oracle/product/10.1.0/Db_1/lib:/u01/app/oracle/product/10.1.0/Db_1/network");

# ##############################################################################################################

if(!$conn) {

$conn=OCILogon("scott", "tiger", "orcl");
if($error = OCIError()) {
die("ERROR!! Couldn't connect to server!");
}
}
?>

Now setup Apache to start at boot time.

~]# vi /etc/rc.local
/www/bin/apachectl -k start && echo "Apache startup OK" || echo "Apache startup FAILED" ; sleep 3

 

Or you can setup an init.d script for this.

Print Friendly
Filed under: Oracle, RHEL No Comments
1Feb/140

Automate user response using expect / pyexpect scripting tool

Posted by Infoaddict

A few days ago, I was having problem extracting temperature values from a few of our switches in our HPC cluster.  For some reason, the switches did not  support temperature monitoring through SNMP. They did allow ssh though. So I decided to write a script to automatically send username and password to those switches and execute a particular command to get my task done. Below are those sccripts. One uses expect and the other uses pyexpect :-

You will need to install expect and pyexpect on your system, using yum.
The following script will execute "ls -l" on a remote system.
autologin.sh:-
-------------

#!/usr/bin/expect -f
#A simple example is a script that automates an ssh session:
set remote_server "localhost"
set my_user_id "kamran"
set my_password "redhat"
set my_command "ls -l"
spawn ssh $my_user_id@$remote_server $my_command
expect "?assword:*" {send "$my_password\r"}
send "\r"
send "exit\r"
expect eof

 

The following script uses python, and will execute "uptime" on a remote system:-

pyautologin.sh
-----------------

#!/usr/bin/python
import pexpect
REMOTE_COMMAND="uptime"
USER="fahad"
HOST="localhost"
PASS="redhat"
COMMAND="ssh  %s@%s %s" % (USER, HOST, REMOTE_COMMAND)
child = pexpect.spawn(COMMAND)
child.expect('password:')
child.sendline(PASS)
child.expect(pexpect.EOF)
print child.before

Print Friendly
Filed under: RHEL No Comments
24Jun/130

Oracle Database 11g Release 2 (11.2) Installation On Oracle Linux 6

Posted by Infoaddict

This article describes the installation of Oracle Database 11g Release 2 (11.2) (64-bit) on Oracle Linux 6 (64-bit). The article is based on a server installation with a minimum of 2G swap, with SELinux set to permissive and the firewall disabled. The following package groups were included for this installation.

  • Base System > Base
  • Base System > Client management tools
  • Base System > Compatibility libraries
  • Base System > Hardware monitoring utilities
  • Base System > Large Systems Performance
  • Base System > Network file system client
  • Base System > Performance Tools
  • Base System > Perl Support
  • Servers > Server Platform
  • Servers > System administration tools
  • Desktops > Desktop
  • Desktops > Desktop Platform
  • Desktops > Fonts
  • Desktops > General Purpose Desktop
  • Desktops > Graphical Administration Tools
  • Desktops > Input Methods
  • Desktops > X Window System
  • Development > Additional Development
  • Development > Development Tools
  • Applications > Internet Browser

An example of this type of Linux installations can be seen here. Alternative installations may require more packages to be loaded, in addition to the ones listed below.

Download Software

Download the Oracle software from OTN or MOS depending on your support status.

Unpack Files

Unzip the files.

# 11.2.0.1
unzip linux.x64_11gR2_database_1of2.zip
unzip linux.x64_11gR2_database_2of2.zip

#11.2.0.2
unzip p10098816_112020_Linux-x86-64_1of7.zip
unzip p10098816_112020_Linux-x86-64_2of7.zip

#11.2.0.3
unzip p10404530_112030_Linux-x86-64_1of7.zip
unzip p10404530_112030_Linux-x86-64_2of7.zip

You should now have a single directory called "database" containing installation files.

Hosts File

The "/etc/hosts" file must contain a fully qualified name for the server.

<IP-address>  <fully-qualified-machine-name>  <machine-name>

For example.

127.0.0.1       localhost.localdomain  localhost
192.168.0.181   ol6-112.localdomain    ol6-112

Oracle Installation Prerequisites

Perform either the Automatic Setup or the Manual Setup to complete the basic prerequisites. The Additional Setup is required for all installations.

Automatic Setup

If you plan to use the "oracle-rdbms-server-11gR2-preinstall" package to perform all your prerequisite setup, follow the instructions at http://public-yum.oracle.com to setup the yum repository for OL, then perform the following command.

# yum install oracle-rdbms-server-11gR2-preinstall

All necessary prerequisites will be performed automatically.

It is probably worth doing a full update as well, but this is not strictly speaking necessary.

# yum update

Manual Setup

If you have not used the "oracle-rdbms-server-11gR2-preinstall" package to perform all prerequisites, you will need to manually perform the following setup tasks.

Oracle recommend the following minimum parameter settings.

fs.suid_dumpable = 1
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586

The current values can be tested using the following command.

/sbin/sysctl -a | grep <param-name>

Add or amend the following lines in the "/etc/sysctl.conf" file.

fs.suid_dumpable = 1
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
# semaphores: semmsl, semmns, semopm, semmni
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default=4194304
net.core.rmem_max=4194304
net.core.wmem_default=262144
net.core.wmem_max=1048586

Run the following command to change the current kernel parameters.

/sbin/sysctl -p

Add the following lines to the "/etc/security/limits.conf" file.

oracle              soft    nproc   2047
oracle              hard    nproc   16384
oracle              soft    nofile  4096
oracle              hard    nofile  65536
oracle              soft    stack   10240

Install the following packages if they are not already present.

# From Oracle Linux 6 DVD
cd /media/cdrom/Server/Packages
rpm -Uvh binutils-2*x86_64*
rpm -Uvh glibc-2*x86_64* nss-softokn-freebl-3*x86_64*
rpm -Uvh glibc-2*i686* nss-softokn-freebl-3*i686*
rpm -Uvh compat-libstdc++-33*x86_64*
rpm -Uvh glibc-common-2*x86_64*
rpm -Uvh glibc-devel-2*x86_64*
rpm -Uvh glibc-devel-2*i686*
rpm -Uvh glibc-headers-2*x86_64*
rpm -Uvh elfutils-libelf-0*x86_64*
rpm -Uvh elfutils-libelf-devel-0*x86_64*
rpm -Uvh gcc-4*x86_64*
rpm -Uvh gcc-c++-4*x86_64*
rpm -Uvh ksh-*x86_64*
rpm -Uvh libaio-0*x86_64*
rpm -Uvh libaio-devel-0*x86_64*
rpm -Uvh libaio-0*i686*
rpm -Uvh libaio-devel-0*i686*
rpm -Uvh libgcc-4*x86_64*
rpm -Uvh libgcc-4*i686*
rpm -Uvh libstdc++-4*x86_64*
rpm -Uvh libstdc++-4*i686*
rpm -Uvh libstdc++-devel-4*x86_64*
rpm -Uvh make-3.81*x86_64*
rpm -Uvh numactl-devel-2*x86_64*
rpm -Uvh sysstat-9*x86_64*
rpm -Uvh compat-libstdc++-33*i686*
rpm -Uvh compat-libcap*
cd /
eject

Note. This will install all the necessary 32-bit packages for 11.2.0.1. From 11.2.0.2 onwards many of these are unnecessary, but having them present does not cause a problem.

Create the new groups and users.

groupadd -g 501 oinstall
groupadd -g 502 dba
groupadd -g 503 oper
groupadd -g 504 asmadmin
groupadd -g 506 asmdba
groupadd -g 505 asmoper

useradd -u 502 -g oinstall -G dba,asmdba,oper oracle
passwd oracle

Note. We are not going to use the "asm" groups, since this installation will not use ASM.

Additional Setup

Set the password for the "oracle" user.

passwd oracle

Set secure Linux to permissive by editing the "/etc/selinux/config" file, making sure the SELINUX flag is set as follows.

SELINUX=permissive

Once the change is complete, restart the server.

If you have the Linux firewall enabled, you will need to disable or configure it, as shown here or here.

Create the directories in which the Oracle software will be installed.

mkdir -p /u01/app/oracle/product/11.2.0/db_1
chown -R oracle:oinstall /u01
chmod -R 775 /u01

Login as root and issue the following command.

xhost +<machine-name>

Login as the oracle user and add the following lines at the end of the ".bash_profile" file.

# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR

ORACLE_HOSTNAME=ol6-112.localdomain; export ORACLE_HOSTNAME
ORACLE_UNQNAME=DB11G; export ORACLE_UNQNAME
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1; export ORACLE_HOME
ORACLE_SID=DB11G; export ORACLE_SID

PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH

LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH

Installation

Log into the oracle user. If you are using X emulation then set the DISPLAY environmental variable.

DISPLAY=<machine-name>:0.0; export DISPLAY

Start the Oracle Universal Installer (OUI) by issuing the following command in the database directory.

./runInstaller

Proceed with the installation of your choice. The prerequisites checks will fail for the following version-dependent reasons:

  • 11.2.0.1: The installer shows multiple "missing package" failures because it does not recognize several of the newer version packages that were installed. These "missing package" failures can be ignored as the packages are present. The failure for the "pdksh" package can be ignored because we installed the "ksh" package in its place.
  • 11.2.0.2: The installer should only show a single "missing package" failure for the "pdksh" package. It can be ignored because we installed the "ksh" package in its place.
  • 11.2.0.3: The installer shows no failures and continues normally.

You can see the type of installation I performed by clicking on the links below to see screen shots of each stage.

  1. Configure Security Updates
  2. Select Install Option
  3. System Class
  4. Node Selection
  5. Select Install Type
  6. Typical Install Configuration
  7. Create Inventory
  8. Perform Prerequisite Checks
  9. Summary
  10. Install Product
  11. Database Configuration Assistant
  12. Database Configuration Assistant 2
  13. Execute Configuration Scripts
  14. Finish

Post Installation

Edit the "/etc/oratab" file setting the restart flag for each instance to 'Y'.

DB11G:/u01/app/oracle/product/11.2.0/db_1:Y

 

Print Friendly
Filed under: Oracle, RHEL No Comments
24Jun/130

Tightening SPAM control on ISPConfig Server

Posted by Infoaddict

Recently one of my clients shifted from Plesk to ISPConfig, and I was asked to setup ISPConfig control panel on it. We followed an ISPConfig How-to from howtoforge.com . The installation was (almost) a breeze. Migration from plesk to ISPConfig was quite painful. But anyway, we did it.

Later when the system went live and remained in production for more than a week, we noticed that there is a lot of spam coming in. The postfix mail server needed some additional armor. I wanted some important checks, such as helo, RBL and SPF. Below is how I added that extra level of protection.

 

First, I want to thank and acknowledge the authors of following web pages, which helped me in achieving this:

 

http://www.wains.be/index.php/2006/04/04/postfix-spf/

http://www.freesoftwaremagazine.com/articles/focus_spam_postfix?page=0%2C2

http://www.howtoforge.com/postfix_spf

 

For SPF, I downloaded the postfix-SPF (module/plugin) from http://www.openspf.org/blobs/postfix-policyd-spf-perl-2.007.tar.gz , and installed it as following:

 

cd /root/

wget http://www.openspf.org/blobs/postfix-policyd-spf-perl-2.007.tar.gz

tar xzf postfix-policyd-spf-perl-2.007.tar.gz

cp postfix-policyd-spf-perl-2.007/postfix-policyd-spf-perl /usr/libexec/postfix/

chmod +x /usr/libexec/postfix/postfix-policyd-spf-perl

 

Then I had to add the following text (it is one /single long line) to bottom of /etc/postfix/master.cf :-

 

vi /etc/postfix/master.cf

...

spfpolicy unix - n n - 0 spawn user=nobody argv=/usr/libexec/postfix/postfix-policyd-spf-perl

 

Notes:

  • You can use Tabs instead of spaces in the line above. Refer to INSTALL file which comes with the tarball.
  • The INSTALL file uses the word policy, instead of spfpolicy, as shown here. It does not matter. Whatever you choose to use, make sure that you use the same in master.cf and main.cf files.

 

I then edited my /etc/postfix/main.cf file and added the following text. The text below contains SPF checks, RBL checks, invalid helo checks, invalid host-name checks, etc.

 

vi /etc/postfix/main.cf

. . .

(Change the following line:)

smtpd_sender_restrictions = check_sender_access mysql:/etc/postfix/mysql-virtual_sender.cf

 

(Change to:)

smtpd_sender_restrictions = reject_non_fqdn_sender, reject_unknown_sender_domain, check_sender_access mysql:/etc/postfix/mysql-virtual_sender.cf, permit

 

Note: The line above is single line.

 

(Then add the following text:)

policy_time_limit = 3600smtpd_delay_reject = yes

smtpd_helo_required = yes

smtpd_helo_restrictions = permit_mynetworks, reject_non_fqdn_hostname, reject_invalid_hostname, permit

smtpd_recipient_restrictions = reject_unauth_pipelining, reject_non_fqdn_recipient, reject_unknown_recipient_domain, permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, reject_rbl_client zen.spamhaus.org, reject_rbl_client bl.spamcop.net, check_policy_service unix:private/spfpolicy, permit

 

Note: smtpd_* lines shown above are individual long single lines. (Tip: smtpd_* till permit is one line.)

 

After you save this file, restart postfix service :

 

service postfix restart

 

 

Print Friendly
Filed under: RHEL No Comments
19Feb/120

Oracle Database 10g R2(10.2.0.1) on RHEL5

Posted by Infoaddict

I'll describe the installation of Oracle Database 10g Release 2 (10.2.0.1) on Red Hat Enterprise Linux 5 (RHEL5). The article is based on a server installation similar to this, with a minimum of 2G swap, secure Linux disabled and the following package groups installed.

GNOME Desktop Environment
Editors
Graphical Internet
Text-based Internet
Development Libraries
Development Tools
Legacy Software Development
Server Configuration Tools
Administration Tools
Base
Legacy Software Support
System Tools
X Window System

Alternative installations may require more packages to be loaded, in addition to the ones listed below.

Download Software
Unpack Files
Hosts File
Set Kernel Parameters
Setup
Installation
Post Installation

Download Software

Download the following software.

Oracle Database 10g Release 2 (10.2.0.1) Software

Unpack Files

Unzip the files.

unzip 10201_database_linux32.zip

You should now have a single directory containing installation files. Depending on the age of the download this may either be named "db/Disk1" or "database".
Hosts File

The "/etc/hosts" file must contain a fully qualified name for the server.

<IP-address>  <fully-qualified-machine-name>  <machine-name>

Set Kernel Parameters

Add the following lines to the "/etc/sysctl.conf" file.

#kernel.shmall = 2097152
#kernel.shmmax = 2147483648
kernel.shmmni = 4096
# semaphores: semmsl, semmns, semopm, semmni
kernel.sem = 250 32000 100 128
#fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default=262144
net.core.rmem_max=262144
net.core.wmem_default=262144
net.core.wmem_max=262144

Run the following command to change the current kernel parameters.

/sbin/sysctl -p

Add the following lines to the "/etc/security/limits.conf" file.

*               soft    nproc   2047
*               hard    nproc   16384
*               soft    nofile  1024
*               hard    nofile  65536

Add the following line to the "/etc/pam.d/login" file, if it does not already exist.

session    required     pam_limits.so

Disable secure linux by editing the "/etc/selinux/config" file, making sure the SELINUX flag is set as follows.

SELINUX=disabled

Alternatively, this alteration can be done using the GUI tool (System > Administration > Security Level and Firewall). Click on the SELinux tab and disable the feature.
Setup

Install the following packages.

# From RedHat AS5 Disk 1
cd /media/cdrom/Server
rpm -Uvh setarch-2*
rpm -Uvh make-3*
rpm -Uvh glibc-2*
rpm -Uvh libaio-0*
cd /
eject

# From RedHat AS5 Disk 2
cd /media/cdrom/Server
rpm -Uvh compat-libstdc++-33-3*
rpm -Uvh compat-gcc-34-3*
rpm -Uvh compat-gcc-34-c++-3*
rpm -Uvh gcc-4*
rpm -Uvh libXp-1*
cd /
eject

# From RedHat AS5 Disk 3
cd /media/cdrom/Server
rpm -Uvh openmotif-2*
rpm -Uvh compat-db-4*
cd /
eject

Create the new groups and users.

groupadd oinstall
groupadd dba
groupadd oper

useradd -g oinstall -G dba oracle
passwd oracle

Create the directories in which the Oracle software will be installed.

mkdir -p /u01/app/oracle/product/10.2.0/db_1
chown -R oracle.oinstall /u01

Login as root and issue the following command.

xhost +<machine-name>

Edit the "/etc/redhat-release" file replacing the current release information (Red Hat Enterprise Linux Server release 5 (Tikanga)) with the following:

redhat-4

Login as the oracle user and add the following lines at the end of the ".bash_profile" file.

# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR

ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1; export ORACLE_HOME
ORACLE_SID=TSH1; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH

LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH

if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi

Installation

Log into the oracle user. If you are using X emulation then set the DISPLAY environmental variable.

DISPLAY=<machine-name>:0.0; export DISPLAY

Start the Oracle Universal Installer (OUI) by issuing the following command in the database directory.

./runInstaller

During the installation enter the appropriate ORACLE_HOME and name then continue installation. For a more detailed look at the installation process, click on the links below to see screen shots of each stage.

Select Installation Method
Specify Inventory Directory and Credentials
Select Installation Type
Specify Home Details
Product-Specific Prerequisite Checks
Select Configuration Option
Select Database Configuration
Specify Database Configuration Options
Select Database Management Option
Specify Database Storage Option
Specify Backup and Recovery Options
Specify Database Schema Passwords
Summary
Install
Configuration Assistants
Database Configuration Assistant
Database Configuration Assistant Password Management
Execute Configuration Scripts
End Of Installation

Post Installation

Edit the "/etc/redhat-release" file restoring the original release information.

Red Hat Enterprise Linux Server release 5 (Tikanga)

Edit the "/etc/oratab" file setting the restart flag for each instance to 'Y'.

TSH1:/u01/app/oracle/product/10.2.0/db_1:Y

Print Friendly
Tagged as: , No Comments
19Feb/120

Oracle Database 11g R2(11.2)(64-bit) on Oracle Linux 5 (64-bit)

Posted by Infoaddict

The installation of Oracle Database 11g Release 2 (11.2) (64-bit) on Oracle Linux 5 (64-bit). The article is based on a server installation with a minimum of 2G swap, secure Linux disabled. Oracle recommend a default server installation, but for these installations the following package groups installed:

GNOME Desktop Environment
Editors
Graphical Internet
Text-based Internet
Development Libraries
Development Tools
Server Configuration Tools
Administration Tools
Base
System Tools
X Window System

An example of this type of Linux installations can be seen here. Alternative installations may require more packages to be loaded, in addition to the ones listed below.

Download Software
Unpack Files
Hosts File
Set Kernel Parameters
Setup
Installation
Post Installation

Download Software
Download the following software.

Oracle Database 11g Release 2 (11.2) Software (64-bit)

Unpack Files
Unzip the files.

unzip linux.x64_11gR2_database_1of2.zip
unzip linux.x64_11gR2_database_2of2.zip

You should now have a single directory called "database" containing installation files.
Hosts File
The "/etc/hosts" file must contain a fully qualified name for the server.

<IP-address>  <fully-qualified-machine-name>  <machine-name>

For example.

127.0.0.1       localhost.localdomain  localhost
192.168.2.181   ol5-11gr2.localdomain  ol5-11gr2

Set Kernel Parameters
Oracle recommend the following minimum parameter settings.

fs.suid_dumpable = 1
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586

The current values can be tested using the following command.

/sbin/sysctl -a | grep <param-name>

Add or amend the following lines in the "/etc/sysctl.conf" file.

fs.suid_dumpable = 1
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
# semaphores: semmsl, semmns, semopm, semmni
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default=4194304
net.core.rmem_max=4194304
net.core.wmem_default=262144
net.core.wmem_max=1048586

Run the following command to change the current kernel parameters.

/sbin/sysctl -p

Add the following lines to the "/etc/security/limits.conf" file.

oracle              soft    nproc   2047
oracle              hard    nproc   16384
oracle              soft    nofile  1024
oracle              hard    nofile  65536
oracle              soft    stack   10240

Disable secure linux by editing the "/etc/selinux/config" file, making sure the SELINUX flag is set as follows.

SELINUX=disabled

Alternatively, this alteration can be done using the GUI tool (Applications > System Settings > Security Level). Click on the SELinux tab and disable the feature. If SELinux is disabled after installation, the server will need a reboot for the change to take effect.
Setup
Install the following packages if they are not already present.

# From Oracle Linux 5 DVD
cd /media/cdrom/Server
rpm -Uvh binutils-2.*
rpm -Uvh compat-libstdc++-33*
rpm -Uvh compat-libstdc++-33*.i386.rpm
rpm -Uvh elfutils-libelf*
rpm -Uvh gcc-4.*
rpm -Uvh gcc-c++-4.*
rpm -Uvh glibc-2.*
rpm -Uvh glibc-common-2.*
rpm -Uvh glibc-devel-2.*
rpm -Uvh glibc-headers-2.*
rpm -Uvh ksh*
rpm -Uvh libaio-0.*
rpm -Uvh libaio-devel-0.*
rpm -Uvh libgomp-4.*
rpm -Uvh libgcc-4.*
rpm -Uvh libstdc++-4.*
rpm -Uvh libstdc++-devel-4.*
rpm -Uvh make-3.*
rpm -Uvh sysstat-7.*
rpm -Uvh unixODBC-2.*
rpm -Uvh unixODBC-devel-2.*
rpm -Uvh numactl-devel-2*
cd /
eject

Create the new groups and users.

groupadd oinstall
groupadd dba
groupadd oper
groupadd asmadmin

useradd -g oinstall -G dba,oper,asmadmin oracle
passwd oracle

Note. We are not going to use the "asmadmin" group, since this installation will not use ASM.

Create the directories in which the Oracle software will be installed.

mkdir -p /u01/app/oracle/product/11.2.0/db_1
chown -R oracle:oinstall /u01
chmod -R 775 /u01

Login as root and issue the following command.

xhost +<machine-name>

Login as the oracle user and add the following lines at the end of the ".bash_profile" file.

# Oracle Settings
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR

ORACLE_HOSTNAME=ol5-11gr2.localdomain; export ORACLE_HOSTNAME
ORACLE_UNQNAME=DB11G; export ORACLE_UNQNAME
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1; export ORACLE_HOME
ORACLE_SID=DB11G; export ORACLE_SID
PATH=/usr/sbin:$PATH; export PATH
PATH=$ORACLE_HOME/bin:$PATH; export PATH

LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH

Installation
Log into the oracle user. If you are using X emulation then set the DISPLAY environmental variable:

DISPLAY=<machine-name>:0.0; export DISPLAY

Start the Oracle Universal Installer (OUI) by issuing the following command in the database directory:

./runInstaller

Proceed with the installation of your choice. You can see the type of installation I performed by clicking on the links below to see screen shots of each stage.

Configure Security Updates
Select Install Option
System Class
Node Selection
Select Install Type
Typical Install Configuration
Create Inventory
Perform Prerequisite Checks
Summary
Install Product
Database Configuration Assistant
Database Configuration Assistant 2
Execute Configuration Scripts
Finish

Post Installation

Edit the "/etc/oratab" file setting the restart flag for each instance to 'Y'.

DB11G:/u01/app/oracle/product/11.2.0/db_1:Y

Print Friendly
Tagged as: , No Comments
18Feb/120

Linux Load Balancer of Webserver

Posted by Infoaddict

6 Nodes Load Balancer

Two nodes for LVS (Piranha Pulse nannay Ipvsadm) as Load balancer
Two nodes for Web servers can be multiple upto your requirement.
Two nodes for mysql database server using Drbd & heartbeat for highly avaliable mysql database.

3 types of LoadBalancers
1. Nating
2. Direct Routing
3. Tunneling

CentOS 5.3 is used as Operating System.

In this setup we are using LVS(Linux virtual server) using Direct Routing Method these packages are available on Redhat5.x/CentOs5.x.

We will cover these in few steps.

1 . we will setup basic setup for whole 6 nodes

> Host file configuration (In real network use DNS or both.)
> Ssh key generation (For authentication betwen all 6 nodes)
> NTP Configuration (For time syncronization if possible use dedicated NTP server otherwise 1 node can be used)

2 . We need to configure LVS setup for the two highly available Load balancers. (If one down other will do the same function)

3 . We need to configure web servers for the Load balancing the web service. (Both will have apache php php-mysql php-gd service installaed We also install joomla on both server to check our web and Mysql service working.)

4 . We need to configure Drbd & heartbeat service on two db servers.(Db1 and Db2 will be active passive mode to give highly availabe mysql database service and it's data/databses).

5 . We need to configure joomla on both web server's and make thier connection with mysql databses servers.

1. Basic configurations of all 6 nodes.

On all Nodes. Please copy this file on all servers/nodes

[root@lb1 /]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6

##### IP's of Load Balancers #####
10.0.0.1 lb1.infoaddict.org lb1
10.0.0.2 lb2.infoaddict.org lb2

##### IP's of Web Servers #####
10.0.0.30 www1.infoaddict.org www1
10.0.0.40 www2.infoaddict.org www2

##### IP's of MySQL DB servers #####
10.0.0.50 db1.infoaddict.org db1
10.0.0.51 db2.infoaddict.org db2

########## Here is Virtual IP/Service IP of Webserver and MySQL DB ##########

10.0.0.3 www.infoaddict.org www
10.0.0.190 db.infoaddict.org db

Copy this /etc/hosts file to all the servers

[root@lb1 /]#

Now generate ssh keys

[root@lb1 ~]# ssh-keygen -t rsa

[root@lb1 ~]# ssh-keygen -t dsa

[root@lb1 ~]# cd /root/.ssh/

[root@lb1 ~]# cat *.pub > authorized_keys

[root@lb1 ~]#scp -r /root/.ssh/ lb2:/root/

[root@lb1 ~]#scp -r /root/.ssh/ www1:/root/

[root@lb1 ~]#scp -r /root/.ssh/ www2:/root/

[root@lb1 ~]#scp -r /root/.ssh/ db1:/root/

[root@lb1 ~]#scp -r /root/.ssh/ db2:/root/

[root@lb1 ~]#ssh-keyscan -t dsa lb1 lb2 db1 db2 www1 www2

[root@lb1 ~]#ssh-keyscan -t rsa lb1 lb2 db1 db2 www1 www2

Stop Unwanted services on all nodes.

[root@lb1 ~]# /etc/init/sendmail stop

[root@lb1 ~]# chkconfig --level 235 sendmail off

3. NTP configuration.

Run this command on all nodes & Make sure the ntp is installed on all nodes.

[root@lb1 ~]# rpm -qa | grep ntp
ntp-4.2.2p1-9.el5.centos
chkfontpath-1.10.1-1.1
[root@lb1 ~]#
[root@lb1 ~]# vim /etc/ntp.conf ###Configuration for NTP server###
restrict 127.0.0.1

server 127.127.1.0 # local clock

save & quit
[root@lb1 ~]#
[root@lb1 ~]# /etc/init.d/ntpd restart
Shutting down ntpd: [ OK ]
Starting ntpd: [ OK ]
[root@lb1 ~]#

Clinet side configuration

[root@db2 /]# vim /etc/ntp.conf

#restrict 127.0.0.1
#restrict -6 ::1

server 10.0.0.1 ##Put Server IP here##

#server 0.centos.pool.ntp.org
#server 1.centos.pool.ntp.org
#server 2.centos.pool.ntp.org

#server 127.127.1.0 # local clock
#fudge 127.127.1.0 stratum 10

save & quit

[root@db2 /]# /etc/init.d/ntpd restart
Shutting down ntpd: [ OK ]
Starting ntpd: [ OK ]
[root@db2 /]#

[root@db2 /]#
[root@db2 /]# ntpdate -u 10.0.0.1
16 Jul 11:55:34 ntpdate[12101]: step time server 10.0.0.1 offset -3.069414 sec
[root@db2 /]#

Copy this file /etc/ntp.conf on all 4 nodes .i.e www1 www2 db1 db2 and restart the ntp service on those nodes.

Run this command on all nodes.

[root@db2 /]# ntpdate -u 10.0.0.1

LVS Setup configuration on LB1 and LB2

We need to install Piranha package it will automaticaly instll pulse,ipvsadm,nanny

install piranha on both nodes

[root@lb1 ~]# yum install piranha -y

[root@lb2 ~]# yum install piranha -y

[root@lb1 ~]# vim /etc/sysconfig/ha/lvs.cf

serial_no = 14
primary = 10.0.0.1
service = lvs
rsh_command = ssh
backup_active = 1
backup = 10.0.0.2
heartbeat = 1
heartbeat_port = 1050
keepalive = 2
deadtime = 10
network = direct ### use nat if nating method is used ###
debug_level = NONE
monitor_links = 1
virtual server1 {
active = 1
address = 10.0.0.3 eth0:1
port = 80
send = "GET / HTTP/1.1\r\n\r\n"
expect = "HTTP"
load_monitor = uptime
scheduler = rr
protocol = tcp
timeout = 10
reentry = 180
quiesce_server = 0
server www1 {
address = 10.0.0.30
active = 1
weight = 1
}
server www2 {
address = 10.0.0.40
active = 1
weight = 1
}
}

save & exit

[root@lb1 ~]# scp /etc/sysconfig/ha/lvs.cf lb2:/etc/sysconfig/ha/

[root@lb1 ~]# cat /etc/sysctl.conf

net.ipv4.ip_forward = 1

net.ipv4.conf.eth0.arp_ignore = 1

net.ipv4.conf.all.arp_announce = 2

net.ipv4.conf.eth0.arp_announce = 2

save & exit

[root@lb1 ~]# scp /etc/sysctl.conf lb2:/etc/

Run this command on both nodes

[root@lb1 ~]# [root@lb1 ~]# sysctl -p
net.ipv4.ip_forward = 1
net.ipv4.conf.eth0.arp_ignore = 1
net.ipv4.conf.all.arp_announce = 2
net.ipv4.conf.eth0.arp_announce = 2
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 4294967295
kernel.shmall = 268435456
[root@lb1 ~]#

Before starting service pulse start httpd on both web servers.

[root@www1 ~]#/etc/init.d/httpd start
[root@www1 ~]#/etc/init.d/httpd start

Start pulse service on both lvs/LoadBalancer servers

[root@lb1 ~]# /etc/init.d/pulse start
Starting pulse:
[root@lb1 ~]#

[root@lb1 ~]# /etc/init.d/pulse restart
Shutting down pulse: [ OK ]
Starting pulse: [ OK ]
[root@lb1 ~]# tail -f /var/log/messages
Jul 16 12:24:18 lb1 pulse[6363]: STARTING PULSE AS MASTER
Jul 16 12:24:28 lb1 pulse[6363]: partner dead: activating lvs
Jul 16 12:24:28 lb1 avahi-daemon[2940]: Registering new address record for 10.0.0.3 on eth0.
Jul 16 12:24:28 lb1 lvs[6367]: starting virtual service server1 active: 80
Jul 16 12:24:28 lb1 nanny[6376]: starting LVS client monitor for 10.0.0.3:80
Jul 16 12:24:28 lb1 lvs[6367]: create_monitor for server1/www1 running as pid 6376
Jul 16 12:24:28 lb1 nanny[6377]: starting LVS client monitor for 10.0.0.3:80
Jul 16 12:24:28 lb1 lvs[6367]: create_monitor for server1/www2 running as pid 6377
Jul 16 12:24:28 lb1 nanny[6376]: [ active ] making 10.0.0.30:80 available
Jul 16 12:24:28 lb1 nanny[6377]: [ active ] making 10.0.0.40:80 available
Jul 16 12:24:33 lb1 pulse[6369]: gratuitous lvs arps finished

it seems good now our pulse is working fine.

3. Web servers configuration On both servers.

[root@www1 ~]# yum install httpd php php-mysql php-gd

[root@www1 ~]# yum install arptables_jf

[root@www1 ~]#echo "Load Balancing" > /var/www/html/test.html

[root@www2 ~]#echo "Load Balancing1" > /var/www/html/test.html

For both server we need to configure the Loopback interface

[root@www1 ~]# vim /etc/sysconfig/network-scripts/ifcfg-lo:0
DEVICE=lo:0
IPADDR=10.0.0.3
NETMASK=255.255.255.255
NETWORK=10.0.0.0
# If you're having problems with gated making 127.0.0.0/8 a martian,
# you can change this to something else (255.255.255.255, for example)
BROADCAST=10.255.255.255
ONBOOT=yes
NAME=loopback
[root@www1 ~]#
[root@www1 ~]#ifup lo:0

[root@www2 ~]# vim /etc/sysconfig/network-scripts/ifcfg-lo:0
DEVICE=lo:0
IPADDR=10.0.0.3
NETMASK=255.255.255.255
NETWORK=10.0.0.0
# If you're having problems with gated making 127.0.0.0/8 a martian,
# you can change this to something else (255.255.255.255, for example)
BROADCAST=10.255.255.255
ONBOOT=yes
NAME=loopback
[root@www2 ~]#
[root@www2 ~]# ifup lo:0

on both real servers

[root@www1 ~]#arptables -A IN -d 10.0.0.3 -j DROP
[root@www1 ~]#arptables -A OUT -d 10.0.0.3 -j mangle --mangle-ip-s 10.0.0.1
[root@www1 ~]#arptables -A OUT -d 10.0.0.3 -j mangle --mangle-ip-s 10.0.0.2
[root@www1 ~]#
[root@www1 ~]# /etc/init.d/arptables_jf save
Saving current rules to /etc/sysconfig/arptables: [ OK ]
[root@www1 ~]#

[root@www2 ~]#arptables -A IN -d 10.0.0.3 -j DROP
[root@www2 ~]#arptables -A OUT -d 10.0.0.3 -j mangle --mangle-ip-s 10.0.0.1
[root@www2 ~]#arptables -A OUT -d 10.0.0.3 -j mangle --mangle-ip-s 10.0.0.2
[root@www2 ~]# /etc/init.d/arptables_jf save
Saving current rules to /etc/sysconfig/arptables: [ OK ]
[root@www2 ~]#

We need to tell system to up lo:0 every time at boot.

[root@www1 ~]# echo "ifup lo:0" > /etc/rc.local
[root@www2 ~]# echo "ifup lo:0" > /etc/rc.local

Here we need to test the setup is working fine here we have two lvs and webservers

this command will show about the connections.

[root@lb1 ~]# ipvsadm -L
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
TCP www.infoaddict.org:ht rr
-> www2.infoaddict.org:h Route 1 0 0
-> www1.infoaddict.org:h Route 1 0 0
[root@lb1 ~]#

[root@lb1 ~]# watch ipvsadm -Lcn

Configuration of Drbd & Heartbeat on Both database servers

Here we need to configure partitions on both servers

PARTITION SETUP On Both Servers.

Partion setup on both server identical same with fdisk

We have 4GB disks on both servers.

Partition Setup for Cluster Servers

We need to create LVM partition

[root@db1 ~]# fdisk -l

[root@db1 ~]# fdisk /dev/sdb

[root@db1 ~]# fdisk /dev/sd
sda sda1 sda2 sdb sdb1
[root@db2 ~]# fdisk /dev/sdb

Command (m for help): m
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)

Command (m for help): p

Disk /dev/sdb: 4294 MB, 4294967296 bytes
255 heads, 63 sectors/track, 522 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 1 522 4192933+ 8e Linux LVM

Command (m for help): d
Selected partition 1

Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-522, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-522, default 522): +4000M

Command (m for help): p

Disk /dev/sdb: 4294 MB, 4294967296 bytes
255 heads, 63 sectors/track, 522 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 1 487 3911796 83 Linux

Command (m for help): t
Selected partition 1
Hex code (type L to list codes): 8e
Changed system type of partition 1 to 8e (Linux LVM)

Command (m for help): p

Disk /dev/sdb: 4294 MB, 4294967296 bytes
255 heads, 63 sectors/track, 522 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 1 487 3911796 8e Linux LVM

Command (m for help):

Command (m for help): w

[root@db1 ~]# partprobe

Create Physical Volume for LVM this is second step for LVM partition.

[root@db1 ~]# pvcreat /dev/sdb1 /dev/sdb2

Create Volume Group with this command

[root@db1 ~]# vgcreate vgdb /dev/sdb1

Create Logical volume partition

[root@db1 ~]# lvcreate -L +1000M -n /dev/mapper/vgdb/lvdb
[root@db1 ~]# lvcreate -L +256M -n /dev/mapper/vgdb/lvmeta

Note: Create LVM on Both servers identical same ...................

install drbd and configure it.

[root@db1 ~]# yum install drbd82 kmod-drbd82 -y

[root@db2 ~]# yum install drbd82 kmod-drbd82 -y

[root@db1 ~]modprobe drbd

[root@db2 ~]modprobe drbd

[root@db1 ~]echo "modprobe drbd" > /etc/rc.local

[root@db2 ~]echo "modprobe drbd" > /etc/rc.local

[root@db1 ~]#vim /etc/drbd.conf

global {
usage-count yes;
}

common {
syncer { rate 10M; }
}

resource r0 {
protocol C;
handlers {
pri-on-incon-degr "echo o > /proc/sysrq-trigger ; halt -f";
pri-lost-after-sb "echo o > /proc/sysrq-trigger ; halt -f";
local-io-error "echo o > /proc/sysrq-trigger ; halt -f";
outdate-peer "/usr/lib/heartbeat/drbd-peer-outdater -t 5";
}

startup {
}

disk {
on-io-error detach;
}

net {
after-sb-0pri disconnect;
after-sb-1pri disconnect;
after-sb-2pri disconnect;
rr-conflict disconnect;
}

syncer {
rate 10M;
al-extents 257;
}

on db1.infoaddict.org {
device /dev/drbd0;
disk /dev/vgdb/lvdb;
address 10.0.0.50:7788;
meta-disk /dev/vgdb/lvmeta[1];
}

on db2.infoaddict.org {
device /dev/drbd0;
disk /dev/vgdb/lvdb;
address 10.0.0.51:7788;
meta-disk /dev/vgdb/lvmeta[1];
}

}

save & exit

[root@db1 ~]#scp /etc/drbd.conf lb2:/etc/
[root@db1 ~]#vi /etc/sysctl.conf

net.ipv4.conf.eth0.arp_ignore = 1

net.ipv4.conf.all.arp_announce = 2

net.ipv4.conf.eth0.arp_announce = 2

save & quit

[root@db1 ~]# sysctl -p
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.eth0.arp_ignore = 1
net.ipv4.conf.all.arp_announce = 2
net.ipv4.conf.eth0.arp_announce = 2
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 4294967295
kernel.shmall = 268435456
[root@db1 ~]#

save it........

[root@db1 ~]#
[root@db1 ~]# scp /etc/drbd.conf db2:/etc/drbd.conf

We need to run module on both servers to run drbd

Load DRBD module both nodes:

[root@db1 ~]# modprobe drbd

[root@db1 ~]# echo "modprobe drbd" >> /etc/rc.local

[root@db2 ~]# modprobe drbd

[root@db2 ~]# echo "modprobe drbd"  >> /etc/rc.local

##### run this on both servers ######

[root@db1 ~]#drbdadm create-md r0

[root@db2 ~]#drbdadm create-md r0

[root@db1 ~]#drbdadm attach r0

[root@db2 ~]#drbdadm attach r0

[root@db1 ~]#drbdadm syncer r0

[root@db2 ~]#drbdadm syncer r0

[root@db1 ~]#drbdadm connect r0

[root@db2 ~]#drbdadm connect r0

On Primary Node only

[root@db1 ~]#drbdadm -- --overwrite-data-of-peer primary r0

On both Nodes:

[root@db1 ~]#drbdadm up all

[root@db2 ~]#drbdadm up all

On Primary Node only

[root@db1 ~]#drbdadm -- primary all #### ON Node one Only ####

[root@db1 ~]#watch cat /proc/drbd

only on db1 ########## Primary Node ########

[root@db1 ~]#mkfs.ext3 /dev/drbd0

[root@db1 ~]#mkdir /data/

[root@db1 ~]#mount /dev/drbd0 /data/

[root@db1 ~]#
[root@db1 ~]# df -hk
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
5967432 2625468 3033948 47% /
/dev/sda1 101086 12074 83793 13% /boot
tmpfs 257720 0 257720 0% /dev/shm
/dev/drbd0 4031516 107600 3719128 3% /data
[root@db1 ~]#
[root@db1 ~]# umount /dev/drbd0 /data

Note: HeartBeat will automatically handle this.

On db2 ####### Secondry Node #######

[root@db2 ~]#mkdir /data

Heartbeat Setup:
================

Install heartbeat package using yum

Note: Internet connection is required or configure yum repository on your local machine with extras.

[root@db1 ~]#yum install -y heartbeat heartbeat-pils heartbeat-stonith heartbeat-devel

[root@db1 ~]#vim /etc/ha.d/ha.cf ## Create this file and copy this text ##

logfacility local0
keepalive 2
#deadtime 30 # USE THIS!!!
deadtime 10
# we use two heartbeat links, eth2 and serial 0
bcast eth0
#serial /dev/ttyS0
baud 19200
auto_failback off
node db1.infoaddict.org
node db2.infoaddict.org

save & quit.

Server db1

[root@db1 ~]#vi /etc/ha.d/haresources

db1 IPaddr::10.0.0.190/8/eth0 drbddisk::r0 Filesystem::/dev/drbd0::/data::ext3 mysql

Server db2:

[root@db2 ~]#vi /etc/ha.d/haresources

db2 IPaddr::10.0.0.190/8/eth0 drbddisk::r0 Filesystem::/dev/drbd0::/data::ext3  mysql

On Both Servers:

[root@db1 ~]#vi /etc/ha.d/authkeys

auth 3
3 md5 redhat ######### Use Long name as password #########

both NODE:

[root@db1 ~]#chmod 600 /etc/ha.d/authkeys

[root@db1 ~]#scp /etc/ha.d/authkeys db2:/etc/ha.d/authkeys

[root@db1 ~]#chkconfig --level 235 heartbeat on

Note: if you have problem mounting /dev/drbd0 on /data then run these commands to check the status if you found the drbddisk stopped then start it.

Mysql Configuration.

cp /etc/my.cnf /etc/my.cnf.orig

vi /etc/my.cnf

[mysqld]
# datadir=/var/lib/mysql
datadir=/data/mysql
#socket=/var/lib/mysql/mysql.sock
socket=/data/mysql/mysql.sock
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1

[mysql.server]
user=mysql
#basedir=/var/lib
basedir=/data

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

[mysql]
socket=/data/mysql/mysql.sock

Now it is time to add users/hosts to mysql server:

mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'10.0.0.30' IDENTIFIED BY 'redhat'
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'10.0.0.40' IDENTIFIED BY 'redhat'
mysql> FLUSH PRIVILEGES;

mysql>quit

Now we need to install joomla on both web servers

On Webserver 1

[root@www1 /]# yum install php php-mysql php-gd -y

[root@www1 ~]# ls
anaconda-ks.cfg Desktop install.log install.log.syslog Joomla_1.5.13-Stable-Full_Package
[root@www1 ~]# cd Joomla_1.5.13-Stable-Full_Package/
[root@www1 Joomla_1.5.13-Stable-Full_Package]# ls
[root@www1 Joomla_1.5.13-Stable-Full_Package]# cp -avr * /var/www/html/

[root@www1 Joomla_1.5.13-Stable-Full_Package]# cd /var/www/html/
[root@www1 html]# ls
[root@www1 html]# cd ..
[root@www1 www]# ls
cgi-bin error html icons
[root@www1 www]# chown apache:apache html/ -R
[root@www1 www]#
[root@www1 www]# ls
cgi-bin error html icons
[root@www1 www]# cd html/
[root@www1 html]# ll
[root@www1 html]#

Now open internet explorer then open
http://10.0.0.30

Install Joomla follow the steps and give required information.

In Database section give

Host 10.0.0.190 IP use MySQL as database.
user root
passwdor redhat
database joomla

Must check install sample data.

Copy all the joomla code on www2

[root@www1 html]# scp -r * www2:/var/www/html/

We need to open this file and edit it on line 391 add index.php

[root@www1 html]#vim /etc/httpd/conf/httpd.conf

DirectoryIndex index.html index.html.var index.php

save & quit

[root@www1 /]#
[root@www1 ~]# scp /etc/httpd/conf/httpd.conf www2:/etc/httpd/conf/
httpd.conf 100% 33KB 32.9KB/s 00:00
[root@www1 ~]#
[root@www1 ~]# /etc/init.d/httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
[root@www1 ~]#

On Web Server 2
[root@www2 html]# chown apache:apache * -R
[root@www2 html]# ll
[root@www2 /]# yum install php php-mysql php-gd -y

[root@www2 ~]# /etc/init.d/httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
[root@www2 ~]#

Remeber that each machine(LVS+Real) must have default gw the ip of router connected to these servers

[root@www1 ~]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
10.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 eth0
0.0.0.0 10.0.0.20 0.0.0.0 UG 0 0 0 eth0
[root@www1 ~]#

Now you can test all the network by accessing web on http://10.0.0.3 or http://www.infoaddict.org/

[root@lb1 ~]# ipvsadm -L
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
TCP www.infoaddict.org:ht rr
-> www2.infoaddict.org:h Route 1 0 0
-> www1.infoaddict.org:h Route 1 0 0
[root@lb1 ~]#

[root@lb1 ~]# watch ipvsadm -Lcn

Print Friendly
Tagged as: , , No Comments
18Feb/120

Configuration of DNS (Bind) server in chroot environment

Posted by Infoaddict

OS CentOS 5.4 X86_64
-------------------------------------
Please Install the bind packages
-------------------------------------
[root@ns1 ~]# yum install bind bind-utils bind-*
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * addons: virror.hanoilug.org
 * extras: ftp.hostrino.com
 * updates: ftp.hostrino.com
addons                                                                                                                                                     |  951 B     00:00
extras                                                                                                                                                     | 1.1 kB     00:00
ftp                                                                                                                                                        | 2.1 kB     00:00
updates                                                                                                                                                    | 1.9 kB     00:00
updates/primary_db                                                                                                                                         | 444 kB     00:00
Setting up Install Process
Package 30:bind-9.3.6-4.P1.el5_4.1.x86_64 already installed and latest version
Package 30:bind-utils-9.3.6-4.P1.el5_4.1.x86_64 already installed and latest version
Package 30:bind-sdb-9.3.6-4.P1.el5_4.1.x86_64 already installed and latest version
Package 30:bind-chroot-9.3.6-4.P1.el5_4.1.x86_64 already installed and latest version
Package 30:bind-devel-9.3.6-4.P1.el5_4.1.x86_64 already installed and latest version
Package 30:bind-devel-9.3.6-4.P1.el5_4.1.i386 already installed and latest version
Package 30:bind-libs-9.3.6-4.P1.el5_4.1.x86_64 already installed and latest version
Package 30:bind-libs-9.3.6-4.P1.el5_4.1.i386 already installed and latest version
Package 30:bind-9.3.6-4.P1.el5_4.1.x86_64 already installed and latest version
Package 30:bind-utils-9.3.6-4.P1.el5_4.1.x86_64 already installed and latest version
Package 30:bind-libbind-devel-9.3.6-4.P1.el5_4.1.x86_64 already installed and latest version
Package 30:bind-libbind-devel-9.3.6-4.P1.el5_4.1.i386 already installed and latest version
Nothing to do
----------------------------------------------
Please Configure Static IP and Default Gateway
----------------------------------------------
[root@ns1 ~]#  vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
IPADDR=192.168.150.100
NETMASK=255.255.255.0
ONBOOT=yes
HWADDR=00:16:36:73:7e:4f
wq!
[root@ns1 ~]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:16:36:73:7E:4F
          inet addr:192.168.150.100  Bcast:192.168.150.255  Mask:255.255.255.0
          inet6 addr: fe80::216:36ff:fe73:7e4f/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1641 errors:0 dropped:0 overruns:0 frame:0
          TX packets:950 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:192907 (188.3 KiB)  TX bytes:117111 (114.3 KiB)
lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:105 errors:0 dropped:0 overruns:0 frame:0
          TX packets:105 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:10213 (9.9 KiB)  TX bytes:10213 (9.9 KiB)
[root@ns1 ~]#
[root@ns1 ~]# vi /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=dns.company.xy
GATEWAY=192.168.150.1
wq!
--------------------------------------------------------------------------------------------------------------------
Now we are going to configure the Bind service  please copy the files content and modify with your network settings
--------------------------------------------------------------------------------------------------------------------
[root@ns1 ~]#
[root@ns1 ~]# cd /var/named/chroot/
[root@ns1 chroot]# ll
total 24
drwxr-x---  2 root named 4096 Dec  1 00:00 dev
drwxr-x---  2 root named 4096 Jan  4 04:42 etc
dr-xr-xr-x 85 root root     0 Jan 11 22:41 proc
drwxr-x---  6 root named 4096 Dec  1 00:00 var
[root@ns1 chroot]#
-------------------------------
Now create zone file named.conf
-------------------------------
[root@ns1 chroot]#  vi etc/named.conf
options
{
        directory "/var/named"; // the default
        dump-file               "data/cache_dump.db";
        statistics-file         "data/named_stats.txt";
        memstatistics-file      "data/named_mem_stats.txt";
};
zone "." IN {
        type hint;
        file "named.root";
};
zone "localhost" IN {
        type master;
        file "localhost.fwd";
        allow-update { none; };
};
zone "0.0.127.in-addr.arpa" IN {
        type master;
        file "localhost.rev";
        allow-update { none; };
};
zone "company.xy" IN {
        type master;
        file "company.xy.fwd";
        allow-update { none; };
};
zone "1.168.192.in-addr.arpa" IN {
        type master;
        file "company.xy.rev";
        allow-update { none; };
};
 wq!
[root@ns1 chroot]# cd var/named
[root@ns1 named]#
--------------------------
Now create named.root file
--------------------------
[root@ns1 named]#
First We confiure named.root file for root dns
[root@ns1 named]# vi named.root
.                       6D  IN      NS      A.ROOT-SERVERS.NET.
.                       6D  IN      NS      B.ROOT-SERVERS.NET.
.                       6D  IN      NS      C.ROOT-SERVERS.NET.
.                       6D  IN      NS      D.ROOT-SERVERS.NET.
.                       6D  IN      NS      E.ROOT-SERVERS.NET.
.                       6D  IN      NS      F.ROOT-SERVERS.NET.
.                       6D  IN      NS      G.ROOT-SERVERS.NET.
.                       6D  IN      NS      H.ROOT-SERVERS.NET.
.                       6D  IN      NS      I.ROOT-SERVERS.NET.
.                       6D  IN      NS      J.ROOT-SERVERS.NET.
.                       6D  IN      NS      K.ROOT-SERVERS.NET.
.                       6D  IN      NS      L.ROOT-SERVERS.NET.
.                       6D  IN      NS      M.ROOT-SERVERS.NET.
A.ROOT-SERVERS.NET.     6D  IN      A       198.41.0.4
B.ROOT-SERVERS.NET.     6D  IN      A       192.228.79.201
C.ROOT-SERVERS.NET.     6D  IN      A       192.33.4.12
D.ROOT-SERVERS.NET.     6D  IN      A       128.8.10.90
E.ROOT-SERVERS.NET.     6D  IN      A       192.203.230.10
F.ROOT-SERVERS.NET.     6D  IN      A       192.5.5.241
G.ROOT-SERVERS.NET.     6D  IN      A       192.112.36.4
H.ROOT-SERVERS.NET.     6D  IN      A       128.63.2.53
I.ROOT-SERVERS.NET.     6D  IN      A       192.36.148.17
J.ROOT-SERVERS.NET.     6D  IN      A       192.58.128.30
K.ROOT-SERVERS.NET.     6D  IN      A       193.0.14.129
L.ROOT-SERVERS.NET.     6D  IN      A       199.7.83.42
M.ROOT-SERVERS.NET.     6D  IN      A       202.12.27.33
wq!
----------------------------------------------------------------------------------------------------------------------------------
Now create zone db files one by one  localhost.fwd and the localhost.rev are must then your network zone files forward and reverse
----------------------------------------------------------------------------------------------------------------------------------
[root@ns1 named]# vi localhost.fwd
$ORIGIN localhost.
$TTL    86400
@        IN     SOA     ns1.company.xy.  ns1.company.xy. (
                                20100104      ; Serial number
                                3H            ; Refresh     1 day
                                15M           ; Retry       2 hours
                                1W            ; Expire      41.67 days
                                1D  )         ; Minimum TTL 2 days
@       IN      NS      dns.company.xy.
localhost.              IN      A       127.0.0.1
wq!     ##### Save the file after copying the content from here. #####
[root@ns1 named]# vi localhost.rev
$ORIGIN 0.0.127.in-addr.arpa.
$TTL    86400
@        IN     SOA     ns1.company.xy.  ns1.company.xy. (
                                20100104      ; Serial number
                                3H            ; Refresh     1 day
                                15M           ; Retry       2 hours
                                1W            ; Expire      41.67 days
                                1D  )         ; Minimum TTL 2 days
@       IN      NS      ns1.company.xy.
1.0.0.127.in-addr.arpa. IN      PTR     localhost.
wq!
[root@ns1 named]# vi company.xy.fwd
$ORIGIN company.xy.
$TTL    86400
@        IN     SOA     ns1.company.xy.  ns1.company.xy. (
                                20100104      ; Serial number
                                3H            ; Refresh     1 day
                                15M           ; Retry       2 hours
                                1W            ; Expire      41.67 days
                                1D  )         ; Minimum TTL 2 days
@       IN      NS      ns1.company.xy.
ns1.company.xy.         IN      A       192.168.150.254
ftp.company.xy.         IN      A       192.168.150.101
www.company.xy.         IN      A       192.168.150.102
client3.company.xy.         IN      A       192.168.150.103
client4.company.xy.         IN      A       192.168.150.104
wq!
[root@ns1 named]# vi company.xy.rev
$ORIGIN 1.168.192.in-addr.arpa.
$TTL    86400
@        IN     SOA     ns1.company.xy.  root.company.xy. (
                                20100104      ; Serial number
                                3H            ; Refresh     1 day
                                15M           ; Retry       2 hours
                                1W            ; Expire      41.67 days
                                1D  )         ; Minimum TTL 2 days
@       IN      NS      ns1.company.xy.
254.150.168.192.in-addr.arpa.     IN      PTR     ns1.company.xy.
101.150.168.192.in-addr.arpa.     IN      PTR     ftp.company.xy.
102.150.168.192.in-addr.arpa.     IN      PTR     www.company.xy.
103.150.168.192.in-addr.arpa.     IN      PTR     client1.company.xy.
104.150.168.192.in-addr.arpa.     IN      PTR     clinet2.company.xy.
wq!
[root@ns1 ~]# vi /etc/resolv.conf
search company.xy
nameserver 192.168.150.254
wq!
-----------------------------------------------------------------
Configuration has been done now start "/etc/init.d/named" service
-----------------------------------------------------------------
[root@ns1 ~]# /etc/init.d/named start
Starting named:                                            [  OK  ]
[root@ns1 ~]# dig yahoo.com
; <<>> DiG 9.3.6-P1-RedHat-9.3.6-4.P1.el5_4.1 <<>> yahoo.com
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 46559
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 7, ADDITIONAL: 2
;; QUESTION SECTION:
;yahoo.com.                     IN      A
;; ANSWER SECTION:
yahoo.com.              21600   IN      A       209.191.93.53
yahoo.com.              21600   IN      A       69.147.114.224
yahoo.com.              21600   IN      A       209.131.36.159
;; AUTHORITY SECTION:
yahoo.com.              172800  IN      NS      ns1.yahoo.com.
yahoo.com.              172800  IN      NS      ns2.yahoo.com.
yahoo.com.              172800  IN      NS      ns3.yahoo.com.
yahoo.com.              172800  IN      NS      ns4.yahoo.com.
yahoo.com.              172800  IN      NS      ns5.yahoo.com.
yahoo.com.              172800  IN      NS      ns6.yahoo.com.
yahoo.com.              172800  IN      NS      ns8.yahoo.com.
;; ADDITIONAL SECTION:
ns6.yahoo.com.          172800  IN      A       202.43.223.170
ns8.yahoo.com.          172800  IN      A       202.165.104.22
;; Query time: 643 msec
;; SERVER: 192.168.150.100#53(192.168.150.100)
;; WHEN: Tue Jan 12 03:01:01 2010
;; MSG SIZE  rcvd: 233
[root@ns1 ~]#
--------------------------------------------------
Now please open ports for named server for network
--------------------------------------------------
[root@ns1 ~]# iptables -A INPUT -p tcp -m multiport --dport 53,953 -j ACCEPT
[root@ns1 ~]# iptables -A INPUT -p udp -m multiport --dport 53,953 -j ACCEPT
[root@ns1 ~]#
[root@ns1 ~]# /etc/init.d/iptables save
Saving firewall rules to /etc/sysconfig/iptables:          [  OK  ]
[root@ns1 ~]#
[root@ns1 ~]# dig ns1.company.xy
; <<>> DiG 9.3.6-P1-RedHat-9.3.6-4.P1.el5_4.1 <<>> ns1.company.xy
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 29732
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 0
;; QUESTION SECTION:
;ns1.company.xy.            IN      A
;; ANSWER SECTION:
ns1.company.xy.     86400   IN      A       192.168.150.100
;; AUTHORITY SECTION:
company.xy.         86400   IN      NS      ns1.company.xy.
;; Query time: 1 msec
;; SERVER: 192.168.150.100#53(192.168.150.100)
;; WHEN: Tue Jan 12 03:13:33 2010
;; MSG SIZE  rcvd: 66
[root@ns1 ~]#
[root@ns1 ~]# dig www.company.xy
; <<>> DiG 9.3.6-P1-RedHat-9.3.6-4.P1.el5_4.1 <<>> www.company.xy
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 10800
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1
;; QUESTION SECTION:
;www.company.xy.            IN      A
;; ANSWER SECTION:
www.company.xy.     86400   IN      A       192.168.150.102
;; AUTHORITY SECTION:
company.xy.         86400   IN      NS      ns1.company.xy.
;; ADDITIONAL SECTION:
ns1.company.xy.     86400   IN      A       192.168.150.100
;; Query time: 1 msec
;; SERVER: 192.168.150.100#53(192.168.150.100)
;; WHEN: Tue Jan 12 03:14:09 2010
;; MSG SIZE  rcvd: 86
[root@ns1 ~]#
We have configured proper bind server on  CentOs 5.4
Note:Please install bind packages and then  copy the files text from this configuration  and paste to your server.
Also modify the settings as per your network machine names and their IP's.
Print Friendly
Tagged as: No Comments
18Feb/120

KVM in the CentOS 5.4 – How to fixing bridge Problem

Posted by Infoaddict

When we use KVM in CentOS 5.4 we will notice that there is no bridge setup to allow your virtual guests to directly connect to the local network.
We need to do so simple steps to fix it.

As we are using libvirt,
We need to follwo steps below to fix it.

Step 1: Create the bridge script at /etc/sysconfig/network-scripts/ifcfg-br0

[root@babar /root]# vi /etc/sysconfig/network-scripts/ifcfg-br0

DEVICE=br0
BOOTPROTO=static
TYPE=Bridge
IPADDR=192.168.0.100
NETMASK=255.255.255.0
ONBOOT=yes
NM_CONTROLLED=no

Save & exit

As you can see, I use static IP config.

Step 2: hook up eth0 to the bridge and remove it’s IP config in /etc/sysconfig/network-scripts/ifcfg-eth0

[root@babar /root]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth1
BOOTPROTO=none
ONBOOT=yes
BRIDGE=br0
NM_CONTROLLED=no
TYPE=Ethernet

Please restart the network service or your system and you will done. Now create a new virtual machine with virt-manager,we can select to have it directly hooked up to the physical network.

[root@babar ~]# ifconfig
br0 Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:xx
inet addr:192.168.0.100 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::215:17ff:febd:c94d/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:168 errors:0 dropped:0 overruns:0 frame:0
TX packets:33 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:11475 (11.2 KiB) TX bytes:9580 (9.3 KiB)

eth0 Link encap:Ethernet HWaddr 00:xx:xx:xx:xx:xx
inet addr:192.168.1.253 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::215:17ff:febd:c94c/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3240 errors:0 dropped:0 overruns:0 frame:0
TX packets:5286 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:417544 (407.7 KiB) TX bytes:5574477 (5.3 MiB)
Memory:b1a20000-b1a40000

eth1 Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:xx
inet6 addr: fe80::215:17ff:febd:c94d/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:9113 errors:0 dropped:0 overruns:0 frame:0
TX packets:122 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:755212 (737.5 KiB) TX bytes:27911 (27.2 KiB)
Memory:b1a00000-b1a20000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:969 errors:0 dropped:0 overruns:0 frame:0
TX packets:969 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:2744681 (2.6 MiB) TX bytes:2744681 (2.6 MiB)

virbr0 Link encap:Ethernet HWaddr 00:00:00:00:00:00
inet addr:192.168.122.1 Bcast:192.168.122.255 Mask:255.255.255.0
inet6 addr: fe80::200:ff:fe00:0/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:52 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:9535 (9.3 KiB)

vnet0 Link encap:Ethernet HWaddr A2:F7:06:6D:C1:2F
inet6 addr: fe80::a0f7:6ff:fe6d:c12f/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:57 errors:0 dropped:0 overruns:0 frame:0
TX packets:1035 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:9782 (9.5 KiB) TX bytes:208709 (203.8 KiB)

Now it is working fine.

Print Friendly
Tagged as: No Comments