apache high availability cluster in debian - Linux Discussion Forum, Subversion, Apache, Polls, Blogs, Kernel, Debian, Redhat, Kernel compilation, News, Tutorials, Linux initrd, Video and text tutorials, Open source development

Newsflash

Download NFSP!

Home  Welcome to the gateway of open source world's encyclopedia. Find everything ranging from tutorials, Linux discussion forums, blogs to  practical guide to solution implementation here! Further, you have a treasure trove of all open source products like qmail, Gallery, Joomla, sendmail, DNS, LDAP, Apache, Tomcat to name few.Advantageous Open Source The primary reasons why substantial percentage of servers run on Linux are the easy accessibility to source code for modification and no hinges on way the software  can be used. Hence, the baseline is the flexibility with stability. Addditionaly, there is no dependency on an individual or a company to sustain the enhancements - it is an open source platform and improvisations are by assorted individuals or groups.Plus the benfits related to the per copy fees and no restrictions to create alternative code from base code further enhances the attractiveness. Result is today 70% of the web servers are Linux based !Web Design/Web Development Open Source offer a full range of web design services with template engine like smarty.  Website design nowadays is very simple task in open source like an analysis of your website, sell products, call in to the office, retrieve emails, join book clubs, information portals, forum, mailling list, blogs or company web site (Intranet) etc. Linux forum can provide quick response and provide full support to solves your business problems until your problem resolved. Software Development, Software Design, Database DesignMiilions of developers are  optimize the business processes through the use of current and proven technologies and databases like php,python, mysql etc. Expert open source team has developed software like sugarcrm, apache,bind,nis,nfs,linux,debian,php and countless products  Details...

opensource.gif, 18 kB
Home arrow Tutorials arrow Text Tutorials arrow apache high availability cluster in debian
apache high availability cluster in debian PDF Print E-mail

This is the tutorials  of setup the high availability server of   apache. If you find anything incomplete or not working in the setup, Please open a forum in http://opensourcedevelopment.net/forum. 

Please be patient in setup, It will take long time to setup and after that you can add as many as server you want in Cluster. The below setup is only basic installation of apache , HA  and NFS.

This is tested in Debian with latest packages of Apache, HA and NFS.

 Basic Packages.

 apt-get install make

apt-get install gcc   

apt-get install ssh 

 nstall HeartBeat

Open file in  VI Editor /etc/apt/sources.list

 vi /etc/apt/sources.list

 Add the following lines

deb http://www.ultramonkey.org/download/3/ sarge main

deb-src http://www.ultramonkey.org/download/3 sarge main

 Save the file

Run the below lines

 pt-get update

 Install Heartbeat

apt-get install ultramonkey

 Change the directory to heartbeat

cd /usr/share/doc/heartbeat

 Ungip ha.cf.gz and haresources.gz

 gunzip ha.cf.gz

gunzip haresources.gz

 Copy haresources and ha.cf and authkeys in /ec/ha.d

 cp haresources /etc/ha.d/

cp ha.cf /etc/ha.d/

cp authkeys /etc/ha.d/

 Install Apache2

 apt-get install apache2

 Edit hosts file

 i /etc/hosts

192.168.1.1 node1.example.com    node1

192.168.1.2 node2.example.com    node2

 
vi /etc/ha.d/ha.cf

 Uncomment line number 33

logfile /var/log/ha-log

 Uncomment line number 52

keepalive 2

 Uncomment line number 60

deadtime 30

 Uncomment line number 65

warntime 10

 Uncomment line number  75

initdead 120

 Uncomment line number  80

udpport 694

 Uncomment line number 94

bcast   eth0            # Linux

Please change eth0 to your second network card like eth1; Mine is eth1

 uncomment line 124

ucast eth1 10.0.0.1

10.0.0.1

 uncomment line 214 and 215

Add Your first and second node

node    ken3

node    kathy

and change name ken3 and kathy to node1.example.com and node2.example.com resp.

 vi /etc/ha.d/haresources

node1.example.com 192.168.1.5 apache2

 scp /etc/ha.d/haresources node2:/etc/ha.d/

 In both machines

 chmod 600 /etc/ha.d/authkeys

 vi /etc/ha.d/authkeys

uncomment line 23 and 24

auth 1

1 crc
add network card 10.0.0.1 in node1

add network card 10.0.0.2 in node2

 Now test Heartbeat

 etc/init.d/heartbeat start

 Hope, You your website working on IP 192.168.1.5.

Section-2

 Install NFS

Making your computer an NFS server or client is very easy.

A Debian  client node1 and node2  needs

apt-get install nfs-common portmap

For server (192.168.1.10)

apt-get install nfs-kernel-server nfs-common portmap

 vi /etc/hosts

Add

192.168.1.1 node1.example.com    node1

192.168.1.2 node2.example.com    node2

 in NFS Machine

mkdir /data

vi /etc/exports

/data node1.example.com(rw,no_root_squash) node2.example.com(rw,no_root_squash)

 In both node1 and node2

vi /etc/fstab

add

 nfs.example.com:/data       /data nfs rw 0 0

 In both machines  add

192.168.37.125 nfs.example.com      nfs

in /etc/hosts

 vi /etc/apache2/sites-available/default

 Change default DocumentRoot in line 5, Inplace of  /var/www  add  /data

and restart the apache server

/etc/init.d/apache2 restart

 Copy your documents in /data folder

Its done.

Now apache is in cluster. If you face any issue please open in forum http://forum.opensourcedevelopment.net or send-mail :- This e-mail address is being protected from spam bots, you need JavaScript enabled to view it  

 
< Prev   Next >
91797 Visitors
© 2008 Linux Discussion Forum, Subversion, Apache, Polls, Blogs, Kernel, Debian, Redhat, Kernel compilation, News, Tutorials, Linux initrd, Video and text tutorials, Open source development
Software Development, System Support, Web Development