<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>All Free For You &#187; Debian</title>
	<atom:link href="http://tusforyou.com/category/lunix/debian/feed" rel="self" type="application/rss+xml" />
	<link>http://tusforyou.com</link>
	<description></description>
	<lastBuildDate>Thu, 26 Aug 2010 17:05:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Virtualization With Xen On Debian Lenny (AMD64)</title>
		<link>http://tusforyou.com/virtualization-with-xen-on-debian-lenny-amd64</link>
		<comments>http://tusforyou.com/virtualization-with-xen-on-debian-lenny-amd64#comments</comments>
		<pubDate>Sat, 22 May 2010 03:17:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[AMD64]]></category>
		<category><![CDATA[Lenny]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[With]]></category>

		<guid isPermaLink="false">http://tusforyou.com/virtualization-with-xen-on-debian-lenny-amd64</guid>
		<description><![CDATA[Xen lets you create guest operating systems (*nix operating systems like Linux and FreeBSD), so called \&#8221;virtual machines\&#8221; or domUs, under a host operating system (dom0). Virtualization With XenOn Debian Lenny (AMD64) Version 1.0 Author: Falko Timme &#60;ft [at] falkotimme [dot] com&#62; Last edited 02/03/2009 This tutorial provides step-by-step instructions on how to install Xenon [...]]]></description>
			<content:encoded><![CDATA[<p>Xen lets you create guest operating systems (*nix operating systems like Linux and FreeBSD), so called \&#8221;virtual machines\&#8221; or domUs, under a host operating system (dom0).<span id="more-4718"></span>
<div class="node">
<div class="content">
<h2>Virtualization With XenOn Debian Lenny (AMD64) </h2>
<p>Version 1.0 <br /> Author: Falko Timme &lt;ft [at] falkotimme [dot] com&gt; <br />
Last edited 02/03/2009</p>
<p>This tutorial provides step-by-step instructions on how to install <a href="http://www.xensource.com/xen/" target="_blank">Xen</a>on a <b>Debian Lenny (5.0)</b> system (AMD64).</p>
<p>Xen lets you create guest operating systems (*nix operating systems like Linux and FreeBSD), so called &#8220;virtual machines&#8221; or <span class="system">domU</span>s, under a host operating system (<span class="system">dom0</span>). Using Xen you can separate your applications into different virtual machines that are totally independent from each other (e.g. a virtual machine for a mail server, a virtual machine for a high-traffic web site, another virtual machine that serves your customers&#8217; web sites, a virtual machine for DNS, etc.), but still use the same hardware. This saves money, and what is even more important, it&#8217;s more secure. If the virtual machine of your DNS server gets hacked, it has no effect on your other virtual machines. Plus, you can move virtual machines from one Xen server to the next one. </p>
<p>I do not issue any guarantee that this will work for you!</p>
<p>&nbsp;</p>
<h3>1 Preliminary Note</h3>
<p>I&#8217;m using a Debian Lenny system (<span class="system">x86_64</span>) with the hostname <span class="system">server1.example.com</span> and the IP address <span class="system">192.168.0.100</span> as the host system (<span class="system">dom0</span>). (The setup might differ slightly if you are on an <span class="system">i386</span> system.) I will use Debian Lenny for the virtual machines (<span class="system">domU</span>) as well. </p>
<p>This guide will explain how to set up image-based virtual machines and also LVM-based virtual machines.</p>
<p>&nbsp;</p>
<h3>2 Installing Xen</h3>
<p>To install Xen, we simply run</p>
<p class="command">apt-get install xen-hypervisor-3.2-1-amd64 xen-linux-system-2.6.26-1-xen-amd64 xen-utils-3.2-1 xenstore-utils xenwatch xen-shell xen-tools </p>
<p>Afterwards we open <span class="system">/etc/modules</span> and make sure that we have the line <span class="system">loop max_loop=64</span> in it (<span class="highlight">this step is needed only if you want to create image-based virtual machines &#8211; you can skip it if you want to create LVM-based virtual machines</span>):</p>
<p class="command">vi /etc/modules</p>
<tr>
<td class="">
<pre>[...]
loop max_loop=64</pre>
</td>
</tr>
<p>Next we open <span class="system">/etc/xen/xend-config.sxp</span>&#8230;</p>
<p class="command">vi /etc/xen/xend-config.sxp</p>
<p>&#8230; and uncomment the line <span class="system">(network-script network-bridge)</span> and comment out the line <span class="system">(network-script network-dummy)</span>. Also make sure that the line <span class="system">(vif-script vif-bridge)</span> is enabled: </p>
<tr>
<td class="">
<pre>[...]
(network-script network-bridge)
[...]
#(network-script network-dummy)
[...]
(vif-script vif-bridge)
[...]</pre>
</td>
</tr>
<p>Then reboot the system:</p>
<p class="command">reboot</p>
<p>Run</p>
<p class="command">uname -r</p>
<p>and your new Xen kernel should show up:</p>
<p class="system">server1:~# uname -r<br /> 2.6.26-1-xen-amd64<br />
server1:~#</p>
<p>&nbsp;</p>
<h3>3 Creating Image-Based Virtual Machines</h3>
<p>We will use <a href="http://xen-tools.org/software/xen-tools/" target="_blank">xen-tools</a> to create virtual machines. xen-tools make it very easy to create virtual machines &#8211; please read this tutorial to learn more: <a href="http://www.tusforyou.com/xen_tools_xen_shell_argo" target="_blank">http://www.tusforyou.com/xen_tools_xen_shell_argo</a>. We&#8217;ve already installed xen-tools in the previous step (chapter 2). </p>
<tr>
<td width="320">
<div style="height:250px;width:300px;margin: 10px 10px 10px 10px"></div>
<div style="height:250px;width:300px;margin: 10px 10px 10px 10px"></div>
</td>
<td width="320">
<div style="height:600px;width:300px;margin: 10px 10px 10px 10px"></div>
</td>
</tr>
<p>Now we edit <span class="system">/etc/xen-tools/xen-tools.conf</span>. This file contains the default values that are used by the <span class="system">xen-create-image</span> script unless you specify other values on the command line. I changed the following values and left the rest untouched:</p>
<p class="command">vi /etc/xen-tools/xen-tools.conf</p>
<tr>
<td class="">
<pre>[...]
dir = /home/xen
[...]
dist = lenny # Default distribution to install.
[...]
gateway = 192.168.0.1
netmask = 255.255.255.0
broadcast = 192.168.0.255
[...]
passwd = 1
[...]
kernel= /boot/vmlinuz-`uname -r`
initrd= /boot/initrd.img-`uname -r`
[...]
mirror = http://ftp.de.debian.org/debian/
[...]
serial_device = hvc0
[...]
disk_device = xvda
[...]</pre>
</td>
</tr>
<p>The <span class="system">dir</span> line specifies where the virtual machine images will be stored. <span class="system">dist</span> specifies the distribution to be installed in the virtual machines (Debian Lenny) (there&#8217;s a comment in the file that explains what distributions are currently supported). </p>
<p>The <span class="system">passwd = 1</span> line makes that you can specify a root password when you create a new guest domain. In the <span class="system">mirror</span> line specify a Debian mirror close to you. </p>
<p>Make sure you specify a gateway, netmask, and broadcast address. If you don&#8217;t, and you don&#8217;t specify a gateway and netmask on the command line when using <span class="system">xen-create-image</span>, your guest domains won&#8217;t have networking even if you specified an IP address!</p>
<p>It is very important that you add the line <span class="system">serial_device = hvc0</span> because otherwise your virtual machines might not boot properly! </p>
<p>Before we go on, we must create the directory where the virtual machine images should be stored:</p>
<p class="command">mkdir /home/xen </p>
<p>Now let&#8217;s create our first guest domain, <span class="system">xen1.example.com</span>, with the IP address <span class="system">192.168.0.101</span>:</p>
<p class="command">xen-create-image &#8211;hostname=xen1.example.com &#8211;size=4Gb &#8211;swap=256Mb &#8211;ip=192.168.0.101 &#8211;memory=128Mb &#8211;arch=amd64 &#8211;role=udev </p>
<p>Options that you specify on the command line override the settings in <span class="system">/etc/xen-tools/xen-tools.conf</span>. Options that are not specified on the command line are taken from <span class="system">/etc/xen-tools/xen-tools.conf</span>. <span class="highlight">Please make sure that you add &#8211;role=udev, or your virtual machine might not boot properly!</span></p>
<p>(To learn more about the available options, take a look at the <span class="system">xen-create-image</span> man page:</p>
<p class="command">man xen-create-image</p>
<p>)</p>
<p>The <span class="system">xen-create-image</span> command will now create the <span class="system">xen1.example.com</span> virtual machine for us. This can take a few minutes. The output should be similar to this one:</p>
<p class="system">server1:~#&nbsp;xen-create-image&nbsp;&#8211;hostname=xen1.example.com&nbsp;&#8211;size=4Gb&nbsp;&#8211;swap=256Mb&nbsp;&#8211;ip=192.168.0.101&nbsp;&#8211;memory=128Mb&nbsp;&#8211;arch=amd64&nbsp;&#8211;role=udev</p>
<p>General&nbsp;Information<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
Hostname&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;&nbsp;xen1.example.com<br />
Distribution&nbsp;&nbsp;&nbsp;:&nbsp;&nbsp;lenny<br />
Partitions&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;&nbsp;swap&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;256Mb&nbsp;(swap)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4Gb&nbsp;&nbsp;&nbsp;(ext3)<br />
Image&nbsp;type&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;&nbsp;sparse<br />
Memory&nbsp;size&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;&nbsp;128Mb<br />
Kernel&nbsp;path&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;&nbsp;/boot/vmlinuz-2.6.26-1-xen-amd64<br />
Initrd&nbsp;path&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;&nbsp;/boot/initrd.img-2.6.26-1-xen-amd64</p>
<p>Networking&nbsp;Information<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
IP&nbsp;Address&nbsp;1&nbsp;&nbsp;&nbsp;:&nbsp;192.168.0.101&nbsp;[MAC:&nbsp;00:16:3E:D0:91:EE]<br />
Netmask&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;255.255.255.0<br />
Broadcast&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;192.168.0.255<br />
Gateway&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;192.168.0.1</p>
<p>
Creating&nbsp;partition&nbsp;image:&nbsp;/home/xen/domains/xen1.example.com/swap.img<br />
Done</p>
<p>Creating&nbsp;swap&nbsp;on&nbsp;/home/xen/domains/xen1.example.com/swap.img<br />
Done</p>
<p>Creating&nbsp;partition&nbsp;image:&nbsp;/home/xen/domains/xen1.example.com/disk.img<br />
Done</p>
<p>Creating&nbsp;ext3&nbsp;filesystem&nbsp;on&nbsp;/home/xen/domains/xen1.example.com/disk.img<br />
Done<br />
Installation&nbsp;method:&nbsp;debootstrap<br />
Done</p>
<p>Running&nbsp;hooks<br />
Done</p>
<p>Role:&nbsp;udev<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;File:&nbsp;/etc/xen-tools/role.d/udev<br />
Role&nbsp;script&nbsp;completed.</p>
<p>Creating&nbsp;Xen&nbsp;configuration&nbsp;file<br />
Done<br />
Setting&nbsp;up&nbsp;root&nbsp;password<br />
Enter&nbsp;new&nbsp;UNIX&nbsp;password:<br />
Retype&nbsp;new&nbsp;UNIX&nbsp;password:<br />
passwd:&nbsp;password&nbsp;updated&nbsp;successfully<br />
All&nbsp;done</p>
<p>
Logfile&nbsp;produced&nbsp;at:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/var/log/xen-tools/xen1.example.com.log<br />
server1:~#</p>
<p>There should now be a <span class="system">xen1.example.com</span> configuration file &#8211; <span class="system">/etc/xen/xen1.example.com.cfg</span>. Take a look at it to become familiar with virtual machines configuration files:</p>
<p class="command">vi /etc/xen/xen1.example.com.cfg</p>
<tr>
<td class="">
<pre>#
# Configuration file for the Xen instance xen1.example.com, created
# by xen-tools 3.9 on Tue Feb3 17:56:25 2009.
#
#
#Kernel + memory size
#
kernel= '/boot/vmlinuz-2.6.26-1-xen-amd64'
ramdisk = '/boot/initrd.img-2.6.26-1-xen-amd64'
memory= '128'
#
#Disk device(s).
#
root= '/dev/xvda2 ro'
disk= [ 'file:/home/xen/domains/xen1.example.com/swap.img,xvda1,w', 'file:/home/xen/domains/xen1.example.com/disk.img,xvda2,w', ]
#
#Hostname
#
name= 'xen1.example.com'
#
#Networking
#
vif = [ 'ip=192.168.0.101,mac=00:16:3E:D0:91:EE' ]
#
#Behaviour
#
on_poweroff = 'destroy'
on_reboot = 'restart'
on_crash= 'restart'
</pre>
</td>
</tr>
<p> (Please note: if you have a dual-core or quad-core CPU and want the virtual machine to use all CPU cores, please add the line <span class="system">vcpus = &#8217;2&#8242;</span> or <span class="system">vcpus = &#8217;4&#8242;</span> to the configuration file.)</p>
<p>To start the virtual machine, run</p>
<p class="command">xm create /etc/xen/xen1.example.com.cfg</p>
<p>Run</p>
<p class="command">xm console xen1.example.com</p>
<p>to log in on that virtual machine (type <span class="system">CTRL+]</span> if you are at the console, or <span class="system">CTRL+5</span> if you&#8217;re using PuTTY to go back to <span class="system">dom0</span>), or use an SSH client to connect to it (<span class="system">192.168.0.101</span>). </p>
<p>To get a list of running virtual machines, type</p>
<p class="command">xm list </p>
<p>The output should look like this:</p>
<p class="system">server1:~#&nbsp;xm&nbsp;list<br />
Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ID&nbsp;&nbsp;&nbsp;Mem&nbsp;VCPUs&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;State&nbsp;&nbsp;&nbsp;Time(s)<br />
Domain-0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;3488&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;r&#8212;&#8211;&nbsp;&nbsp;&nbsp;&nbsp;398.2<br />
xen1.example.com&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;6&nbsp;&nbsp;&nbsp;128&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-b&#8212;-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2.8<br />
server1:~#</p>
<p>To shut down <span class="system">xen1.example.com</span>, do this:</p>
<p class="command">xm shutdown xen1.example.com </p>
<p>If you want <span class="system">xen1.example.com</span> to start automatically at the next boot of the system, then do this:</p>
<p class="command">ln -s /etc/xen/xen1.example.com.cfg /etc/xen/auto</p>
<p>Here are the most important Xen commands:</p>
<p><span class="system">xm create -c /path/to/config</span> &#8211; Start a virtual machine.<br /> <span class="system">xm shutdown &lt;name&gt;</span> &#8211; Stop a virtual machine.<br /> <span class="system">xm destroy &lt;name&gt;</span> &#8211; Stop a virtual machine immediately without shutting it down. It&#8217;s as if you switch off the power button. <br /> <span class="system">xm list</span> &#8211; List all running systems.<br /> <span class="system">xm console &lt;name&gt;</span> &#8211; Log in on a virtual machine.<br /> <span class="system">xm help</span> &#8211; List of all commands.</p>
<p>A list of all virtual machines that were created with the <span class="system">xen-create-image</span> command is available under</p>
<p class="command">xen-list-images</p>
<p class="system">server1:~# xen-list-images<br /> Name: xen1.example.com<br /> Memory: 128<br /> IP: 192.168.0.101<br />
server1:~#</p>
<p>To learn more about what you can do with xen-tools, take a look at this tutorial: <a href="http://www.tusforyou.com/xen_tools_xen_shell_argo" target="_blank">http://www.tusforyou.com/xen_tools_xen_shell_argo</a></p>
<div class="book">
<div class="tree">
<div class="menu">
<ul>
<li class="leaf"><a href="virtualization-with-xen-on-debian-lenny-amd64-p2">Virtualization With Xen On Debian Lenny (AMD64) &#8211; Page 2</a></li>
</ul>
</div>
</div>
<div class="nav">
<div class="links">
<div class="prev">&nbsp;</div>
<div class="next"><a href="virtualization-with-xen-on-debian-lenny-amd64-p2" title="View the next page.">next</a></div>
</div>
<div class="titles">
<div class="next">Virtualization With Xen On Debian Lenny (AMD64) &#8211; Page 2</div>
</div>
</div>
</div>
<p>
<div class="copyright-footer">Copyright © 2009 Falko Timme<br />All Rights Reserved.</div>
</div>
</div>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Ftusforyou.com%2Fvirtualization-with-xen-on-debian-lenny-amd64&amp;title=Virtualization+With+Xen+On+Debian+Lenny+%28AMD64%29" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Ftusforyou.com%2Fvirtualization-with-xen-on-debian-lenny-amd64&amp;title=Virtualization+With+Xen+On+Debian+Lenny+%28AMD64%29" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Ftusforyou.com%2Fvirtualization-with-xen-on-debian-lenny-amd64&amp;title=Virtualization+With+Xen+On+Debian+Lenny+%28AMD64%29" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Ftusforyou.com%2Fvirtualization-with-xen-on-debian-lenny-amd64&amp;headline=Virtualization+With+Xen+On+Debian+Lenny+%28AMD64%29" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=Virtualization+With+Xen+On+Debian+Lenny+%28AMD64%29&amp;url=http%3A%2F%2Ftusforyou.com%2Fvirtualization-with-xen-on-debian-lenny-amd64" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Virtualization+With+Xen+On+Debian+Lenny+%28AMD64%29&amp;u=http%3A%2F%2Ftusforyou.com%2Fvirtualization-with-xen-on-debian-lenny-amd64" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=Virtualization+With+Xen+On+Debian+Lenny+%28AMD64%29&amp;url=http%3A%2F%2Ftusforyou.com%2Fvirtualization-with-xen-on-debian-lenny-amd64" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Virtualization+With+Xen+On+Debian+Lenny+%28AMD64%29&amp;url=http%3A%2F%2Ftusforyou.com%2Fvirtualization-with-xen-on-debian-lenny-amd64" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Virtualization+With+Xen+On+Debian+Lenny+%28AMD64%29&amp;url=http%3A%2F%2Ftusforyou.com%2Fvirtualization-with-xen-on-debian-lenny-amd64" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Ftusforyou.com%2Fvirtualization-with-xen-on-debian-lenny-amd64&amp;title=Virtualization+With+Xen+On+Debian+Lenny+%28AMD64%29&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Ftusforyou.com%2Fvirtualization-with-xen-on-debian-lenny-amd64" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Ftusforyou.com%2Fvirtualization-with-xen-on-debian-lenny-amd64" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Ftusforyou.com%2Fvirtualization-with-xen-on-debian-lenny-amd64" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://tusforyou.com/virtualization-with-xen-on-debian-lenny-amd64/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Virtualization With Xen On Debian Lenny (AMD64) &#8211; Page 2</title>
		<link>http://tusforyou.com/virtualization-with-xen-on-debian-lenny-amd64-p2</link>
		<comments>http://tusforyou.com/virtualization-with-xen-on-debian-lenny-amd64-p2#comments</comments>
		<pubDate>Sat, 22 May 2010 03:15:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[AMD64]]></category>
		<category><![CDATA[Lenny]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[With]]></category>

		<guid isPermaLink="false">http://tusforyou.com/virtualization-with-xen-on-debian-lenny-amd64-p2</guid>
		<description><![CDATA[how you can set up LVM-based virtual machines instead of virtual machines that use disk images. Virtual machines that use disk images are very slow and heavy on disk IO. 4 Creating LVM-Based Virtual Machines This chapter explains how you can set up LVM-based virtual machinesinstead of virtual machines that use disk images. Virtual machines [...]]]></description>
			<content:encoded><![CDATA[<p>how you can set up LVM-based virtual machines instead of virtual machines that use disk images. Virtual machines that use disk images are very slow and heavy on disk IO. <span id="more-4717"></span>
<div class="node">
<div class="content">
<h3>4 Creating LVM-Based Virtual Machines</h3>
<p>This chapter explains how you can set up LVM-based virtual machinesinstead of virtual machines that use disk images. Virtual machines that use disk images are very slow and heavy on disk IO. </p>
<p>In this example I&#8217;m using a Debian Lenny host with the LVM volume group <span class="system">/dev/vg0</span> that has about 500GB of space. <span class="system">/dev/vg0</span> contains two logical volumes, <span class="system">/dev/vg0/root</span> and <span class="system">/dev/vg0/swap_1</span> that consume about 11GB of space &#8211; the rest is not allocated and can be used to create logical volumes for our virtual machines:</p>
<p class="command">vgdisplay</p>
<p class="system">server1:~#&nbsp;vgdisplay<br />
&nbsp;&nbsp;&#8212;&nbsp;Volume&nbsp;group&nbsp;&#8212;<br />
&nbsp;&nbsp;VG&nbsp;Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vg0<br />
&nbsp;&nbsp;System&nbsp;ID<br />
&nbsp;&nbsp;Format&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;lvm2<br />
&nbsp;&nbsp;Metadata&nbsp;Areas&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1<br />
&nbsp;&nbsp;Metadata&nbsp;Sequence&nbsp;No&nbsp;&nbsp;4<br />
&nbsp;&nbsp;VG&nbsp;Access&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;read/write<br />
&nbsp;&nbsp;VG&nbsp;Status&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;resizable<br />
&nbsp;&nbsp;MAX&nbsp;LV&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0<br />
&nbsp;&nbsp;Cur&nbsp;LV&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3<br />
&nbsp;&nbsp;Open&nbsp;LV&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2<br />
&nbsp;&nbsp;Max&nbsp;PV&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0<br />
&nbsp;&nbsp;Cur&nbsp;PV&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1<br />
&nbsp;&nbsp;Act&nbsp;PV&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1<br />
&nbsp;&nbsp;VG&nbsp;Size&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;465.28&nbsp;GB<br />
&nbsp;&nbsp;PE&nbsp;Size&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4.00&nbsp;MB<br />
&nbsp;&nbsp;Total&nbsp;PE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;119112<br />
&nbsp;&nbsp;Alloc&nbsp;PE&nbsp;/&nbsp;Size&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;5420&nbsp;/&nbsp;21.17&nbsp;GB<br />
&nbsp;&nbsp;Free&nbsp;&nbsp;PE&nbsp;/&nbsp;Size&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;113692&nbsp;/&nbsp;444.11&nbsp;GB<br />
&nbsp;&nbsp;VG&nbsp;UUID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;zXVC4l-FQZa-6dvS-rXQG-YbO9-g0Ce-2iTiIw</p>
<p>server1:~#</p>
<p class="command">lvdisplay</p>
<p class="system">server1:~#&nbsp;lvdisplay<br />
&nbsp;&nbsp;&#8212;&nbsp;Logical&nbsp;volume&nbsp;&#8212;<br />
&nbsp;&nbsp;LV&nbsp;Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/dev/vg0/root<br />
&nbsp;&nbsp;VG&nbsp;Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vg0<br />
&nbsp;&nbsp;LV&nbsp;UUID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x74hzO-wh3O-VwiJ-QHpq-xwfT-kOyd-iJ49jB<br />
&nbsp;&nbsp;LV&nbsp;Write&nbsp;Access&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;read/write<br />
&nbsp;&nbsp;LV&nbsp;Status&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;available<br />
&nbsp;&nbsp;#&nbsp;open&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1<br />
&nbsp;&nbsp;LV&nbsp;Size&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;9.31&nbsp;GB<br />
&nbsp;&nbsp;Current&nbsp;LE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2384<br />
&nbsp;&nbsp;Segments&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1<br />
&nbsp;&nbsp;Allocation&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;inherit<br />
&nbsp;&nbsp;Read&nbsp;ahead&nbsp;sectors&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;auto<br />
&nbsp;&nbsp;-&nbsp;currently&nbsp;set&nbsp;to&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;256<br />
&nbsp;&nbsp;Block&nbsp;device&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;254:0</p>
<p>&nbsp;&nbsp;&#8212;&nbsp;Logical&nbsp;volume&nbsp;&#8212;<br />
&nbsp;&nbsp;LV&nbsp;Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/dev/vg0/swap_1<br />
&nbsp;&nbsp;VG&nbsp;Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vg0<br />
&nbsp;&nbsp;LV&nbsp;UUID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RMDldO-nAVy-dvqP-rZh2-NkFd-48aw-YbPK9i<br />
&nbsp;&nbsp;LV&nbsp;Write&nbsp;Access&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;read/write<br />
&nbsp;&nbsp;LV&nbsp;Status&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;available<br />
&nbsp;&nbsp;#&nbsp;open&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1<br />
&nbsp;&nbsp;LV&nbsp;Size&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1.86&nbsp;GB<br />
&nbsp;&nbsp;Current&nbsp;LE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;476<br />
&nbsp;&nbsp;Segments&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1<br />
&nbsp;&nbsp;Allocation&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;inherit<br />
&nbsp;&nbsp;Read&nbsp;ahead&nbsp;sectors&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;auto<br />
&nbsp;&nbsp;-&nbsp;currently&nbsp;set&nbsp;to&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;256<br />
&nbsp;&nbsp;Block&nbsp;device&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;254:1</p>
<p>server1:~#</p>
<tr>
<td width="320">
<div style="height:250px;width:300px;margin: 10px 10px 10px 10px"></div>
<div style="height:250px;width:300px;margin: 10px 10px 10px 10px"></div>
</td>
<td width="320">
<div style="height:600px;width:300px;margin: 10px 10px 10px 10px"></div>
</td>
</tr>
<p>We will use <a href="http://xen-tools.org/software/xen-tools/" target="_blank">xen-tools</a> to create virtual machines. xen-tools make it very easy to create virtual machines &#8211; please read this tutorial to learn more: <a href="http://www.tusforyou.com/xen_tools_xen_shell_argo" target="_blank">http://www.tusforyou.com/xen_tools_xen_shell_argo</a>. We&#8217;ve already installed xen-tools in chapter 2.</p>
<p>Next we edit <span class="system">/etc/xen-tools/xen-tools.conf</span>. This file contains the default values that are used by the <span class="system">xen-create-image</span> script unless you specify other values on the command line. I changed the following values and left the rest untouched:</p>
<p class="command">vi /etc/xen-tools/xen-tools.conf</p>
<tr>
<td class="">
<pre>[...]
lvm = vg0
[...]
dist = lenny # Default distribution to install.
[...]
gateway = 192.168.0.1
netmask = 255.255.255.0
broadcast = 192.168.0.255
[...]
passwd = 1
[...]
kernel= /boot/vmlinuz-`uname -r`
initrd= /boot/initrd.img-`uname -r`
[...]
mirror = http://ftp.de.debian.org/debian/
[...]
serial_device = hvc0
[...]
disk_device = xvda
[...]</pre>
</td>
</tr>
<p>Make sure that you uncomment the <span class="system">lvm</span> line and fill in the name of your volume group (<span class="system">vg0</span> in my case). At the same time make sure that the <span class="system">dir</span> line is commented out! </p>
<p><span class="system">dist</span> specifies the distribution to be installed in the virtual machines (Debian Lenny) (there&#8217;s a comment in the file that explains what distributions are currently supported). </p>
<p>The <span class="system">passwd = 1</span> line makes that you can specify a root password when you create a new guest domain. </p>
<p>In the <span class="system">mirror</span> line specify a Debian mirror close to you. </p>
<p>Make sure you specify a gateway, netmask, and broadcast address. If you don&#8217;t, and you don&#8217;t specify a gateway and netmask on the command line when using <span class="system">xen-create-image</span>, your guest domains won&#8217;t have networking even if you specified an IP address!</p>
<p>It is very important that you add the line <span class="system">serial_device = hvc0</span> because otherwise your virtual machines might not boot properly! </p>
<p>Now let&#8217;s create our first guest domain, <span class="system">xen1.example.com</span>, with the IP address <span class="system">192.168.0.101</span>:</p>
<p class="command">xen-create-image &#8211;hostname=xen1.example.com &#8211;size=4Gb &#8211;swap=256Mb &#8211;ip=192.168.0.101 &#8211;memory=128Mb &#8211;arch=amd64 &#8211;role=udev</p>
<p>Options that you specify on the command line override the settings in <span class="system">/etc/xen-tools/xen-tools.conf</span>. Options that are not specified on the command line are taken from <span class="system">/etc/xen-tools/xen-tools.conf</span>. <span class="highlight">Please make sure that you add &#8211;role=udev, or your virtual machine might not boot properly!</span></p>
<p>(To learn more about the available options, take a look at the <span class="system">xen-create-image</span> man page:</p>
<p class="command">man xen-create-image</p>
<p>)</p>
<p>The <span class="system">xen-create-image</span> command will now create the <span class="system">xen1.example.com</span> virtual machine for us. This can take a few minutes. The output should be similar to this one:</p>
<p class="system">server1:~#&nbsp;xen-create-image&nbsp;&#8211;hostname=xen1.example.com&nbsp;&#8211;size=4Gb&nbsp;&#8211;swap=256Mb&nbsp;&#8211;ip=192.168.0.101&nbsp;&#8211;memory=128Mb&nbsp;&#8211;arch=amd64&nbsp;&#8211;role=udev</p>
<p>General&nbsp;Information<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
Hostname&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;&nbsp;xen1.example.com<br />
Distribution&nbsp;&nbsp;&nbsp;:&nbsp;&nbsp;lenny<br />
Partitions&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;&nbsp;swap&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;256Mb&nbsp;(swap)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4Gb&nbsp;&nbsp;&nbsp;(ext3)<br />
Image&nbsp;type&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;&nbsp;full<br />
Memory&nbsp;size&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;&nbsp;128Mb<br />
Kernel&nbsp;path&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;&nbsp;/boot/vmlinuz-2.6.26-1-xen-amd64<br />
Initrd&nbsp;path&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;&nbsp;/boot/initrd.img-2.6.26-1-xen-amd64</p>
<p>Networking&nbsp;Information<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
IP&nbsp;Address&nbsp;1&nbsp;&nbsp;&nbsp;:&nbsp;192.168.0.101&nbsp;[MAC:&nbsp;00:16:3E:0F:A1:93]<br />
Netmask&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;255.255.255.0<br />
Broadcast&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;192.168.0.255<br />
Gateway&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;192.168.0.1</p>
<p>
Creating&nbsp;swap&nbsp;on&nbsp;/dev/vg0/xen1.example.com-swap<br />
Done</p>
<p>Creating&nbsp;ext3&nbsp;filesystem&nbsp;on&nbsp;/dev/vg0/xen1.example.com-disk<br />
Done<br />
Installation&nbsp;method:&nbsp;debootstrap<br />
Done</p>
<p>Running&nbsp;hooks<br />
Done</p>
<p>Role:&nbsp;udev<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;File:&nbsp;/etc/xen-tools/role.d/udev<br />
Role&nbsp;script&nbsp;completed.</p>
<p>Creating&nbsp;Xen&nbsp;configuration&nbsp;file<br />
Done<br />
Setting&nbsp;up&nbsp;root&nbsp;password<br />
Enter&nbsp;new&nbsp;UNIX&nbsp;password:<br />
Retype&nbsp;new&nbsp;UNIX&nbsp;password:<br />
passwd:&nbsp;password&nbsp;updated&nbsp;successfully<br />
All&nbsp;done</p>
<p>
Logfile&nbsp;produced&nbsp;at:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/var/log/xen-tools/xen1.example.com.log<br />
server1:~#</p>
<p>As you see from the output, <span class="system">xen-create-image</span> has created a new logical volume for our VM in the <span class="system">vg0</span> volume group, <span class="system">/dev/vg0/xen1.example.com-disk</span>, for the VM&#8217;s root filesystem. Take a look at</p>
<p class="command">lvdisplay</p>
<p>and you will see that it has also created a second logical volume, <span class="system">/dev/vg0/xen1.example.com-swap</span>, for the VM&#8217;s swap: </p>
<p class="system">server1:~#&nbsp;lvdisplay<br />
&nbsp;&nbsp;&#8212;&nbsp;Logical&nbsp;volume&nbsp;&#8212;<br />
&nbsp;&nbsp;LV&nbsp;Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/dev/vg0/root<br />
&nbsp;&nbsp;VG&nbsp;Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vg0<br />
&nbsp;&nbsp;LV&nbsp;UUID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x74hzO-wh3O-VwiJ-QHpq-xwfT-kOyd-iJ49jB<br />
&nbsp;&nbsp;LV&nbsp;Write&nbsp;Access&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;read/write<br />
&nbsp;&nbsp;LV&nbsp;Status&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;available<br />
&nbsp;&nbsp;#&nbsp;open&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1<br />
&nbsp;&nbsp;LV&nbsp;Size&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;9.31&nbsp;GB<br />
&nbsp;&nbsp;Current&nbsp;LE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2384<br />
&nbsp;&nbsp;Segments&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1<br />
&nbsp;&nbsp;Allocation&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;inherit<br />
&nbsp;&nbsp;Read&nbsp;ahead&nbsp;sectors&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;auto<br />
&nbsp;&nbsp;-&nbsp;currently&nbsp;set&nbsp;to&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;256<br />
&nbsp;&nbsp;Block&nbsp;device&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;254:0</p>
<p>&nbsp;&nbsp;&#8212;&nbsp;Logical&nbsp;volume&nbsp;&#8212;<br />
&nbsp;&nbsp;LV&nbsp;Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/dev/vg0/swap_1<br />
&nbsp;&nbsp;VG&nbsp;Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vg0<br />
&nbsp;&nbsp;LV&nbsp;UUID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RMDldO-nAVy-dvqP-rZh2-NkFd-48aw-YbPK9i<br />
&nbsp;&nbsp;LV&nbsp;Write&nbsp;Access&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;read/write<br />
&nbsp;&nbsp;LV&nbsp;Status&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;available<br />
&nbsp;&nbsp;#&nbsp;open&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1<br />
&nbsp;&nbsp;LV&nbsp;Size&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1.86&nbsp;GB<br />
&nbsp;&nbsp;Current&nbsp;LE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;476<br />
&nbsp;&nbsp;Segments&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1<br />
&nbsp;&nbsp;Allocation&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;inherit<br />
&nbsp;&nbsp;Read&nbsp;ahead&nbsp;sectors&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;auto<br />
&nbsp;&nbsp;-&nbsp;currently&nbsp;set&nbsp;to&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;256<br />
&nbsp;&nbsp;Block&nbsp;device&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;254:1</p>
<p>&nbsp;&nbsp;&#8212;&nbsp;Logical&nbsp;volume&nbsp;&#8212;<br />
&nbsp;&nbsp;LV&nbsp;Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/dev/vg0/xen1.example.com-swap<br />
&nbsp;&nbsp;VG&nbsp;Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vg0<br />
&nbsp;&nbsp;LV&nbsp;UUID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;KNWeFo-2HiK-YcZl-8L63-8dVI-vehD-r7nx0x<br />
&nbsp;&nbsp;LV&nbsp;Write&nbsp;Access&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;read/write<br />
&nbsp;&nbsp;LV&nbsp;Status&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;available<br />
&nbsp;&nbsp;#&nbsp;open&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0<br />
&nbsp;&nbsp;LV&nbsp;Size&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;256.00&nbsp;MB<br />
&nbsp;&nbsp;Current&nbsp;LE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;64<br />
&nbsp;&nbsp;Segments&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1<br />
&nbsp;&nbsp;Allocation&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;inherit<br />
&nbsp;&nbsp;Read&nbsp;ahead&nbsp;sectors&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;auto<br />
&nbsp;&nbsp;-&nbsp;currently&nbsp;set&nbsp;to&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;256<br />
&nbsp;&nbsp;Block&nbsp;device&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;254:2</p>
<p>&nbsp;&nbsp;&#8212;&nbsp;Logical&nbsp;volume&nbsp;&#8212;<br />
&nbsp;&nbsp;LV&nbsp;Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/dev/vg0/xen1.example.com-disk<br />
&nbsp;&nbsp;VG&nbsp;Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vg0<br />
&nbsp;&nbsp;LV&nbsp;UUID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ifTchw-YKqk-ELet-MlF1-hw59-ZCIE-TcDnQm<br />
&nbsp;&nbsp;LV&nbsp;Write&nbsp;Access&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;read/write<br />
&nbsp;&nbsp;LV&nbsp;Status&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;available<br />
&nbsp;&nbsp;#&nbsp;open&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0<br />
&nbsp;&nbsp;LV&nbsp;Size&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4.00&nbsp;GB<br />
&nbsp;&nbsp;Current&nbsp;LE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1024<br />
&nbsp;&nbsp;Segments&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1<br />
&nbsp;&nbsp;Allocation&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;inherit<br />
&nbsp;&nbsp;Read&nbsp;ahead&nbsp;sectors&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;auto<br />
&nbsp;&nbsp;-&nbsp;currently&nbsp;set&nbsp;to&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;256<br />
&nbsp;&nbsp;Block&nbsp;device&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;254:3</p>
<p>server1:~#</p>
<p>There should now be a <span class="system">xen1.example.com</span> configuration file &#8211; <span class="system">/etc/xen/xen1.example.com.cfg</span>. The <span class="system">disk</span> line contains physical devices (the two logical volumes created by <span class="system">xen-create-image</span>) instead of disk images: </p>
<p class="command">vi /etc/xen/xen1.example.com.cfg</p>
<tr>
<td class="">
<pre>#
# Configuration file for the Xen instance xen1.example.com, created
# by xen-tools 3.9 on Tue Feb3 17:43:52 2009.
#
#
#Kernel + memory size
#
kernel= '/boot/vmlinuz-2.6.26-1-xen-amd64'
ramdisk = '/boot/initrd.img-2.6.26-1-xen-amd64'
memory= '128'
#
#Disk device(s).
#
root= '/dev/xvda2 ro'
disk= [ 'phy:/dev/vg0/xen1.example.com-swap,xvda1,w', 'phy:/dev/vg0/xen1.example.com-disk,xvda2,w', ]#
#Hostname
#
name= 'xen1.example.com'
#
#Networking
#
vif = [ 'ip=192.168.0.101,mac=00:16:3E:0F:A1:93' ]
#
#Behaviour
#
on_poweroff = 'destroy'
on_reboot = 'restart'
on_crash= 'restart'
</pre>
</td>
</tr>
<p>(If we had used disk images instead of logical volumes, the disk line would look similar to this one:</p>
<p class="system">disk&nbsp;=&nbsp;[&nbsp;'file:/path/to/xen1.example.com/disk.img,sda1,w',&nbsp;'file:/path/to/xen1.example.com/swap.img,sda2,w'&nbsp;]</p>
<p>)</p>
<p>(Please note: if you have a dual-core or quad-core CPU and want the virtual machine to use all CPU cores, please add the line <span class="system">vcpus = &#8217;2&#8242;</span> or <span class="system">vcpus = &#8217;4&#8242;</span> to the configuration file.)</p>
<p>To start the virtual machine, run</p>
<p class="command">xm create /etc/xen/xen1.example.com.cfg</p>
<p>Run</p>
<p class="command">xm console xen1.example.com</p>
<p>to log in on that virtual machine (type <span class="system">CTRL+]</span> if you are at the console, or <span class="system">CTRL+5</span> if you&#8217;re using PuTTY to go back to <span class="system">dom0</span>), or use an SSH client to connect to it (<span class="system">192.168.0.101</span>). </p>
<p>To get a list of running virtual machines, type</p>
<p class="command">xm list </p>
<p>The output should look like this:</p>
<p class="system">server1:~#&nbsp;xm&nbsp;list<br />
Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ID&nbsp;Mem(MiB)&nbsp;VCPUs&nbsp;State&nbsp;&nbsp;&nbsp;Time(s)<br />
Domain-0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;747&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1&nbsp;r&#8212;&#8211;&nbsp;&nbsp;&nbsp;1402.9<br />
xen1.example.com&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;256&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1&nbsp;-b&#8212;-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;55.8<br />
server1:~#</p>
<p>To shut down <span class="system">xen1.example.com</span>, do this:</p>
<p class="command">xm shutdown xen1.example.com </p>
<p>If you want <span class="system">xen1.example.com</span> to start automatically at the next boot of the system, then do this:</p>
<p class="command">ln -s /etc/xen/xen1.example.com.cfg /etc/xen/auto</p>
<p>Here are the most important Xen commands:</p>
<p><span class="system">xm create -c /path/to/config</span> &#8211; Start a virtual machine.<br /> <span class="system">xm shutdown &lt;name&gt;</span> &#8211; Stop a virtual machine.<br /> <span class="system">xm destroy &lt;name&gt;</span> &#8211; Stop a virtual machine immediately without shutting it down. It&#8217;s as if you switch off the power button. <br /> <span class="system">xm list</span> &#8211; List all running systems.<br /> <span class="system">xm console &lt;name&gt;</span> &#8211; Log in on a virtual machine.<br /> <span class="system">xm help</span> &#8211; List of all commands.</p>
<p>A list of all virtual machines that were created with the <span class="system">xen-create-image</span> command is available under</p>
<p class="command">xen-list-images</p>
<p class="system">server1:~# xen-list-images<br /> Name: xen1.example.com<br /> Memory: 128<br /> IP: 192.168.0.101<br />
server1:~#</p>
<p>To learn more about what you can do with xen-tools, take a look at this tutorial: <a href="http://www.tusforyou.com/xen_tools_xen_shell_argo" target="_blank">http://www.tusforyou.com/xen_tools_xen_shell_argo</a></p>
<p>&nbsp;</p>
<h3>5 Links </h3>
<ul>
<li>Xen: <a href="http://www.xensource.com/xen/" target="_blank">http://www.xensource.com/xen/</a></li>
<li>xen-tools: <a href="http://xen-tools.org/software/xen-tools/" target="_blank">http://xen-tools.org/software/xen-tools</a></li>
<li>Debian: <a href="http://www.debian.org/" target="_blank">http://www.debian.org/ </a></li>
</ul>
<div class="book">
<div class="nav">
<div class="links">
<div class="prev"><a href="virtualization-with-xen-on-debian-lenny-amd64" title="View the previous page.">previous</a></div>
<div class="next">&nbsp;</div>
<div class="up"><a href="virtualization-with-xen-on-debian-lenny-amd64" title="View this page&#39;s parent section.">up</a></div>
</div>
<div class="titles">
<div class="prev">Virtualization With Xen On Debian Lenny (AMD64)</div>
</div>
</div>
</div>
<p>
<div class="copyright-footer">Copyright © 2009 Falko Timme<br />All Rights Reserved.</div>
</div>
</div>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Ftusforyou.com%2Fvirtualization-with-xen-on-debian-lenny-amd64-p2&amp;title=Virtualization+With+Xen+On+Debian+Lenny+%28AMD64%29+-+Page+2" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Ftusforyou.com%2Fvirtualization-with-xen-on-debian-lenny-amd64-p2&amp;title=Virtualization+With+Xen+On+Debian+Lenny+%28AMD64%29+-+Page+2" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Ftusforyou.com%2Fvirtualization-with-xen-on-debian-lenny-amd64-p2&amp;title=Virtualization+With+Xen+On+Debian+Lenny+%28AMD64%29+-+Page+2" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Ftusforyou.com%2Fvirtualization-with-xen-on-debian-lenny-amd64-p2&amp;headline=Virtualization+With+Xen+On+Debian+Lenny+%28AMD64%29+-+Page+2" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=Virtualization+With+Xen+On+Debian+Lenny+%28AMD64%29+-+Page+2&amp;url=http%3A%2F%2Ftusforyou.com%2Fvirtualization-with-xen-on-debian-lenny-amd64-p2" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Virtualization+With+Xen+On+Debian+Lenny+%28AMD64%29+-+Page+2&amp;u=http%3A%2F%2Ftusforyou.com%2Fvirtualization-with-xen-on-debian-lenny-amd64-p2" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=Virtualization+With+Xen+On+Debian+Lenny+%28AMD64%29+-+Page+2&amp;url=http%3A%2F%2Ftusforyou.com%2Fvirtualization-with-xen-on-debian-lenny-amd64-p2" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Virtualization+With+Xen+On+Debian+Lenny+%28AMD64%29+-+Page+2&amp;url=http%3A%2F%2Ftusforyou.com%2Fvirtualization-with-xen-on-debian-lenny-amd64-p2" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Virtualization+With+Xen+On+Debian+Lenny+%28AMD64%29+-+Page+2&amp;url=http%3A%2F%2Ftusforyou.com%2Fvirtualization-with-xen-on-debian-lenny-amd64-p2" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Ftusforyou.com%2Fvirtualization-with-xen-on-debian-lenny-amd64-p2&amp;title=Virtualization+With+Xen+On+Debian+Lenny+%28AMD64%29+-+Page+2&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Ftusforyou.com%2Fvirtualization-with-xen-on-debian-lenny-amd64-p2" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Ftusforyou.com%2Fvirtualization-with-xen-on-debian-lenny-amd64-p2" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Ftusforyou.com%2Fvirtualization-with-xen-on-debian-lenny-amd64-p2" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://tusforyou.com/virtualization-with-xen-on-debian-lenny-amd64-p2/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Chrooted SSH/SFTP Tutorial (Debian Lenny)</title>
		<link>http://tusforyou.com/chrooted-sshsftp-tutorial-debian-lenny</link>
		<comments>http://tusforyou.com/chrooted-sshsftp-tutorial-debian-lenny#comments</comments>
		<pubDate>Sat, 22 May 2010 02:58:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Chrooted]]></category>
		<category><![CDATA[Lenny]]></category>
		<category><![CDATA[SSH/SFTP]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://tusforyou.com/chrooted-sshsftp-tutorial-debian-lenny</guid>
		<description><![CDATA[Since version 4.8, OpenSSH supports chrooting (see http://openssh.org/txt/release-4.8), so no patches are needed anymore. This tutorial describes how to give users chrooted SSH access. With this setup, you can give your users shell access without having to fear that they can see your whole system. Your users will be jailed in a specific directory which [...]]]></description>
			<content:encoded><![CDATA[<p>Since version 4.8, OpenSSH supports chrooting (see http://openssh.org/txt/release-4.8), so no patches are needed anymore. This tutorial describes how to give users chrooted SSH access. With this setup, you can give your users shell access without having to fear that they can see your whole system. Your users will be jailed in a specific directory which they will not be able to break out of. I will also show how to use chrooted SFTP. <span id="more-4714"></span>
<div class="node">
<div class="content">
<h2>Chrooted SSH/SFTP Tutorial (Debian Lenny) </h2>
<p>Version 1.0 <br /> Author: Falko Timme &lt;ft [at] falkotimme [dot] com&gt; <br /> Last edited 03/03/2009</p>
<p>Since version 4.8, OpenSSH supports chrooting (see <a href="http://openssh.org/txt/release-4.8" target="_blank">http://openssh.org/txt/release-4.8</a>), so no patches are needed anymore. This tutorial describes how to give users chrooted SSH access. With this setup, you can give your users shell access without having to fear that they can see your whole system. Your users will be jailed in a specific directory which they will not be able to break out of. I will also show how to use chrooted SFTP. </p>
<p>I do not issue any guarantee that this will work for you!</p>
<p>&nbsp;</p>
<h3>1 Preliminary Note</h3>
<p> The OpenSSH version coming with Debian Lenny is 5.1p1, so it supports chrooting. </p>
<p>I will use the user <span class="system">falko</span> here with the home directory <span class="system">/home/falko</span>. The user falko belongs to the group <span class="system">users</span>. I want to chroot the user to the <span class="system">/home</span> directory. </p>
<p>&nbsp;</p>
<h3>2 Installing OpenSSH</h3>
<p>If OpenSSH is not already installed, install it as follows:</p>
<p class="command">apt-get install ssh openssh-server</p>
<p>&nbsp; </p>
<h3>3 Enabling Chrooted SFTP</h3>
<p>Enabling SFTP is very easy. Open <span class="system">/etc/ssh/sshd_config</span>&#8230;</p>
<p class="command">vi /etc/ssh/sshd_config</p>
<p>&#8230; and make sure you have the following line in it:</p>
<tr>
<td class="">
<pre>[...]
Subsystem sftp /usr/lib/openssh/sftp-server
[...]</pre>
</td>
</tr>
<p>Then add the following stanza at the end of the file (add such a stanza for each user that you want to chroot):</p>
<tr>
<td class="">
<pre>[...]
Match User falko ChrootDirectory /home AllowTCPForwarding no X11Forwarding no ForceCommand /usr/lib/openssh/sftp-server</pre>
</td>
</tr>
<p>Instead of adding a stanza for each user, you can also chroot groups, e.g. as follows:</p>
<tr>
<td class="">
<pre>[...]
Match Group users ChrootDirectory /home AllowTCPForwarding no X11Forwarding no ForceCommand /usr/lib/openssh/sftp-server</pre>
</td>
</tr>
<p>This would chroot all members of the <span class="system">users</span> group to the <span class="system">/home</span> directory. </p>
<p>Restart OpenSSH:</p>
<p class="command">/etc/init.d/ssh restart</p>
<p>If you chroot multiple users to the same directory, but don&#8217;t want the users to browse the home directories of the other users, you can change the permissions of each home directory as follows:</p>
<p class="command">chmod 700 /home/falko</p>
<p>Afterwards, you can log in with an SFTP client, such as <a href="http://filezilla-project.org/" target="_blank">FileZilla</a> or <a href="http://winscp.net/" target="_blank">WinSCP</a>. </p>
<p>&nbsp;</p>
<h3>4 Enabling Chrooted SSH</h3>
<p>Enabling chrooted SSH is a bit more complicated because we must set up a chroot environment with all programs/tools (e.g. <span class="system">/bin/bash</span>, <span class="system">/bin/cp</span>, etc.) that the users should be able to use. This means we must also copy all libraries that these programs need to the chroot jail. You can do this manually with the <span class="system">cp</span> command, and you can find out what libraries a tool needs by using the <span class="system">ldd</span> command, e.g.</p>
<p class="command">ldd /bin/bash</p>
<p>We also have to create some devices such as <span class="system">/dev/null</span>, <span class="system">/dev/zero</span>, <span class="system">/dev/tty</span>, and <span class="system">/dev/urandom</span> inside the chroot jail with the <span class="system">mknod</span> command. </p>
<tr>
<td width="320">
<div style="height:250px;width:300px;margin: 10px 10px 10px 10px"></div>
<div style="height:250px;width:300px;margin: 10px 10px 10px 10px"></div>
</td>
<td width="320">
<div style="height:600px;width:300px;margin: 10px 10px 10px 10px"></div>
</td>
</tr>
<p>However, this can be a tedious task. Fortunately, there&#8217;s a <a href="http://www.fuschlberger.net/programs/ssh-scp-sftp-chroot-jail/" target="_blank">script</a> that can do this for us. </p>
<p>First, we need to install some prerequisites:</p>
<p class="command">apt-get install sudo debianutils coreutils</p>
<p>Then we download <span class="system">make_chroot_jail.sh</span> to <span class="system">/usr/local/sbin</span> and make it executable for the root user:</p>
<p class="command">cd /usr/local/sbin<br /> wget http://www.fuschlberger.net/programs/ssh-scp-sftp-chroot-jail/make_chroot_jail.sh<br /> chmod 700 /usr/local/sbin/make_chroot_jail.sh</p>
<p>Before we use the script, you might want to add some programs (e.g. such as <span class="system">/usr/bin/vi</span>) to the <span class="system">APPS</span> line of your distribution in that script so that these tools get added to the chroot jail automatically:</p>
<p class="command">vi /usr/local/sbin/make_chroot_jail.sh</p>
<tr>
<td class="">
<pre>[...]
elif [ "$DISTRO" = DEBIAN ]; then APPS="/bin/bash /bin/cp /usr/bin/dircolors /bin/ls /bin/mkdir /bin/mv /bin/rm /bin/rmdir /bin/sh /bin/su /usr/bin/groups /usr/bin/id /usr/bin/rsync /usr/bin/ssh /usr/bin/scp /sbin/unix_chkpwd /usr/bin/vi"
else
[...]</pre>
</td>
</tr>
<p>Next we add a symlink <span class="system">/home/home</span> that points back to <span class="system">/home</span>:</p>
<p class="command">cd /home<br />
ln -s . home</p>
<p>Now we can already use the script. Usage is as follows:</p>
<p class="system">make_chroot_jail.sh username [/path/to/chroot-shell [/path/to/chroot]] </p>
<p><span class="system">chroot-shell</span> is a special shell created by the script to chroot users. Since OpenSSH now supports chrooting by default, we don&#8217;t need the script to create a special shell; instead, we can use <span class="system">/bin/bash</span> or <span class="system">/bin/sh</span>. </p>
<p>It doesn&#8217;t matter if the user is already existing or not. If he&#8217;s existing, he will be updated; if not, he will be created.</p>
<p class="command">make_chroot_jail.sh falko /bin/bash /home</p>
<p>This will create/update the user <span class="system">falko</span> with the chroot jail <span class="system">/home</span>. </p>
<p>To update all files/libraries in the chroot jail, run</p>
<p class="command">make_chroot_jail.sh update /bin/bash /home</p>
<p>Now we need to configure OpenSSH which is similar to the SFTP configuration. Open <span class="system">/etc/ssh/sshd_config</span>&#8230;</p>
<p class="command">vi /etc/ssh/sshd_config</p>
<p>&#8230; and add the following stanza at the end of the file (add such a stanza for each user that you want to chroot):</p>
<tr>
<td class="">
<pre>[...]
Match User falko ChrootDirectory /home AllowTCPForwarding no X11Forwarding no</pre>
</td>
</tr>
<p>Instead of adding a stanza for each user, you can also chroot groups, e.g. as follows:</p>
<tr>
<td class="">
<pre>[...]
Match Group users ChrootDirectory /home AllowTCPForwarding no X11Forwarding no</pre>
</td>
</tr>
<p>This would chroot all members of the <span class="system">users</span> group to the <span class="system">/home</span> directory. </p>
<p>The difference to the SFTP configuration is that this time, we must not use the line <span class="system">ForceCommand /usr/lib/openssh/sftp-server</span> in the <span class="system">Match</span> stanzas! This makes that users can <strong>still use chrooted SFTP</strong> (provided you also have the line <span class="system">Subsystem sftp /usr/lib/openssh/sftp-server</span> in<span class="system"> /etc/ssh/sshd_config</span>), but also chrooted SSH. </p>
<p>Restart OpenSSH:</p>
<p class="command">/etc/init.d/ssh restart</p>
<p>If you chroot multiple users to the same directory, but don&#8217;t want the users to browse the home directories of the other users, you can change the permissions of each home directory as follows:</p>
<p class="command">chmod 700 /home/falko</p>
<p>Afterwards, you can log in with with an SSH client such as <a href="http://www.chiark.greenend.org.uk/%7Esgtatham/putty/" target="_blank">PuTTY</a>.</p>
<p>&nbsp;</p>
<h3>5 Links</h3>
<ul>
<li>OpenSSH: <a href="http://www.openssh.org" target="_blank">http://www.openssh.org</a></li>
<li>make_chroot_jail.sh: <a href="http://www.fuschlberger.net/programs/ssh-scp-sftp-chroot-jail/" target="_blank">http://www.fuschlberger.net/programs/ssh-scp-sftp-chroot-jail</a></li>
<li>Debian: <a href="http://www.debian.org/" target="_blank">http://www.debian.org</a></li>
</ul>
<p>
<div class="copyright-footer">Copyright © 2009 Falko Timme<br />All Rights Reserved.</div>
</div>
</div>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Ftusforyou.com%2Fchrooted-sshsftp-tutorial-debian-lenny&amp;title=Chrooted+SSH%2FSFTP+Tutorial+%28Debian+Lenny%29" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Ftusforyou.com%2Fchrooted-sshsftp-tutorial-debian-lenny&amp;title=Chrooted+SSH%2FSFTP+Tutorial+%28Debian+Lenny%29" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Ftusforyou.com%2Fchrooted-sshsftp-tutorial-debian-lenny&amp;title=Chrooted+SSH%2FSFTP+Tutorial+%28Debian+Lenny%29" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Ftusforyou.com%2Fchrooted-sshsftp-tutorial-debian-lenny&amp;headline=Chrooted+SSH%2FSFTP+Tutorial+%28Debian+Lenny%29" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=Chrooted+SSH%2FSFTP+Tutorial+%28Debian+Lenny%29&amp;url=http%3A%2F%2Ftusforyou.com%2Fchrooted-sshsftp-tutorial-debian-lenny" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Chrooted+SSH%2FSFTP+Tutorial+%28Debian+Lenny%29&amp;u=http%3A%2F%2Ftusforyou.com%2Fchrooted-sshsftp-tutorial-debian-lenny" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=Chrooted+SSH%2FSFTP+Tutorial+%28Debian+Lenny%29&amp;url=http%3A%2F%2Ftusforyou.com%2Fchrooted-sshsftp-tutorial-debian-lenny" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Chrooted+SSH%2FSFTP+Tutorial+%28Debian+Lenny%29&amp;url=http%3A%2F%2Ftusforyou.com%2Fchrooted-sshsftp-tutorial-debian-lenny" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Chrooted+SSH%2FSFTP+Tutorial+%28Debian+Lenny%29&amp;url=http%3A%2F%2Ftusforyou.com%2Fchrooted-sshsftp-tutorial-debian-lenny" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Ftusforyou.com%2Fchrooted-sshsftp-tutorial-debian-lenny&amp;title=Chrooted+SSH%2FSFTP+Tutorial+%28Debian+Lenny%29&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Ftusforyou.com%2Fchrooted-sshsftp-tutorial-debian-lenny" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Ftusforyou.com%2Fchrooted-sshsftp-tutorial-debian-lenny" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Ftusforyou.com%2Fchrooted-sshsftp-tutorial-debian-lenny" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://tusforyou.com/chrooted-sshsftp-tutorial-debian-lenny/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting Up A High-Availability Load Balancer (With Failover and Session Support) With Perlbal/Heartbeat On Debian Etch  Page 2</title>
		<link>http://tusforyou.com/setting-up-a-high-availability-load-balancer-with-perlbal-heartbeat-on-debian-etch-p2</link>
		<comments>http://tusforyou.com/setting-up-a-high-availability-load-balancer-with-perlbal-heartbeat-on-debian-etch-p2#comments</comments>
		<pubDate>Fri, 21 May 2010 18:49:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Balancer]]></category>
		<category><![CDATA[Failover]]></category>
		<category><![CDATA[HighAvailability]]></category>
		<category><![CDATA[Load]]></category>
		<category><![CDATA[Perlbal/Heartbeat]]></category>
		<category><![CDATA[Session]]></category>
		<category><![CDATA[Setting]]></category>
		<category><![CDATA[Support]]></category>
		<category><![CDATA[With]]></category>

		<guid isPermaLink="false">http://tusforyou.com/setting-up-a-high-availability-load-balancer-with-perlbal-heartbeat-on-debian-etch-p2</guid>
		<description><![CDATA[This article explains how to set up a two-node load balancer in an active/passive configuration with Perlbal and heartbeat on Debian Etch. The load balancer sits between the user and two (or more) backend Apache web servers that hold the same content. Not only does the load balancer distribute the requests to the two backend [...]]]></description>
			<content:encoded><![CDATA[<p>This article explains how to set up a two-node load balancer in an active/passive configuration with Perlbal and heartbeat on Debian Etch. The load balancer sits between the user and two (or more) backend Apache web servers that hold the same content. Not only does the load balancer distribute the requests to the two backend Apache servers, it also checks the health of the backend servers. If one of them is down, all requests will automatically be redirected to the remaining backend server. In addition to that, the two load balancer nodes monitor each other using heartbeat, and if the master fails, the slave becomes the master, which means the users will not notice any disruption of the service. Perlbal is session-aware, which means you can use it with any web application that makes use of sessions (such as forums, shopping carts, etc.).<span id="more-4709"></span>
<div class="node">
<div class="content">
<h3>5 Setting Up Heartbeat </h3>
<p>We&#8217;ve just configured Perlbal to listen on the virtual IP address <span class="system">192.168.0.99</span>, but someone has to tell <span class="system">lb1</span> and <span class="system">lb2</span> that they should listen on that IP address. This is done by heartbeat which we install like this:</p>
<p class="highlight">lb1/lb2:</p>
<p class="command">apt-get install heartbeat</p>
<p>To allow Perlbal to bind to the shared IP address, we add the following line to <span class="system">/etc/sysctl.conf</span>:</p>
<p class="command">vi /etc/sysctl.conf</p>
<tr>
<td class="">
<pre>[...]
net.ipv4.ip_nonlocal_bind=1</pre>
</td>
</tr>
<p>&#8230; and run:</p>
<p class="command">sysctl -p</p>
<p> Now we have to create three configuration files for heartbeat, <span class="system">/etc/ha.d/authkeys</span>, <span class="system">/etc/ha.d/ha.cf</span>, and <span class="system">/etc/ha.d/haresources</span>. <span class="system">/etc/ha.d/authkeys</span> and <span class="system">/etc/ha.d/haresources</span> must be identical on <span class="system">lb1</span> and <span class="system">lb2</span>, and <span class="system">/etc/ha.d/ha.cf</span> differs by just one line! </p>
<p class="highlight">lb1/lb2:</p>
<p class="command">vi /etc/ha.d/authkeys</p>
<tr>
<td class="">
<pre>auth 3
3 md5 somerandomstring</pre>
</td>
</tr>
<p><span class="system">somerandomstring</span> is a password which the two heartbeat daemons on <span class="system">lb1</span> and <span class="system">lb2</span> use to authenticate against each other. Use your own string here. You have the choice between three authentication mechanisms. I use <span class="system">md5</span> as it is the most secure one. </p>
<p><span class="system">/etc/ha.d/authkeys</span> should be readable by root only, therefore we do this: </p>
<p class="highlight">lb1/lb2:</p>
<p class="command">chmod 600 /etc/ha.d/authkeys</p>
<p class="highlight">lb1:</p>
<p class="command">vi /etc/ha.d/ha.cf</p>
<tr>
<td class="">
<pre>#
# keepalive: how many seconds between heartbeats
#
keepalive 2
#
# deadtime: seconds-to-declare-host-dead
#
deadtime 10
#
# What UDP port to use for udp or ppp-udp communication?
#
udpport694
bcasteth0
mcast eth0 225.0.0.1 694 1 0
ucast eth0 192.168.0.101
# What interfaces to heartbeat over?
udp eth0
#
# Facility to use for syslog()/logger (alternative to log/debugfile)
#
logfacility local0
#
# Tell what machines are in the cluster
# nodenodename ...-- must match uname -n
nodelb1.example.com
nodelb2.example.com</pre>
</td>
</tr>
<p><strong>Important: </strong> As nodenames we must use the output of </p>
<p class="command">uname -n </p>
<p>on <span class="system">lb1</span> and <span class="system">lb2</span>. </p>
<p>The <span class="system">udpport</span>, <span class="system">bcast</span>, <span class="system">mcast</span>, and <span class="system">ucast</span> options specify how the two heartbeat nodes communicate with each other to find out if the other node is still alive. You can leave the <span class="system">udpport</span>, <span class="system">bcast</span>, and <span class="system">mcast</span> lines as shown above, but in the <span class="system">ucast</span> line it&#8217;s important that you specify the IP address of the other heartbeat node; in this case it&#8217;s <span class="system">192.168.0.101</span> (<span class="system">lb2.example.com</span>). </p>
<p>On <span class="system">lb2</span> the file looks pretty much the same, except that the <span class="system">ucast</span> line holds the IP address of <span class="system">lb1</span>:</p>
<p class="highlight">lb2:</p>
<p class="command">vi /etc/ha.d/ha.cf</p>
<tr>
<td class="">
<pre>#
# keepalive: how many seconds between heartbeats
#
keepalive 2
#
# deadtime: seconds-to-declare-host-dead
#
deadtime 10
#
# What UDP port to use for udp or ppp-udp communication?
#
udpport694
bcasteth0
mcast eth0 225.0.0.1 694 1 0
ucast eth0 192.168.0.100
# What interfaces to heartbeat over?
udp eth0
#
# Facility to use for syslog()/logger (alternative to log/debugfile)
#
logfacility local0
#
# Tell what machines are in the cluster
# nodenodename ...-- must match uname -n
nodelb1.example.com
nodelb2.example.com</pre>
</td>
</tr>
<p class="highlight">lb1/lb2:</p>
<tr>
<td width="320">
<div style="height:250px;width:300px;margin: 10px 10px 10px 10px"></div>
<div style="height:250px;width:300px;margin: 10px 10px 10px 10px"></div>
</td>
<td width="320">
<div style="height:600px;width:300px;margin: 10px 10px 10px 10px"></div>
</td>
</tr>
<p class="command">vi /etc/ha.d/haresources</p>
<tr>
<td class="">
<pre>lb1.example.com 192.168.0.99</pre>
</td>
</tr>
<p> The first word is the output of </p>
<p class="command">uname -n </p>
<p>on <span class="system">lb1</span>, no matter if you create the file on <span class="system">lb1</span> or <span class="system">lb2</span>! It is followed by our virtual IP address (<span class="system">192.168.0.99</span> in our example). </p>
<p>Finally we start heartbeat on both load balancers:</p>
<p class="highlight">lb1/lb2:</p>
<p class="command">/etc/init.d/heartbeat start</p>
<p>Then run:</p>
<p class="highlight">lb1:</p>
<p class="command">ip addr sh eth0</p>
<p>&#8230; and you should find that <span class="system">lb1</span> is now listening on the shared IP address, too:</p>
<p class="system">lb1:~#&nbsp;ip&nbsp;addr&nbsp;sh&nbsp;eth0<br />
2:&nbsp;eth0:&nbsp;&lt;BROADCAST,MULTICAST,UP,10000&gt;&nbsp;mtu&nbsp;1500&nbsp;qdisc&nbsp;pfifo_fast&nbsp;qlen&nbsp;1000<br />
&nbsp;&nbsp;&nbsp;&nbsp;link/ether&nbsp;00:0c:29:a5:5b:93&nbsp;brd&nbsp;ff:ff:ff:ff:ff:ff<br />
&nbsp;&nbsp;&nbsp;&nbsp;inet&nbsp;192.168.0.100/24&nbsp;brd&nbsp;192.168.0.255&nbsp;scope&nbsp;global&nbsp;eth0<br />
&nbsp;&nbsp;&nbsp;&nbsp;inet&nbsp;192.168.0.99/24&nbsp;brd&nbsp;192.168.0.255&nbsp;scope&nbsp;global&nbsp;secondary&nbsp;eth0:0<br />
&nbsp;&nbsp;&nbsp;&nbsp;inet6&nbsp;fe80::20c:29ff:fea5:5b93/64&nbsp;scope&nbsp;link<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;valid_lft&nbsp;forever&nbsp;preferred_lft&nbsp;forever<br />
lb1:~#</p>
<p>You can check this again by running:</p>
<p class="command">ifconfig</p>
<p class="system">lb1:~#&nbsp;ifconfig<br />
eth0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Link&nbsp;encap:Ethernet&nbsp;&nbsp;HWaddr&nbsp;00:0C:29:A5:5B:93<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;inet&nbsp;addr:192.168.0.100&nbsp;&nbsp;Bcast:192.168.0.255&nbsp;&nbsp;Mask:255.255.255.0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;inet6&nbsp;addr:&nbsp;fe80::20c:29ff:fea5:5b93/64&nbsp;Scope:Link<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;UP&nbsp;BROADCAST&nbsp;RUNNING&nbsp;MULTICAST&nbsp;&nbsp;MTU:1500&nbsp;&nbsp;Metric:1<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RX&nbsp;packets:63983&nbsp;errors:0&nbsp;dropped:0&nbsp;overruns:0&nbsp;frame:0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TX&nbsp;packets:31480&nbsp;errors:0&nbsp;dropped:0&nbsp;overruns:0&nbsp;carrier:0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;collisions:0&nbsp;txqueuelen:1000<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RX&nbsp;bytes:92604963&nbsp;(88.3&nbsp;MiB)&nbsp;&nbsp;TX&nbsp;bytes:2689903&nbsp;(2.5&nbsp;MiB)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Interrupt:177&nbsp;Base&nbsp;address:0&#215;1400</p>
<p>eth0:0&nbsp;&nbsp;&nbsp;&nbsp;Link&nbsp;encap:Ethernet&nbsp;&nbsp;HWaddr&nbsp;00:0C:29:A5:5B:93<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;inet&nbsp;addr:192.168.0.99&nbsp;&nbsp;Bcast:192.168.0.255&nbsp;&nbsp;Mask:255.255.255.0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;UP&nbsp;BROADCAST&nbsp;RUNNING&nbsp;MULTICAST&nbsp;&nbsp;MTU:1500&nbsp;&nbsp;Metric:1<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Interrupt:177&nbsp;Base&nbsp;address:0&#215;1400</p>
<p>lo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Link&nbsp;encap:Local&nbsp;Loopback<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;inet&nbsp;addr:127.0.0.1&nbsp;&nbsp;Mask:255.0.0.0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;inet6&nbsp;addr:&nbsp;::1/128&nbsp;Scope:Host<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;UP&nbsp;LOOPBACK&nbsp;RUNNING&nbsp;&nbsp;MTU:16436&nbsp;&nbsp;Metric:1<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RX&nbsp;packets:56&nbsp;errors:0&nbsp;dropped:0&nbsp;overruns:0&nbsp;frame:0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TX&nbsp;packets:56&nbsp;errors:0&nbsp;dropped:0&nbsp;overruns:0&nbsp;carrier:0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;collisions:0&nbsp;txqueuelen:0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RX&nbsp;bytes:3888&nbsp;(3.7&nbsp;KiB)&nbsp;&nbsp;TX&nbsp;bytes:3888&nbsp;(3.7&nbsp;KiB)</p>
<p>lb1:~#</p>
<p>As <span class="system">lb2</span> is the passive load balancer, it should not be listening on the virtual IP address as long as <span class="system">lb1</span> is up. We can check that with:</p>
<p class="highlight">lb2:</p>
<p class="command">ip addr sh eth0</p>
<p>The output should look like this:</p>
<p class="system">lb2:~#&nbsp;ip&nbsp;addr&nbsp;sh&nbsp;eth0<br />
2:&nbsp;eth0:&nbsp;&lt;BROADCAST,MULTICAST,UP,10000&gt;&nbsp;mtu&nbsp;1500&nbsp;qdisc&nbsp;pfifo_fast&nbsp;qlen&nbsp;1000<br />
&nbsp;&nbsp;&nbsp;&nbsp;link/ether&nbsp;00:0c:29:e0:78:92&nbsp;brd&nbsp;ff:ff:ff:ff:ff:ff<br />
&nbsp;&nbsp;&nbsp;&nbsp;inet&nbsp;192.168.0.101/24&nbsp;brd&nbsp;192.168.0.255&nbsp;scope&nbsp;global&nbsp;eth0<br />
&nbsp;&nbsp;&nbsp;&nbsp;inet6&nbsp;fe80::20c:29ff:fee0:7892/64&nbsp;scope&nbsp;link<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;valid_lft&nbsp;forever&nbsp;preferred_lft&nbsp;forever<br />
lb2:~#</p>
<p>The output of </p>
<p class="command">ifconfig </p>
<p>shouldn&#8217;t display the virtual IP address either:</p>
<p class="system">lb2:~#&nbsp;ifconfig<br />
eth0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Link&nbsp;encap:Ethernet&nbsp;&nbsp;HWaddr&nbsp;00:0C:29:E0:78:92<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;inet&nbsp;addr:192.168.0.101&nbsp;&nbsp;Bcast:192.168.0.255&nbsp;&nbsp;Mask:255.255.255.0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;inet6&nbsp;addr:&nbsp;fe80::20c:29ff:fee0:7892/64&nbsp;Scope:Link<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;UP&nbsp;BROADCAST&nbsp;RUNNING&nbsp;MULTICAST&nbsp;&nbsp;MTU:1500&nbsp;&nbsp;Metric:1<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RX&nbsp;packets:75127&nbsp;errors:0&nbsp;dropped:0&nbsp;overruns:0&nbsp;frame:0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TX&nbsp;packets:42144&nbsp;errors:0&nbsp;dropped:0&nbsp;overruns:0&nbsp;carrier:0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;collisions:0&nbsp;txqueuelen:1000<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RX&nbsp;bytes:109669197&nbsp;(104.5&nbsp;MiB)&nbsp;&nbsp;TX&nbsp;bytes:3393369&nbsp;(3.2&nbsp;MiB)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Interrupt:169&nbsp;Base&nbsp;address:0&#215;1400</p>
<p>lo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Link&nbsp;encap:Local&nbsp;Loopback<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;inet&nbsp;addr:127.0.0.1&nbsp;&nbsp;Mask:255.0.0.0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;inet6&nbsp;addr:&nbsp;::1/128&nbsp;Scope:Host<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;UP&nbsp;LOOPBACK&nbsp;RUNNING&nbsp;&nbsp;MTU:16436&nbsp;&nbsp;Metric:1<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RX&nbsp;packets:56&nbsp;errors:0&nbsp;dropped:0&nbsp;overruns:0&nbsp;frame:0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TX&nbsp;packets:56&nbsp;errors:0&nbsp;dropped:0&nbsp;overruns:0&nbsp;carrier:0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;collisions:0&nbsp;txqueuelen:0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RX&nbsp;bytes:3888&nbsp;(3.7&nbsp;KiB)&nbsp;&nbsp;TX&nbsp;bytes:3888&nbsp;(3.7&nbsp;KiB)</p>
<p>lb2:~#</p>
<p>&nbsp;</p>
<h3>6 Starting Perlbal </h3>
<p>Now we can start Perlbal:</p>
<p class="highlight">lb1/lb2:</p>
<p class="command">perlbal &#8211;daemon</p>
<p>Of course, you don&#8217;t want to start Perlbal manually each time you boot the load balancers. Therefore we open <span class="system">/etc/rc.local</span>&#8230;</p>
<p class="command">vi /etc/rc.local</p>
<p>&#8230; and add the line <span class="system">/usr/local/bin/perlbal &#8211;daemon</span> to it (right before the <span class="system">exit 0</span> line):</p>
<tr>
<td class="">
<pre>#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing./usr/local/bin/perlbal --daemon
exit 0</pre>
</td>
</tr>
<p>This will make Perlbal start automatically whenever you boot the load balancers. </p>
<p>(To stop Perlbal, run</p>
<p class="command">killall perlbal </p>
<p>)</p>
<p>&nbsp; </p>
<h3>7 Testing</h3>
<p>Our high-availability load balancer is now up and running. </p>
<p>You can now make HTTP requests to the virtual IP address <span class="system">192.168.0.99</span> (or to any domain/hostname that is pointing to the virtual IP address), and you should get content from the backend web servers. </p>
<p>You can test its high-availability/failover capabilities by switching off one backend web server &#8211; the load balancer should then redirect all requests to the remaining backend web server. Afterwards, switch off the active load balancer (<span class="system">lb1</span>) &#8211; <span class="system">lb2</span> should take over immediately. You can check that by running:</p>
<p class="highlight">lb2:</p>
<p class="command">ip addr sh eth0</p>
<p>You should now see the virtual IP address in the output on <span class="system">lb2</span>:</p>
<p class="system">lb2:~#&nbsp;ip&nbsp;addr&nbsp;sh&nbsp;eth0<br />
2:&nbsp;eth0:&nbsp;&lt;BROADCAST,MULTICAST,UP,10000&gt;&nbsp;mtu&nbsp;1500&nbsp;qdisc&nbsp;pfifo_fast&nbsp;qlen&nbsp;1000<br />
&nbsp;&nbsp;&nbsp;&nbsp;link/ether&nbsp;00:0c:29:e0:78:92&nbsp;brd&nbsp;ff:ff:ff:ff:ff:ff<br />
&nbsp;&nbsp;&nbsp;&nbsp;inet&nbsp;192.168.0.101/24&nbsp;brd&nbsp;192.168.0.255&nbsp;scope&nbsp;global&nbsp;eth0<br />
&nbsp;&nbsp;&nbsp;&nbsp;inet&nbsp;192.168.0.99/24&nbsp;brd&nbsp;192.168.0.255&nbsp;scope&nbsp;global&nbsp;secondary&nbsp;eth0:0<br />
&nbsp;&nbsp;&nbsp;&nbsp;inet6&nbsp;fe80::20c:29ff:fee0:7892/64&nbsp;scope&nbsp;link<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;valid_lft&nbsp;forever&nbsp;preferred_lft&nbsp;forever<br />
lb2:~#</p>
<p>The same goes for the output of</p>
<p class="command">ifconfig</p>
<p>When <span class="system">lb1</span> comes up again, it will take over the master role again. </p>
<p>&nbsp;</p>
<h3>8 Virtual Host Support In Perlbal</h3>
<p>Perlbal suppports virtual hosts. Let&#8217;s assume we want requests for <span class="system">*.site.com</span> to be served by the hosts with the IP addresses <span class="system">192.168.0.102</span> and <span class="system">192.168.0.103</span>, and requests for <span class="system">*.example.com</span> by the hosts <span class="system">192.168.0.104</span> and <span class="system">192.168.0.105</span>. This is how <span class="system">/etc/perlbal/perlbal.conf</span> would look:</p>
<p class="command">vi /etc/perlbal/perlbal.conf</p>
<tr>
<td class="">
<pre>LOAD vhostsCREATE POOL webfarm1 POOL webfarm1 ADD 192.168.0.102:80 POOL webfarm1 ADD 192.168.0.103:80CREATE SERVICE balancer1 SET role= reverse_proxy SET pool= webfarm1 SET persist_client= on SET persist_backend = on SET verify_backend= on
ENABLE balancer1CREATE POOL webfarm2 POOL webfarm2 ADD 192.168.0.104:80 POOL webfarm2 ADD 192.168.0.105:80CREATE SERVICE balancer2 SET role= reverse_proxy SET pool= webfarm2 SET persist_client= on SET persist_backend = on SET verify_backend= on
ENABLE balancer2CREATE SERVICE vdemo SET listen = 192.168.0.99:80 SET role = selector SET plugins= vhosts SET persist_client = onVHOST *.site.com = balancer1 VHOST *.example.com= balancer2
ENABLE vdemo</pre>
</td>
</tr>
<p>&nbsp;</p>
<h3>9 Links</h3>
<ul>
<li> Perlbal: <a href="http://www.danga.com/perlbal/" target="_blank">http://www.danga.com/perlbal/</a></li>
<li>Heartbeat: <a href="http://www.linux-ha.org/Heartbeat" target="_blank">http://www.linux-ha.org/Heartbeat</a></li>
<li>Debian: <a href="http://www.debian.org/" target="_blank">http://www.debian.org</a></li>
</ul>
<div class="book">
<div class="nav">
<div class="links">
<div class="prev"><a href="setting-up-a-high-availability-load-balancer-with-perlbal-heartbeat-on-debian-etch" title="View the previous page.">previous</a></div>
<div class="next">&nbsp;</div>
<div class="up"><a href="setting-up-a-high-availability-load-balancer-with-perlbal-heartbeat-on-debian-etch" title="View this page&#39;s parent section.">up</a></div>
</div>
<div class="titles">
<div class="prev">Setting Up A High-Availability Load Balancer (With Failover and Session Support) With Perlbal/Heartbeat On Debian Etch</div>
</div>
</div>
</div>
<p>
<div class="copyright-footer">Copyright © 2009 Falko Timme<br />All Rights Reserved.</div>
</div>
</div>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Ftusforyou.com%2Fsetting-up-a-high-availability-load-balancer-with-perlbal-heartbeat-on-debian-etch-p2&amp;title=Setting+Up+A+High-Availability+Load+Balancer+%28With+Failover+and+Session+Support%29+With+Perlbal%2FHeartbeat+On+Debian+Etch++Page+2" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Ftusforyou.com%2Fsetting-up-a-high-availability-load-balancer-with-perlbal-heartbeat-on-debian-etch-p2&amp;title=Setting+Up+A+High-Availability+Load+Balancer+%28With+Failover+and+Session+Support%29+With+Perlbal%2FHeartbeat+On+Debian+Etch++Page+2" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Ftusforyou.com%2Fsetting-up-a-high-availability-load-balancer-with-perlbal-heartbeat-on-debian-etch-p2&amp;title=Setting+Up+A+High-Availability+Load+Balancer+%28With+Failover+and+Session+Support%29+With+Perlbal%2FHeartbeat+On+Debian+Etch++Page+2" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Ftusforyou.com%2Fsetting-up-a-high-availability-load-balancer-with-perlbal-heartbeat-on-debian-etch-p2&amp;headline=Setting+Up+A+High-Availability+Load+Balancer+%28With+Failover+and+Session+Support%29+With+Perlbal%2FHeartbeat+On+Debian+Etch++Page+2" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=Setting+Up+A+High-Availability+Load+Balancer+%28With+Failover+and+Session+Support%29+With+Perlbal%2FHeartbeat+On+Debian+Etch++Page+2&amp;url=http%3A%2F%2Ftusforyou.com%2Fsetting-up-a-high-availability-load-balancer-with-perlbal-heartbeat-on-debian-etch-p2" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Setting+Up+A+High-Availability+Load+Balancer+%28With+Failover+and+Session+Support%29+With+Perlbal%2FHeartbeat+On+Debian+Etch++Page+2&amp;u=http%3A%2F%2Ftusforyou.com%2Fsetting-up-a-high-availability-load-balancer-with-perlbal-heartbeat-on-debian-etch-p2" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=Setting+Up+A+High-Availability+Load+Balancer+%28With+Failover+and+Session+Support%29+With+Perlbal%2FHeartbeat+On+Debian+Etch++Page+2&amp;url=http%3A%2F%2Ftusforyou.com%2Fsetting-up-a-high-availability-load-balancer-with-perlbal-heartbeat-on-debian-etch-p2" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Setting+Up+A+High-Availability+Load+Balancer+%28With+Failover+and+Session+Support%29+With+Perlbal%2FHeartbeat+On+Debian+Etch++Page+2&amp;url=http%3A%2F%2Ftusforyou.com%2Fsetting-up-a-high-availability-load-balancer-with-perlbal-heartbeat-on-debian-etch-p2" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Setting+Up+A+High-Availability+Load+Balancer+%28With+Failover+and+Session+Support%29+With+Perlbal%2FHeartbeat+On+Debian+Etch++Page+2&amp;url=http%3A%2F%2Ftusforyou.com%2Fsetting-up-a-high-availability-load-balancer-with-perlbal-heartbeat-on-debian-etch-p2" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Ftusforyou.com%2Fsetting-up-a-high-availability-load-balancer-with-perlbal-heartbeat-on-debian-etch-p2&amp;title=Setting+Up+A+High-Availability+Load+Balancer+%28With+Failover+and+Session+Support%29+With+Perlbal%2FHeartbeat+On+Debian+Etch++Page+2&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Ftusforyou.com%2Fsetting-up-a-high-availability-load-balancer-with-perlbal-heartbeat-on-debian-etch-p2" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Ftusforyou.com%2Fsetting-up-a-high-availability-load-balancer-with-perlbal-heartbeat-on-debian-etch-p2" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Ftusforyou.com%2Fsetting-up-a-high-availability-load-balancer-with-perlbal-heartbeat-on-debian-etch-p2" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://tusforyou.com/setting-up-a-high-availability-load-balancer-with-perlbal-heartbeat-on-debian-etch-p2/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting Up A High-Availability Load Balancer (With Failover and Session Support) With Perlbal/Heartbeat On Debian Etch</title>
		<link>http://tusforyou.com/setting-up-a-high-availability-load-balancer-with-failover-and-session-support-with-poundkeepalived-on-debian-etch</link>
		<comments>http://tusforyou.com/setting-up-a-high-availability-load-balancer-with-failover-and-session-support-with-poundkeepalived-on-debian-etch#comments</comments>
		<pubDate>Fri, 21 May 2010 18:47:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Balancer]]></category>
		<category><![CDATA[Failover]]></category>
		<category><![CDATA[HighAvailability]]></category>
		<category><![CDATA[Load]]></category>
		<category><![CDATA[Perlbal/Heartbeat]]></category>
		<category><![CDATA[Session]]></category>
		<category><![CDATA[Setting]]></category>
		<category><![CDATA[Support]]></category>
		<category><![CDATA[With]]></category>

		<guid isPermaLink="false">http://tusforyou.com/setting-up-a-high-availability-load-balancer-with-failover-and-session-support-with-poundkeepalived-on-debian-etch</guid>
		<description><![CDATA[This article explains how to set up a two-node load balancer in an active/passive configuration with Perlbal and heartbeat on Debian Etch. The load balancer sits between the user and two (or more) backend Apache web servers that hold the same content. Not only does the load balancer distribute the requests to the two backend [...]]]></description>
			<content:encoded><![CDATA[<p>This article explains how to set up a two-node load balancer in an active/passive configuration with Perlbal and heartbeat on Debian Etch. The load balancer sits between the user and two (or more) backend Apache web servers that hold the same content. Not only does the load balancer distribute the requests to the two backend Apache servers, it also checks the health of the backend servers. If one of them is down, all requests will automatically be redirected to the remaining backend server. In addition to that, the two load balancer nodes monitor each other using heartbeat, and if the master fails, the slave becomes the master, which means the users will not notice any disruption of the service. Perlbal is session-aware, which means you can use it with any web application that makes use of sessions (such as forums, shopping carts, etc.).<span id="more-4708"></span>
<div class="node">
<div class="content">
<h2>Setting Up A High-Availability Load Balancer (With Failover and Session Support) With Perlbal/Heartbeat On Debian Etch </h2>
<p>Version 1.0 <br /> Author: Falko Timme &lt;ft [at] falkotimme [dot] com&gt; <br />
Last edited 12/29/2008</p>
<p>This article explains how to set up a two-node load balancer in an active/passive configuration with <a href="http://www.danga.com/perlbal/" target="_blank">Perlbal</a> and heartbeat on Debian Etch. The load balancer sits between the user and two (or more) backend Apache web servers that hold the same content. Not only does the load balancer distribute the requests to the two backend Apache servers, it also checks the health of the backend servers. If one of them is down, all requests will automatically be redirected to the remaining backend server. In addition to that, the two load balancer nodes monitor each other using heartbeat, and if the master fails, the slave becomes the master, which means the users will not notice any disruption of the service. Perlbal is session-aware, which means you can use it with any web application that makes use of sessions (such as forums, shopping carts, etc.).</p>
<p>I do not issue any guarantee that this will work for you!</p>
<p>&nbsp;</p>
<h3>1 Preliminary Note</h3>
<p>In this tutorial I will use the following hosts:</p>
<ul>
<li>Load Balancer 1: <span class="system">lb1.example.com</span>, IP address: <span class="system">192.168.0.100</span></li>
<li>Load Balancer 2: <span class="system">lb2.example.com</span>, IP address: <span class="system">192.168.0.101</span></li>
<li>Web Server 1: <span class="system">http1.example.com</span>, IP address: <span class="system">192.168.0.102</span></li>
<li>Web Server 2: <span class="system">http2.example.com</span>, IP address: <span class="system">192.168.0.103</span></li>
<li>We also need a virtual IP address that floats between <span class="system">lb1</span> and <span class="system">lb2</span>: <span class="system">192.168.0.99</span></li>
</ul>
<p>Here&#8217;s a little diagram that shows our setup:</p>
<p class="system">&nbsp;&nbsp;&nbsp;&nbsp;shared&nbsp;IP=192.168.0.99<br />
&nbsp;192.168.0.100&nbsp;&nbsp;192.168.0.101&nbsp;192.168.0.102 192.168.0.103<br />
&nbsp;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;-<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+&#8211;+&#8211;+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+&#8211;+&#8211;+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+&#8212;-+&#8212;-+&nbsp;+&#8212;-+&#8212;-+<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;lb1&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;lb2&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;http1&nbsp;&nbsp;|&nbsp;|&nbsp;&nbsp;http2&nbsp;&nbsp;|<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+&#8212;&#8211;+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+&#8212;&#8211;+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+&#8212;&#8212;&#8212;+&nbsp;+&#8212;&#8212;&#8212;+<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Perlbal&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Perlbal&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2&nbsp;web&nbsp;servers (Apache) <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;heartbeat &nbsp;&nbsp;&nbsp;heartbeat</p>
<p>The shared (virtual) IP address is no problem as long as you&#8217;re in your own LAN where you can assign IP addresses as you like. However, if you want to use this setup with public IP addresses, you need to find a hoster where you can rent two servers (the load balancer nodes) in the same subnet; you can then use a free IP address in this subnet for the virtual IP address.</p>
<p><span class="system">http1</span> and <span class="system">http2</span> are standard Debian Etch Apache setups with the document root <span class="system">/var/www</span> (the configuration of this default vhost is stored in <span class="system">/etc/apache2/sites-available/default</span>). If your document root differs, you might have to adjust this guide a bit. </p>
<p>&nbsp;</p>
<h3>2 Preparing The Backend Web Servers</h3>
<p>We will configure Perlbal as a transparent proxy, i.e., it will pass on the original user&#8217;s IP address in a field called <span class="system">X-Forwarded-For</span> to the backend web servers. Of course, the backend web servers should log the original user&#8217;s IP address in their access logs instead of the IP addresses of our load balancers. Therefore we must modify the <span class="system">LogFormat</span> line in <span class="system">/etc/apache2/apache2.conf</span> and replace <span class="system">%h</span> with <span class="system">%{X-Forwarded-For}i</span>:</p>
<tr>
<td width="320">
<div style="height:250px;width:300px;margin: 10px 10px 10px 10px"></div>
<div style="height:250px;width:300px;margin: 10px 10px 10px 10px"></div>
</td>
<td width="320">
<div style="height:600px;width:300px;margin: 10px 10px 10px 10px"></div>
</td>
</tr>
<p class="highlight">http1/http2:</p>
<p class="command">vi /etc/apache2/apache2.conf</p>
<tr>
<td class="">
<pre>[...]
#LogFormat "%h %l %u %t \"%r\" %&gt;s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %&gt;s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
[...]</pre>
</td>
</tr>
<p>Afterwards we restart Apache:</p>
<p class="command">/etc/init.d/apache2 restart</p>
<p>We are finished already with the backend servers; the rest of the configuration happens on the two load balancer nodes. </p>
<p>&nbsp;</p>
<h3>3 Installing Perlbal </h3>
<p>Perlbal is not available as a package for Debian Etch, but we can install it through the Perl shell. Before we do this, we install a few prerequisites:</p>
<p class="highlight">lb1/lb2:</p>
<p class="command">apt-get install build-essential unzip lynx ncftp perl</p>
<p>Afterwards we invoke the Perl shell as follows:</p>
<p class="command">perl -MCPAN -e shell</p>
<p>On the Perl shell, we run the following three commands to install Perlbal:</p>
<p class="command">force install HTTP::Date</p>
<p class="command">install IO::AIO</p>
<p class="command">force install Perlbal</p>
<p>Type</p>
<p class="command">q</p>
<p>to leave the Perl shell. </p>
<p>&nbsp;</p>
<h3>4 Configuring The Load Balancers</h3>
<p>Perlbal expects its configuration in the file <span class="system">/etc/perlbal/perlbal.conf</span> which we create as follows: </p>
<p class="highlight">lb1/lb2:</p>
<p class="command">mkdir /etc/perlbal<br />
vi /etc/perlbal/perlbal.conf</p>
<tr>
<td class="">
<pre>CREATE POOL webfarm POOL webfarm ADD 192.168.0.102:80 POOL webfarm ADD 192.168.0.103:80CREATE SERVICE balancer SET listen= 192.168.0.99:80 SET role= reverse_proxy SET pool= webfarm SET persist_client= on SET persist_backend = on SET verify_backend= on
ENABLE balancer</pre>
</td>
</tr>
<p>You won&#8217;t find much documentation about the Perlbal configuration on the Internet, so the best way to learn about the Perlbal configuration options is to download the latest Perlbal release from <a href="http://code.google.com/p/perlbal/downloads/list" target="_blank">http://code.google.com/p/perlbal/downloads/list</a> (e.g. <a href="http://perlbal.googlecode.com/files/Perlbal-1.70.tar.gz">http://perlbal.googlecode.com/files/Perlbal-1.70.tar.gz</a>). Uncompress it and then take a look at the files in the <span class="system">conf/</span> and <span class="system">doc/</span> subdirectories. You will find some configuration examples and a list of configuration options there. </p>
<div class="book">
<div class="tree">
<div class="menu">
<ul>
<li class="leaf"><a href="setting-up-a-high-availability-load-balancer-with-perlbal-heartbeat-on-debian-etch-p2">Setting Up A High-Availability Load Balancer (With Failover and Session Support) With Perlbal/Heartbeat On Debian Etch &#8211; Page 2</a></li>
</ul>
</div>
</div>
<div class="nav">
<div class="links">
<div class="prev">&nbsp;</div>
<div class="next"><a href="setting-up-a-high-availability-load-balancer-with-perlbal-heartbeat-on-debian-etch-p2" title="View the next page.">next</a></div>
</div>
<div class="titles">
<div class="next">Setting Up A High-Availability Load Balancer (With Failover and Session Support) With Perlbal/Heartbeat On Debian Etch &#8211; Page 2</div>
</div>
</div>
</div>
<p>
<div class="copyright-footer">Copyright © 2009 Falko Timme<br />All Rights Reserved.</div>
</div>
</div>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Ftusforyou.com%2Fsetting-up-a-high-availability-load-balancer-with-failover-and-session-support-with-poundkeepalived-on-debian-etch&amp;title=Setting+Up+A+High-Availability+Load+Balancer+%28With+Failover+and+Session+Support%29+With+Perlbal%2FHeartbeat+On+Debian+Etch" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Ftusforyou.com%2Fsetting-up-a-high-availability-load-balancer-with-failover-and-session-support-with-poundkeepalived-on-debian-etch&amp;title=Setting+Up+A+High-Availability+Load+Balancer+%28With+Failover+and+Session+Support%29+With+Perlbal%2FHeartbeat+On+Debian+Etch" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Ftusforyou.com%2Fsetting-up-a-high-availability-load-balancer-with-failover-and-session-support-with-poundkeepalived-on-debian-etch&amp;title=Setting+Up+A+High-Availability+Load+Balancer+%28With+Failover+and+Session+Support%29+With+Perlbal%2FHeartbeat+On+Debian+Etch" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Ftusforyou.com%2Fsetting-up-a-high-availability-load-balancer-with-failover-and-session-support-with-poundkeepalived-on-debian-etch&amp;headline=Setting+Up+A+High-Availability+Load+Balancer+%28With+Failover+and+Session+Support%29+With+Perlbal%2FHeartbeat+On+Debian+Etch" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=Setting+Up+A+High-Availability+Load+Balancer+%28With+Failover+and+Session+Support%29+With+Perlbal%2FHeartbeat+On+Debian+Etch&amp;url=http%3A%2F%2Ftusforyou.com%2Fsetting-up-a-high-availability-load-balancer-with-failover-and-session-support-with-poundkeepalived-on-debian-etch" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Setting+Up+A+High-Availability+Load+Balancer+%28With+Failover+and+Session+Support%29+With+Perlbal%2FHeartbeat+On+Debian+Etch&amp;u=http%3A%2F%2Ftusforyou.com%2Fsetting-up-a-high-availability-load-balancer-with-failover-and-session-support-with-poundkeepalived-on-debian-etch" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=Setting+Up+A+High-Availability+Load+Balancer+%28With+Failover+and+Session+Support%29+With+Perlbal%2FHeartbeat+On+Debian+Etch&amp;url=http%3A%2F%2Ftusforyou.com%2Fsetting-up-a-high-availability-load-balancer-with-failover-and-session-support-with-poundkeepalived-on-debian-etch" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Setting+Up+A+High-Availability+Load+Balancer+%28With+Failover+and+Session+Support%29+With+Perlbal%2FHeartbeat+On+Debian+Etch&amp;url=http%3A%2F%2Ftusforyou.com%2Fsetting-up-a-high-availability-load-balancer-with-failover-and-session-support-with-poundkeepalived-on-debian-etch" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Setting+Up+A+High-Availability+Load+Balancer+%28With+Failover+and+Session+Support%29+With+Perlbal%2FHeartbeat+On+Debian+Etch&amp;url=http%3A%2F%2Ftusforyou.com%2Fsetting-up-a-high-availability-load-balancer-with-failover-and-session-support-with-poundkeepalived-on-debian-etch" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Ftusforyou.com%2Fsetting-up-a-high-availability-load-balancer-with-failover-and-session-support-with-poundkeepalived-on-debian-etch&amp;title=Setting+Up+A+High-Availability+Load+Balancer+%28With+Failover+and+Session+Support%29+With+Perlbal%2FHeartbeat+On+Debian+Etch&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Ftusforyou.com%2Fsetting-up-a-high-availability-load-balancer-with-failover-and-session-support-with-poundkeepalived-on-debian-etch" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Ftusforyou.com%2Fsetting-up-a-high-availability-load-balancer-with-failover-and-session-support-with-poundkeepalived-on-debian-etch" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Ftusforyou.com%2Fsetting-up-a-high-availability-load-balancer-with-failover-and-session-support-with-poundkeepalived-on-debian-etch" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://tusforyou.com/setting-up-a-high-availability-load-balancer-with-failover-and-session-support-with-poundkeepalived-on-debian-etch/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Install Django On Debian Etch (Apache2/mod_python)</title>
		<link>http://tusforyou.com/installing-django-on-debian-etch-apache2-mod_python</link>
		<comments>http://tusforyou.com/installing-django-on-debian-etch-apache2-mod_python#comments</comments>
		<pubDate>Thu, 13 May 2010 17:58:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Apache2/mod_python]]></category>
		<category><![CDATA[Django]]></category>
		<category><![CDATA[Etch]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[This tutorial explains how to install Django on a Debian Etch server. Django is a web framework that allows to develop Python web applications quickly with as much automation as possible. I will use it with Apache2 and mod_python in this guide. How To Install Django On Debian Etch (Apache2/mod_python) Version 1.0 Author: Falko Timme [...]]]></description>
			<content:encoded><![CDATA[<p>This tutorial explains how to install Django<br />
on a Debian Etch server. Django is a web framework that allows to<br />
develop Python web applications quickly with as much automation as<br />
possible. I will use it with Apache2 and mod_python in this guide.<span id="more-1066"></span>
<div class="node">
<div class="content">
<h2>How To Install Django On Debian Etch (Apache2/mod_python) </h2>
<p>Version 1.0 <br /> Author: Falko Timme &lt;ft [at] falkotimme [dot] com&gt; <br /> Last edited 07/16/2008</p>
<p>This tutorial explains how to install <a href="http://www.djangoproject.com/" target="_blank">Django</a> on a Debian Etch server. Django is a web framework that allows to develop Python web applications quickly with as much automation as possible. I will use it with Apache2 and mod_python in this guide. </p>
<p>This howto is meant as a practical guide; it does not cover the theoretical backgrounds. They are treated in a lot of other documents in the web. </p>
<p>This document comes without warranty of any kind! I want to say that this is not the only way of setting up such a system. There are many ways of achieving this goal but this is the way I take. I do not issue any guarantee that this will work for you!</p>
<p>&nbsp;</p>
<h3>1 Install MySQL</h3>
<p>Django can use multiple database backends, e.g. PostgreSQL, MySQL, SQLite, etc. If you want to use MySQL, you can install it as follows:</p>
<p class="command">apt-get install mysql-server mysql-client</p>
<p>We want MySQL to listen on all interfaces, not just localhost, therefore we edit <span class="system">/etc/mysql/my.cnf</span> and comment out the line <span class="system">bind-address = 127.0.0.1</span>:</p>
<p class="command">vi /etc/mysql/my.cnf</p>
<tr>
<td class="">
<pre>[...]
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
#bind-address = 127.0.0.1
[...]</pre>
</td>
</tr>
<p>Then we restart MySQL:</p>
<p class="command">/etc/init.d/mysql restart</p>
<p>Now check that networking is enabled. Run</p>
<p class="command">netstat -tap | grep mysql</p>
<p>The output should look like this:</p>
<p class="system">server1:~#&nbsp;netstat&nbsp;-tap&nbsp;|&nbsp;grep&nbsp;mysql<br />
tcp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;*:mysql&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*:*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LISTEN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3085/mysqld<br />
server1:~#</p>
<p> Run</p>
<p class="command">mysqladmin -u root password yourrootsqlpassword<br />
mysqladmin -h server1.example.com -u root password yourrootsqlpassword</p>
<p>to set a password for the user root (otherwise anybody can access your MySQL database!).</p>
<h3>&nbsp;</h3>
<h3>2 Install Apache And mod_python</h3>
<p>If Apache2 and mod_python aren&#8217;t already installed on your system, you can install them as follows:</p>
<p class="command">apt-get install apache2 apache2-doc apache2-mpm-prefork apache2-utils libexpat1 ssl-cert libapache2-mod-python</p>
<p>&nbsp;</p>
<h3>3 Install Django</h3>
<p>In order to install Django and the Python MySQL bindings, we run:</p>
<p class="command">apt-get install python-django python-mysqldb</p>
<p>&nbsp;</p>
<h3>4 Configure Apache</h3>
<p>I will use <span class="system">/var/www</span> here as the document root of my virtual host and <span class="system">/etc/apache2/sites-available/default</span> as the file containing the configuration of my virtual host. Adjust this to your circumstances. </p>
<p>Before we configure Apache, we must create a Django project (e.g. called <span class="system">mysite</span>) (see <a href="http://www.djangoproject.com/documentation/tutorial01/" target="_blank">http://www.djangoproject.com/documentation/tutorial01/</a>). For security reasons I create that project outside my document root <span class="system">/var/www</span> (e.g. in <span class="system">/home/mycode</span>):</p>
<p class="command">mkdir /home/mycode<br /> cd /home/mycode<br />
/usr/share/python-support/python-django/django/bin/django-admin.py startproject mysite</p>
<p>This will create the directory <span class="system">/home/mycode/mysite</span> with some Python files in it. </p>
<p>Now with the project <span class="system">mysite</span> created, we can configure Apache. I open my vhost configuration in <span class="system">/etc/apache2/sites-available/default</span> and place the following lines between the <span class="system">&lt;VirtualHost &#8230; &gt;&#8230;&lt;/VirtualHost&gt;</span> container:</p>
<p class="command">vi /etc/apache2/sites-available/default</p>
<tr>
<td class="">
<pre>[...]
&lt;Location "/mysite"&gt; SetHandler python-program PythonHandler django.core.handlers.modpython SetEnv DJANGO_SETTINGS_MODULE mysite.settings PythonDebug On PythonPath "['/home/mycode'] + sys.path"
&lt;/Location&gt;
[...]</pre>
</td>
</tr>
<p>The path in the first line (<span class="system">&lt;Location &#8220;/mysite&#8221;&gt;</span>) refers to the URL &#8211; meaning this configuration will be used if you use <span class="system">/mysite</span> in the URL (e.g. <span class="system">http://www.example.com/mysite</span>). You can change this to your likings. Please adjust the other values (<span class="system">SetEnv DJANGO_SETTINGS_MODULE mysite.settings</span> and <span class="system">PythonPath &#8220;['/home/mycode'] + sys.path&#8221;</span>) to the name of your project and the path where it is located. </p>
<p>Restart Apache afterwards:</p>
<p class="command">/etc/init.d/apache2 restart</p>
<p>Now you can access <span class="system">http://www.example.com/mysite</span> in a browser. If everything went well, you should see something like this:</p>
<p><a href="http://tusforyou.com/images/django_debian_etch/1.png" class="thickbox"><img src="http://tusforyou.com/images/django_debian_etch/1.png" height="393" width="550" title="How To Install Django On Debian Etch (Apache2/mod python)" alt="1 How To Install Django On Debian Etch (Apache2/mod python)" />
<div><img src="http://tusforyou.com/images/click_to_enlarge.png" width="100" height="12" border="0" alt="Click to enlarge" title="How To Install Django On Debian Etch (Apache2/mod python)" /> </div>
<p></a>(JavaScript must be enabled in your browser to view the large image as an image overlay.) </p>
<p>This means Django has been successfully installed, and you can now use it to develop your Python web applications (please refer to <a href="http://www.djangoproject.com/documentation/" target="_blank">http://www.djangoproject.com/documentation/</a> to learn how to develop web applications with Django). </p>
<p>&nbsp;</p>
<h3>5 Connect To A MySQL Database From A Django Project</h3>
<p>If you want to use a MySQL database in your Django project, you should first create that database (e.g. <span class="system">mysite</span>) and a database user (e.g. <span class="system">mysiteadmin</span>) for that database:</p>
<p class="command">mysql -u root -p</p>
<p class="command">CREATE DATABASE mysite;<br /> GRANT ALL ON mysite.* TO &#8216;mysiteadmin&#8217;@'localhost&#8217; IDENTIFIED BY &#8216;mysiteadmin_password&#8217;;<br /> GRANT ALL ON mysite.* TO &#8216;mysiteadmin&#8217;@'localhost.localdomain&#8217; IDENTIFIED BY &#8216;mysiteadmin_password&#8217;;<br /> FLUSH PRIVILEGES;<br /> quit;</p>
<p>Then open the <span class="system">settings.py</span> file in the project folder (e.g. <span class="system">/home/mycode/mysite</span>) and modify the database settings, e.g. as follows:</p>
<p class="command">vi /home/mycode/mysite/settings.py</p>
<tr>
<td class="">
<pre>[...]
DATABASE_ENGINE = 'mysql' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'ado_mssql'.
DATABASE_NAME = 'mysite' # Or path to database file if using sqlite3.
DATABASE_USER = 'mysiteadmin' # Not used with sqlite3.
DATABASE_PASSWORD = 'mysiteadmin_password' # Not used with sqlite3.
DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3.
DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3.
[...]</pre>
</td>
</tr>
<p>&nbsp;</p>
<h3>6 Links</h3>
<ul>
<li> Django: <a href="http://www.djangoproject.com/" target="_blank">http://www.djangoproject.com</a></li>
<li>Python: <a href="http://www.python.org/" target="_blank">http://www.python.org</a></li>
<li>Debian: <a href="http://www.debian.org/" target="_blank">http://www.debian.org</a></li>
</ul>
<p>
<div class="copyright-footer">Copyright © 2008 Falko Timme<br />All Rights Reserved.</div>
</div>
</div>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Ftusforyou.com%2Finstalling-django-on-debian-etch-apache2-mod_python&amp;title=How+To+Install+Django+On+Debian+Etch+%28Apache2%2Fmod_python%29" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Ftusforyou.com%2Finstalling-django-on-debian-etch-apache2-mod_python&amp;title=How+To+Install+Django+On+Debian+Etch+%28Apache2%2Fmod_python%29" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Ftusforyou.com%2Finstalling-django-on-debian-etch-apache2-mod_python&amp;title=How+To+Install+Django+On+Debian+Etch+%28Apache2%2Fmod_python%29" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Ftusforyou.com%2Finstalling-django-on-debian-etch-apache2-mod_python&amp;headline=How+To+Install+Django+On+Debian+Etch+%28Apache2%2Fmod_python%29" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=How+To+Install+Django+On+Debian+Etch+%28Apache2%2Fmod_python%29&amp;url=http%3A%2F%2Ftusforyou.com%2Finstalling-django-on-debian-etch-apache2-mod_python" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=How+To+Install+Django+On+Debian+Etch+%28Apache2%2Fmod_python%29&amp;u=http%3A%2F%2Ftusforyou.com%2Finstalling-django-on-debian-etch-apache2-mod_python" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=How+To+Install+Django+On+Debian+Etch+%28Apache2%2Fmod_python%29&amp;url=http%3A%2F%2Ftusforyou.com%2Finstalling-django-on-debian-etch-apache2-mod_python" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=How+To+Install+Django+On+Debian+Etch+%28Apache2%2Fmod_python%29&amp;url=http%3A%2F%2Ftusforyou.com%2Finstalling-django-on-debian-etch-apache2-mod_python" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=How+To+Install+Django+On+Debian+Etch+%28Apache2%2Fmod_python%29&amp;url=http%3A%2F%2Ftusforyou.com%2Finstalling-django-on-debian-etch-apache2-mod_python" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Ftusforyou.com%2Finstalling-django-on-debian-etch-apache2-mod_python&amp;title=How+To+Install+Django+On+Debian+Etch+%28Apache2%2Fmod_python%29&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Ftusforyou.com%2Finstalling-django-on-debian-etch-apache2-mod_python" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Ftusforyou.com%2Finstalling-django-on-debian-etch-apache2-mod_python" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Ftusforyou.com%2Finstalling-django-on-debian-etch-apache2-mod_python" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://tusforyou.com/installing-django-on-debian-etch-apache2-mod_python/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Patch BIND9 Against DNS Cache Poisoning On Debian Etch</title>
		<link>http://tusforyou.com/how-to-patch-bind-to-avoid-cache-poisoning-debian-etch</link>
		<comments>http://tusforyou.com/how-to-patch-bind-to-avoid-cache-poisoning-debian-etch#comments</comments>
		<pubDate>Thu, 13 May 2010 17:58:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[BIND9]]></category>
		<category><![CDATA[Cache]]></category>
		<category><![CDATA[Etch]]></category>
		<category><![CDATA[Patch]]></category>
		<category><![CDATA[Poisoning]]></category>

		<guid isPermaLink="false">http://tusforyou.com/how-to-patch-bind-to-avoid-cache-poisoning-debian-etch</guid>
		<description><![CDATA[This article explains how you can fix a BIND9 nameserver on a Debian Etch system so that it is not vulnerable anymore to DNS cache poisoning. How To Patch BIND9 Against DNS Cache Poisoning On Debian Etch Version 1.0 Author: Falko Timme &#60;ft [at] falkotimme [dot] com&#62; Last edited 07/28/2008 This article explains how you [...]]]></description>
			<content:encoded><![CDATA[<p>This article explains how you can fix a BIND9 nameserver on a Debian Etch system so that it is not vulnerable anymore to DNS cache poisoning.<span id="more-1064"></span>
<div class="node">
<div class="content">
<h2>How To Patch BIND9 Against DNS Cache Poisoning On Debian Etch </h2>
<p>Version 1.0 <br /> Author: Falko Timme &lt;ft [at] falkotimme [dot] com&gt; <br /> Last edited 07/28/2008</p>
<p>This article explains how you can fix a BIND9 nameserver on a Debian Etch system so that it is not vulnerable anymore to <a href="http://amd.co.at/dns.htm" target="_blank">DNS cache poisoning</a>. </p>
<p>This document comes without warranty of any kind!I do not issue any guarantee that this will work for you!</p>
<p>&nbsp;</p>
<h3>1 Checking If BIND Is Vulnerable</h3>
<p>Run the following command against your nameserver to find out if it is vulnerable (replace <span class="system">ns1.example.com</span> with your own nameserver address):</p>
<p class="command">dig +short @ns1.example.com porttest.dns-oarc.net TXT </p>
<p class="system">mh1:~# dig +short @ns1.example.com porttest.dns-oarc.net TXT<br /> z.y.x.w.v.u.t.s.r.q.p.o.n.m.l.k.j.i.h.g.f.e.d.c.b.a.pt.dns-oarc.net.<br /> &#8220;1.2.3.4 is POOR: 26 queries in 4.4 seconds from 1 ports with std dev 0.00&#8243;<br />
mh1:~#</p>
<p><span class="system">POOR</span> indicates that BIND is vulnerable. In this case you <strong>must</strong> patch BIND.</p>
<p>If you don&#8217;t get any answer at all, this means that your DNS server is no recursive resolver which means it doesn&#8217;t answer queries for domains that it isn&#8217;t authoritative for. In this case you&#8217;re not vulnerable to cache poisoning, but still I strongly advise to update BIND! </p>
<p>&nbsp;</p>
<h3>2 Patching BIND</h3>
<p>This is not so much a patch, but an update. Simply run</p>
<p class="command">apt-get install bind9 bind9-host</p>
<p>This will install the updated BIND packages from the Debian repositories.</p>
<p>Afterwards open <span class="system">/etc/bind/named.conf</span> and modify the <span class="system">options</span> section. If you don&#8217;t need a recursive resolver (i.e., if your nameserver should answer only queries for domains that it is responsible for), add <span class="system">allow-recursion { none; };</span>. That way you turn off caching for other domains. The second line you should add is <span class="system">dnssec-enable yes;</span> &#8211; this makes that BIND answers queries on random ports which are harder to guess for hackers (remember the answer to our dig command in chapter 1: <span class="system">[...]26 queries in 4.4 seconds from <strong>1</strong> ports[...]</span> &#8211; BIND was answering on only one port&#8230;). </p>
<p><strong>Correction:</strong> I&#8217;ve just received the following email from Alan Clegg:</p>
<blockquote><p><em>Good day!</em></p>
<p><em>I just read your writeup at:</em></p>
<p><em>http://www.tusforyou.com/how-to-patch-bind-to-avoid-cache-poisoning-debian-etch</em></p>
<p><em>and have a couple of comments.</em></p>
<p><em>First off, thanks for writing this. We need as many people to fix this<br /> problem as possible.</em></p>
<p><em>Secondly, there is a minor error that should be corrected. You state:</em></p>
<p><em>&#8220;The second line you should add is dnssec-enable yes; &#8211; this makes that<br /> BIND answers queries on random ports which are harder to guess for hackers&#8221;</em></p>
<p><em>Actually, this line enables the server to respond with DNSSEC records<br /> when the &#8220;DO&#8221; (DNSSEC OK) bit is set in the question being asked.</em></p>
<p><em>What you want people to look for is a statement like:</em></p>
<p><em> query-source [...] port XX;</em></p>
<p><em>Where the XX is a fixed port number on which the queries from this<br /> system are to be sent. This undoes everything that the new versions of<br /> BIND do to randomize the UDP source port.</em></p>
<p><em>If you have any questions, please feel free to send e-mail.</em></p>
<p><em>Alan Clegg<br /> Internet Systems Consortium (ISC)<br /> Training and Support</em></p>
</blockquote>
<p class="command">vi /etc/bind/named.conf</p>
<tr>
<td class="">
<pre>[...]
options { pid-file "/var/run/bind/run/named.pid"; directory "/etc/bind"; auth-nxdomain no; allow-recursion { none; }; dnssec-enable yes; /** If there is a firewall between you and nameservers you want* to talk to, you might need to uncomment the query-source* directive below.Previous versions of BIND always asked* questions using port 53, but BIND 8.1 uses an unprivileged* port by default.*/ // query-source address * port 53;
};
[...]</pre>
</td>
</tr>
<p>Restart BIND afterwards:</p>
<p class="command">/etc/init.d/bind9 restart</p>
<p>(If you&#8217;re using ISPConfig, your changes will be overwritten by ISPConfig. To prevent this, we take the named.conf template file <span class="system">/root/ispconfig/isp/conf/named.conf.master</span>, modify it as shown above, and save the modified template in the <span class="system">/root/ispconfig/isp/conf/customized_templates</span> directory =&gt; <span class="system">/root/ispconfig/isp/conf/customized_templates/named.conf.master</span>. Please also modify <span class="system">/etc/bind/named.conf</span> as shown above in addition to that.)</p>
<p>&nbsp;</p>
<h3>3 Checking BIND Again</h3>
<p>Now we run the query from chapter 1 again:</p>
<p class="command">dig +short @ns1.example.com porttest.dns-oarc.net TXT</p>
<p>If all went well, it should now show <span class="system">GOOD</span> instead of <span class="system">POOR</span>, and it should use more than just one port:</p>
<p class="system">mh1:~# dig +short @ns1.example.com porttest.dns-oarc.net TXT<br /> z.y.x.w.v.u.t.s.r.q.p.o.n.m.l.k.j.i.h.g.f.e.d.c.b.a.pt.dns-oarc.net.<br /> &#8220;1.2.3.4 is <strong>GOOD</strong>: 26 queries in 4.4 seconds from <strong>26</strong> ports with std dev 20195.32&#8243;<br />
mh1:~#</p>
<p>Congratulations, you have just fixed BIND! </p>
<p>You can also run the dig command against your ISP&#8217;s nameservers to find out if their nameservers are still vulnerable. If they are, you should urge your ISP to update their nameservers! </p>
<p>
<div class="copyright-footer">Copyright © 2008 Falko Timme<br />All Rights Reserved.</div>
</div>
</div>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Ftusforyou.com%2Fhow-to-patch-bind-to-avoid-cache-poisoning-debian-etch&amp;title=How+To+Patch+BIND9+Against+DNS+Cache+Poisoning+On+Debian+Etch" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Ftusforyou.com%2Fhow-to-patch-bind-to-avoid-cache-poisoning-debian-etch&amp;title=How+To+Patch+BIND9+Against+DNS+Cache+Poisoning+On+Debian+Etch" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Ftusforyou.com%2Fhow-to-patch-bind-to-avoid-cache-poisoning-debian-etch&amp;title=How+To+Patch+BIND9+Against+DNS+Cache+Poisoning+On+Debian+Etch" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Ftusforyou.com%2Fhow-to-patch-bind-to-avoid-cache-poisoning-debian-etch&amp;headline=How+To+Patch+BIND9+Against+DNS+Cache+Poisoning+On+Debian+Etch" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=How+To+Patch+BIND9+Against+DNS+Cache+Poisoning+On+Debian+Etch&amp;url=http%3A%2F%2Ftusforyou.com%2Fhow-to-patch-bind-to-avoid-cache-poisoning-debian-etch" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=How+To+Patch+BIND9+Against+DNS+Cache+Poisoning+On+Debian+Etch&amp;u=http%3A%2F%2Ftusforyou.com%2Fhow-to-patch-bind-to-avoid-cache-poisoning-debian-etch" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=How+To+Patch+BIND9+Against+DNS+Cache+Poisoning+On+Debian+Etch&amp;url=http%3A%2F%2Ftusforyou.com%2Fhow-to-patch-bind-to-avoid-cache-poisoning-debian-etch" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=How+To+Patch+BIND9+Against+DNS+Cache+Poisoning+On+Debian+Etch&amp;url=http%3A%2F%2Ftusforyou.com%2Fhow-to-patch-bind-to-avoid-cache-poisoning-debian-etch" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=How+To+Patch+BIND9+Against+DNS+Cache+Poisoning+On+Debian+Etch&amp;url=http%3A%2F%2Ftusforyou.com%2Fhow-to-patch-bind-to-avoid-cache-poisoning-debian-etch" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Ftusforyou.com%2Fhow-to-patch-bind-to-avoid-cache-poisoning-debian-etch&amp;title=How+To+Patch+BIND9+Against+DNS+Cache+Poisoning+On+Debian+Etch&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Ftusforyou.com%2Fhow-to-patch-bind-to-avoid-cache-poisoning-debian-etch" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Ftusforyou.com%2Fhow-to-patch-bind-to-avoid-cache-poisoning-debian-etch" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Ftusforyou.com%2Fhow-to-patch-bind-to-avoid-cache-poisoning-debian-etch" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://tusforyou.com/how-to-patch-bind-to-avoid-cache-poisoning-debian-etch/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating Simple Virtual Hosts With mod_mysql_vhost On Lighttpd (Debian Etch)</title>
		<link>http://tusforyou.com/creating-simple-vhosts-with-mod_mysql_vhost-on-lighttpd-debian-etch</link>
		<comments>http://tusforyou.com/creating-simple-vhosts-with-mod_mysql_vhost-on-lighttpd-debian-etch#comments</comments>
		<pubDate>Thu, 13 May 2010 17:58:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Creating]]></category>
		<category><![CDATA[Etch]]></category>
		<category><![CDATA[Hosts]]></category>
		<category><![CDATA[Lighttpd]]></category>
		<category><![CDATA[mod_mysql_vhost]]></category>
		<category><![CDATA[Simple]]></category>
		<category><![CDATA[Virtual]]></category>

		<guid isPermaLink="false">http://tusforyou.com/creating-simple-vhosts-with-mod_mysql_vhost-on-lighttpd-debian-etch</guid>
		<description><![CDATA[This guide explains how you can use mod_mysql_vhost to create simple virtual hosts on a lighttpd web server on Debian Etch. With mod_mysql_vhost, lighttpd can read the vhost configuration from a MySQL database. Currently, you can store the domain and the document root in the MySQL database which results in very simple virtual hosts. If [...]]]></description>
			<content:encoded><![CDATA[<p>This guide explains how you can use mod_mysql_vhost to create simple<br />
virtual hosts on a lighttpd web server on Debian Etch. With<br />
mod_mysql_vhost, lighttpd can read the vhost configuration from a MySQL<br />
database. Currently, you can store the domain and the document root in<br />
the MySQL database which results in very simple virtual hosts. If you<br />
need more directives for your vhosts, you&#8217;d have to configure them in<br />
the global section of lighttpd.conf, which means they&#8217;d be valid for<br />
all vhosts. Therefore, mod_mysql_vhost is ideal if your vhosts differ<br />
only in the domain and document root.<span id="more-1063"></span>
<div class="node">
<div class="content">
<h2>Creating Simple Virtual Hosts With mod_mysql_vhost On Lighttpd (Debian Etch) </h2>
<p>Version 1.0 <br /> Author: Falko Timme &lt;ft [at] falkotimme [dot] com&gt; <br />
Last edited 07/31/2008</p>
<p>This guide explains how you can use mod_mysql_vhost to create simple virtual hosts on a lighttpd web server on Debian Etch. With mod_mysql_vhost, lighttpd can read the vhost configuration from a MySQL database. Currently, you can store the domain and the document root in the MySQL database which results in very simple virtual hosts. If you need more directives for your vhosts, you&#8217;d have to configure them in the global section of lighttpd.conf, which means they&#8217;d be valid for all vhosts. Therefore, mod_mysql_vhost is ideal if your vhosts differ only in the domain and document root.</p>
<p>I do not issue any guarantee that this will work for you!</p>
<p>&nbsp;</p>
<h3>1 Installing MySQL 5.0 </h3>
<p>First we install MySQL 5.0 like this:</p>
<p class="command">apt-get install mysql-server mysql-client</p>
<p>Create a password for the MySQL user <span class="system">root</span> (replace <span class="system">yourrootsqlpassword</span> with the password you want to use):</p>
<p class="command">mysqladmin -u root password yourrootsqlpassword</p>
<p>Then check with</p>
<p class="command">netstat -tap | grep mysql</p>
<p>on which addresses MySQL is listening. If the output looks like this:</p>
<p class="system">tcp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;localhost.localdo:mysql&nbsp;*:*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LISTEN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2713/mysqld</p>
<p>which means MySQL is listening on <span class="system">localhost.localdomain</span> only, then you&#8217;re safe with the password you set before. But if the output looks like this:</p>
<p class="system">tcp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;*:mysql&nbsp;*:*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LISTEN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2713/mysqld</p>
<p>you should set a MySQL password for your hostname (my hostname is <span class="system">server1.example.com</span> here), too, because otherwise anybody can access your database and modify data:</p>
<p class="command">mysqladmin -h server1.example.com -u root password yourrootsqlpassword</p>
<p>&nbsp;</p>
<h3>2 Installing Lighttpd And mod_mysql_vhost</h3>
<p>You can install lighttpd (if it&#8217;s not already installed) and mod_mysql_vhost as follows: </p>
<p class="command">apt-get install lighttpd lighttpd-mod-mysql-vhost</p>
<p>To enable mod_mysql_vhost, we open <span class="system">/etc/lighttpd/lighttpd.conf</span> and add/enable <span class="system">&#8220;mod_mysql_vhost&#8221;,</span> in the <span class="system">server.modules</span> stanza: </p>
<p class="command">vi /etc/lighttpd/lighttpd.conf</p>
<tr>
<td class="">
<pre>[...]
server.modules= ( "mod_access", "mod_alias", "mod_accesslog", "mod_mysql_vhost",
# "mod_rewrite",
# "mod_redirect",
# "mod_status",
# "mod_evhost",
# "mod_compress",
# "mod_usertrack",
# "mod_rrdtool",
# "mod_webdav",
# "mod_expire",
# "mod_flv_streaming",
# "mod_evasive")
[...]</pre>
</td>
</tr>
<p>Afterwards, we restart lighttpd:</p>
<p class="command">/etc/init.d/lighttpd restart </p>
<p>&nbsp;</p>
<h3>3 Configuring mod_mysql_vhost</h3>
<p>Now we log in to MySQL&#8230;</p>
<p class="command">mysql -u root -p</p>
<p>&#8230; and create the database <span class="system">lighttpd</span>:</p>
<p class="command">CREATE DATABASE lighttpd;</p>
<p>Next we create a database user (which we name <span class="system">lighttpd</span> as well) with <span class="system">SELECT</span> privileges for the <span class="system">lighttpd</span> database:</p>
<p class="command">GRANT SELECT ON lighttpd.* TO lighttpd@localhost IDENTIFIED BY &#8216;secret&#8217;;<br />
GRANT SELECT ON lighttpd.* TO lighttpd@localhost.localdomain IDENTIFIED BY &#8216;secret&#8217;;<br />
FLUSH PRIVILEGES;</p>
<p>(Replace <span class="system">secret</span> with a password of your choice.)</p>
<p>Then we create the <span class="system">domains</span> table in the <span class="system">lighttpd</span> database and leave MySQL:</p>
<p class="command">USE lighttpd;</p>
<p class="command">CREATE TABLE domains (<br /> domain varchar(64) not null primary key,<br /> docroot varchar(128) not null<br /> );</p>
<p class="command">quit;</p>
<p>Now we open <span class="system">/etc/lighttpd/lighttpd.conf</span> and add the following mod_mysql_vhost configuration at the end of the file:</p>
<p class="command">vi /etc/lighttpd/lighttpd.conf</p>
<tr>
<td class="">
<pre>[...]
mysql-vhost.db = "lighttpd"
mysql-vhost.user = "lighttpd"
mysql-vhost.pass = "secret"
mysql-vhost.sql= "SELECT docroot FROM domains WHERE domain='?';"
mysql-vhost.hostname = "localhost"
mysql-vhost.port = 3306</pre>
</td>
</tr>
<p>(Replace <span class="system">secret</span> with the password you&#8217;ve previously set for the <span class="system">lighttpd</span> MySQL user.)</p>
<p>Restart lighttpd:</p>
<p class="command">/etc/init.d/lighttpd restart</p>
<p>Now it&#8217;s time to configure virtual hosts&#8230;</p>
<p>&nbsp;</p>
<h3>4 Configuring Virtual Hosts</h3>
<p>I will now configure two virtual hosts, one for <span class="system">www.example.com</span> (with the document root <span class="system">/var/www/www.example.com/web</span>) and one for <span class="system">www.example.org</span> (with the document root <span class="system">/var/www/www.example.org/web</span>).</p>
<p>First, we create the document roots of both web sites (if they don&#8217;t already exist):</p>
<p class="command">mkdir -p /var/www/www.example.com/web<br />
mkdir -p /var/www/www.example.org/web</p>
<p>Then we log in to MySQL&#8230;</p>
<p class="command">mysql -u root -p</p>
<p class="command">USE lighttpd;</p>
<p>&#8230; and create the vhosts as follows:</p>
<p class="command">INSERT INTO domains VALUES (&#8216;www.example.com&#8217;,'/var/www/www.example.com/web/&#8217;);<br />
INSERT INTO domains VALUES (&#8216;www.example.org&#8217;,'/var/www/www.example.org/web/&#8217;);</p>
<p>We can now leave the MySQL shell:</p>
<p class="command">quit;</p>
<p>That&#8217;s it, the vhosts are now configured and working, and no lighttpd restart is required.</p>
<p>To check if the vhosts are working as expected, we create an <span class="system">index.html</span> file in each document root, one with the string &#8220;www.example.com&#8221; in it, the other one with the string &#8220;www.example.org&#8221;&#8230;</p>
<p class="command">echo &#8220;www.example.com&#8221; &gt; /var/www/www.example.com/web/index.html<br />
echo &#8220;www.example.org&#8221; &gt; /var/www/www.example.org/web/index.html</p>
<p>and call <span class="system">http://www.example.com</span> and <span class="system">http://www.example.org</span> in a browser. <span class="system">http://www.example.com</span> should show <span class="system">www.example.com</span>, and <span class="system">http://www.example.org</span> should display <span class="system">www.example.org</span>. </p>
<p>&nbsp;</p>
<h3>5 Links</h3>
<ul>
<li>mod_mysql_vhost: <a href="http://trac.lighttpd.net/trac/wiki/Docs#Optionsformod_mysql_vhost-Mysqlvirtualhostingmodule" target="_blank">http://trac.lighttpd.net/trac/wiki/Docs#Optionsformod_mysql_vhost-Mysqlvirtualhostingmodule</a></li>
<li>Lighttpd: <a href="http://www.lighttpd.net/" target="_blank">http://www.lighttpd.net</a></li>
<li>Debian: <a href="http://www.debian.org/" target="_blank">http://www.debian.org</a></li>
</ul>
<p>
<div class="copyright-footer">Copyright © 2008 Falko Timme<br />All Rights Reserved.</div>
</div>
</div>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Ftusforyou.com%2Fcreating-simple-vhosts-with-mod_mysql_vhost-on-lighttpd-debian-etch&amp;title=Creating+Simple+Virtual+Hosts+With+mod_mysql_vhost+On+Lighttpd+%28Debian+Etch%29" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Ftusforyou.com%2Fcreating-simple-vhosts-with-mod_mysql_vhost-on-lighttpd-debian-etch&amp;title=Creating+Simple+Virtual+Hosts+With+mod_mysql_vhost+On+Lighttpd+%28Debian+Etch%29" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Ftusforyou.com%2Fcreating-simple-vhosts-with-mod_mysql_vhost-on-lighttpd-debian-etch&amp;title=Creating+Simple+Virtual+Hosts+With+mod_mysql_vhost+On+Lighttpd+%28Debian+Etch%29" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Ftusforyou.com%2Fcreating-simple-vhosts-with-mod_mysql_vhost-on-lighttpd-debian-etch&amp;headline=Creating+Simple+Virtual+Hosts+With+mod_mysql_vhost+On+Lighttpd+%28Debian+Etch%29" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=Creating+Simple+Virtual+Hosts+With+mod_mysql_vhost+On+Lighttpd+%28Debian+Etch%29&amp;url=http%3A%2F%2Ftusforyou.com%2Fcreating-simple-vhosts-with-mod_mysql_vhost-on-lighttpd-debian-etch" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Creating+Simple+Virtual+Hosts+With+mod_mysql_vhost+On+Lighttpd+%28Debian+Etch%29&amp;u=http%3A%2F%2Ftusforyou.com%2Fcreating-simple-vhosts-with-mod_mysql_vhost-on-lighttpd-debian-etch" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=Creating+Simple+Virtual+Hosts+With+mod_mysql_vhost+On+Lighttpd+%28Debian+Etch%29&amp;url=http%3A%2F%2Ftusforyou.com%2Fcreating-simple-vhosts-with-mod_mysql_vhost-on-lighttpd-debian-etch" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Creating+Simple+Virtual+Hosts+With+mod_mysql_vhost+On+Lighttpd+%28Debian+Etch%29&amp;url=http%3A%2F%2Ftusforyou.com%2Fcreating-simple-vhosts-with-mod_mysql_vhost-on-lighttpd-debian-etch" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Creating+Simple+Virtual+Hosts+With+mod_mysql_vhost+On+Lighttpd+%28Debian+Etch%29&amp;url=http%3A%2F%2Ftusforyou.com%2Fcreating-simple-vhosts-with-mod_mysql_vhost-on-lighttpd-debian-etch" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Ftusforyou.com%2Fcreating-simple-vhosts-with-mod_mysql_vhost-on-lighttpd-debian-etch&amp;title=Creating+Simple+Virtual+Hosts+With+mod_mysql_vhost+On+Lighttpd+%28Debian+Etch%29&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Ftusforyou.com%2Fcreating-simple-vhosts-with-mod_mysql_vhost-on-lighttpd-debian-etch" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Ftusforyou.com%2Fcreating-simple-vhosts-with-mod_mysql_vhost-on-lighttpd-debian-etch" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Ftusforyou.com%2Fcreating-simple-vhosts-with-mod_mysql_vhost-on-lighttpd-debian-etch" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://tusforyou.com/creating-simple-vhosts-with-mod_mysql_vhost-on-lighttpd-debian-etch/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Set Up WebDAV With Lighttpd On Debian Etch Page 2</title>
		<link>http://tusforyou.com/setting-up-webdav-with-lighttpd-debian-etch-p2</link>
		<comments>http://tusforyou.com/setting-up-webdav-with-lighttpd-debian-etch-p2#comments</comments>
		<pubDate>Thu, 13 May 2010 17:58:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Etch]]></category>
		<category><![CDATA[Lighttpd]]></category>
		<category><![CDATA[WebDAV]]></category>

		<guid isPermaLink="false">http://tusforyou.com/setting-up-webdav-with-lighttpd-debian-etch-p2</guid>
		<description><![CDATA[This guide explains how to set up WebDAV with lighttpd on a Debian Etch server. WebDAV stands for Web-based Distributed Authoring and Versioning and is a set of extensions to the HTTP protocol that allow users to directly edit files on the lighttpd server so that they do not need to be downloaded/uploaded via FTP. [...]]]></description>
			<content:encoded><![CDATA[<p>This guide explains how to set up WebDAV with lighttpd on a Debian Etch server. WebDAV stands for Web-based Distributed Authoring and Versioning<br />
and is a set of extensions to the HTTP protocol that allow users to<br />
directly edit files on the lighttpd server so that they do not need to<br />
be downloaded/uploaded via FTP. Of course, WebDAV can also be used to<br />
upload and download files.<span id="more-1062"></span>
<div class="node">
<div class="content">
<h3>4 Configure The Virtual Host For WebDAV</h3>
<p>Now we create the WebDAV password file <span class="system">/var/www/web1/passwd.dav</span> with the user <span class="system">test</span> (the <span class="system">-c</span> switch creates the file if it does not exist):</p>
<p class="command">htpasswd -c /var/www/web1/passwd.dav test</p>
<p>You will be asked to type in a password for the user <span class="system">test</span>.</p>
<p>(Please don&#8217;t use the <span class="system">-c</span> switch if <span class="system">/var/www/web1/passwd.dav</span> is already existing because this will recreate the file from scratch, meaning you lose all users in that file!)</p>
<p>Now we change the permissions of the <span class="system">/var/www/web1/passwd.dav</span> file so that only <span class="system">root</span> and the members of the <span class="system">www-data</span> group can access it:</p>
<p class="command">chown root:www-data /var/www/web1/passwd.dav<br />
chmod 640 /var/www/web1/passwd.dav</p>
<p>Now we modify our vhost in <span class="system">/etc/lighttpd/lighttpd.conf</span> so that it looks as follows:</p>
<p class="command">vi /etc/lighttpd/lighttpd.conf</p>
<tr>
<td class="">
<pre>$HTTP["host"] == "www.example.com" { server.document-root = "/var/www/web1/web" alias.url = ( "/webdav" =&gt; "/var/www/web1/web" ) $HTTP["url"] =~ "^/webdav($|/)" { webdav.activate = "enable" webdav.is-readonly = "disable" webdav.sqlite-db-name = "/var/run/lighttpd/lighttpd.webdav_lock.db" auth.backend = "htpasswd" auth.backend.htpasswd.userfile = "/var/www/web1/passwd.dav" auth.require = ( "" =&gt; ( "method" =&gt; "basic","realm" =&gt; "webdav","require" =&gt; "valid-user" ) ) }
}</pre>
</td>
</tr>
<p>The <span class="system">alias.url</span> directive makes (together with <span class="system">$HTTP["url"] =~ &#8220;^/webdav($|/)&#8221;</span>) that when you call <span class="system">/webdav</span>, WebDAV is invoked, but you can still access the whole document root of the vhost. All other URLs of that vhost are still &#8220;normal&#8221; HTTP.</p>
<p>Restart lighttpd afterwards:</p>
<p class="command">/etc/init.d/lighttpd restart</p>
<p>&nbsp;</p>
<h3>5 Testing WebDAV</h3>
<p>We will now install <span class="system">cadaver</span>, a command-line WebDAV client:</p>
<p class="command">apt-get install cadaver</p>
<p>To test if WebDAV works, type:</p>
<p class="command">cadaver http://www.example.com/webdav/</p>
<p>You should be prompted for a user name. Type in <span class="system">test</span> and then the password for the user <span class="system">test</span>. If all goes well, you should be granted access which means WebDAV is working ok. Type <span class="system">quit</span> to leave the WebDAV shell:</p>
<p class="system">server1:~# cadaver http://www.example.com/webdav/<br /> Authentication required for webdav on server `www.example.com&#8217;:<br /> Username: test<br /> Password:<br /> dav:/webdav/&gt; quit<br /> Connection to `www.example.com&#8217; closed.<br />
server1:~#</p>
<p>&nbsp;</p>
<h3>6 Configure A Windows XP Client To Connect To The WebDAV Share</h3>
<p>This is described on <a href="http://www.tusforyou.com/setting-up-webdav-with-apache2-on-debian-etch-p2" target="_blank">http://www.tusforyou.com/setting-up-webdav-with-apache2-on-debian-etch-p2</a>.</p>
<p>Please specify the port in the WebDAV URL, e.g. <span class="system">http://www.example.com</span><span class="highlight">:80</span><span class="system">/webdav</span>. For some strange reason this makes Windows XP accept the normal username (e.g. <span class="system">test</span>) &#8211; otherwise Windows XP expects NTLM usernames (that would have the form <span class="system">www.example.com\test</span>). </p>
<p>&nbsp;</p>
<h3>7 Configure A Linux Client (GNOME) To Connect To The WebDAV Share</h3>
<p>This is described on <a href="http://www.tusforyou.com/setting-up-webdav-with-apache2-on-debian-etch-p3" target="_blank">http://www.tusforyou.com/setting-up-webdav-with-apache2-on-debian-etch-p3</a>.</p>
<p>&nbsp;</p>
<h3>8 Links</h3>
<ul>
<li>WebDAV: <a href="http://www.webdav.org/" target="_blank">http://www.webdav.org</a></li>
<li>Lighttpd: <a href="http://www.lighttpd.net/" target="_blank">http://www.lighttpd.net</a></li>
<li>Debian: <a href="http://www.debian.org/" target="_blank">http://www.debian.org</a></li>
</ul>
<div class="book">
<div class="nav">
<div class="links">
<div class="prev"><a href="setting-up-webdav-with-lighttpd-debian-etch" title="View the previous page.">previous</a></div>
<div class="next">&nbsp;</div>
<div class="up"><a href="setting-up-webdav-with-lighttpd-debian-etch" title="View this page&#39;s parent section.">up</a></div>
</div>
<div class="titles">
<div class="prev">How To Set Up WebDAV With Lighttpd On Debian Etch</div>
</div>
</div>
</div>
<p>
<div class="copyright-footer">Copyright © 2008 Falko Timme<br />All Rights Reserved.</div>
</div>
</div>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Ftusforyou.com%2Fsetting-up-webdav-with-lighttpd-debian-etch-p2&amp;title=How+To+Set+Up+WebDAV+With+Lighttpd+On+Debian+Etch+Page+2" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Ftusforyou.com%2Fsetting-up-webdav-with-lighttpd-debian-etch-p2&amp;title=How+To+Set+Up+WebDAV+With+Lighttpd+On+Debian+Etch+Page+2" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Ftusforyou.com%2Fsetting-up-webdav-with-lighttpd-debian-etch-p2&amp;title=How+To+Set+Up+WebDAV+With+Lighttpd+On+Debian+Etch+Page+2" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Ftusforyou.com%2Fsetting-up-webdav-with-lighttpd-debian-etch-p2&amp;headline=How+To+Set+Up+WebDAV+With+Lighttpd+On+Debian+Etch+Page+2" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=How+To+Set+Up+WebDAV+With+Lighttpd+On+Debian+Etch+Page+2&amp;url=http%3A%2F%2Ftusforyou.com%2Fsetting-up-webdav-with-lighttpd-debian-etch-p2" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=How+To+Set+Up+WebDAV+With+Lighttpd+On+Debian+Etch+Page+2&amp;u=http%3A%2F%2Ftusforyou.com%2Fsetting-up-webdav-with-lighttpd-debian-etch-p2" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=How+To+Set+Up+WebDAV+With+Lighttpd+On+Debian+Etch+Page+2&amp;url=http%3A%2F%2Ftusforyou.com%2Fsetting-up-webdav-with-lighttpd-debian-etch-p2" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=How+To+Set+Up+WebDAV+With+Lighttpd+On+Debian+Etch+Page+2&amp;url=http%3A%2F%2Ftusforyou.com%2Fsetting-up-webdav-with-lighttpd-debian-etch-p2" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=How+To+Set+Up+WebDAV+With+Lighttpd+On+Debian+Etch+Page+2&amp;url=http%3A%2F%2Ftusforyou.com%2Fsetting-up-webdav-with-lighttpd-debian-etch-p2" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Ftusforyou.com%2Fsetting-up-webdav-with-lighttpd-debian-etch-p2&amp;title=How+To+Set+Up+WebDAV+With+Lighttpd+On+Debian+Etch+Page+2&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Ftusforyou.com%2Fsetting-up-webdav-with-lighttpd-debian-etch-p2" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Ftusforyou.com%2Fsetting-up-webdav-with-lighttpd-debian-etch-p2" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Ftusforyou.com%2Fsetting-up-webdav-with-lighttpd-debian-etch-p2" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://tusforyou.com/setting-up-webdav-with-lighttpd-debian-etch-p2/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Set Up WebDAV With Lighttpd On Debian Etch</title>
		<link>http://tusforyou.com/setting-up-webdav-with-lighttpd-debian-etch</link>
		<comments>http://tusforyou.com/setting-up-webdav-with-lighttpd-debian-etch#comments</comments>
		<pubDate>Thu, 13 May 2010 17:58:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Etch]]></category>
		<category><![CDATA[Lighttpd]]></category>
		<category><![CDATA[WebDAV]]></category>

		<guid isPermaLink="false">http://tusforyou.com/setting-up-webdav-with-lighttpd-debian-etch</guid>
		<description><![CDATA[This guide explains how to set up WebDAV with lighttpd on a Debian Etch server. WebDAV stands for Web-based Distributed Authoring and Versioning and is a set of extensions to the HTTP protocol that allow users to directly edit files on the lighttpd server so that they do not need to be downloaded/uploaded via FTP. [...]]]></description>
			<content:encoded><![CDATA[<p>This guide explains how to set up WebDAV with lighttpd on a Debian Etch server. WebDAV stands for Web-based Distributed Authoring and Versioning<br />
and is a set of extensions to the HTTP protocol that allow users to<br />
directly edit files on the lighttpd server so that they do not need to<br />
be downloaded/uploaded via FTP. Of course, WebDAV can also be used to<br />
upload and download files.<span id="more-1061"></span>
<div class="node">
<div class="content">
<h2>How To Set Up WebDAV With Lighttpd On Debian Etch </h2>
<p>Version 1.0 <br /> Author: Falko Timme &lt;ft [at] falkotimme [dot] com&gt; <br />
Last edited 07/24/2008</p>
<p>This guide explains how to set up WebDAV with lighttpd on a Debian Etch server. WebDAV stands for <i>Web-based Distributed Authoring and Versioning</i> and is a set of extensions to the HTTP protocol that allow users to directly edit files on the lighttpd server so that they do not need to be downloaded/uploaded via FTP. Of course, WebDAV can also be used to upload and download files. </p>
<p>I do not issue any guarantee that this will work for you!</p>
<p>&nbsp;</p>
<h3>1 Preliminary Note</h3>
<p>I&#8217;m using a Debian Etch server with the IP address <span class="system">192.168.0.100</span> here. </p>
<p>&nbsp;</p>
<h3>2 Installing WebDAV</h3>
<p>You can install lighttpd (if it&#8217;s not already installed), the lighttpd WebDAV module and the <span class="system">apache2-utils</span> package (which contains the tool <span class="system">htpasswd</span> which we will need later on to generate a password file for the WebDAV share) as follows: </p>
<p class="command">apt-get install lighttpd lighttpd-mod-webdav apache2-utils</p>
<p>Afterwards, create the directory <span class="system">/var/run/lighttpd</span> and make it owned by the <span class="system">www-data</span> user and group. This directory will contain an SQLite database needed by WebDAV: </p>
<p class="command">mkdir /var/run/lighttpd/<br />
chown www-data:www-data /var/run/lighttpd/</p>
<p>Next, we enable the module <span class="system">mod_auth</span>:</p>
<p class="command">lighty-enable-mod auth</p>
<p>&#8230; and open <span class="system">/etc/lighttpd/lighttpd.conf</span> to make sure that the modules <span class="system">mod_alias</span> and <span class="system">mod_webdav</span> are enabled in the <span class="system">server.modules</span> stanza:</p>
<p class="command">vi /etc/lighttpd/lighttpd.conf</p>
<tr>
<td class="">
<pre>[...]
server.modules= ( "mod_access", "mod_alias", "mod_accesslog",
# "mod_rewrite",
# "mod_redirect",
# "mod_status",
# "mod_evhost",
# "mod_compress",
# "mod_usertrack",
# "mod_rrdtool", "mod_webdav",
# "mod_expire",
# "mod_flv_streaming",
# "mod_evasive")
[...]</pre>
</td>
</tr>
<p>Restart lighttpd afterwards:</p>
<p class="command">/etc/init.d/lighttpd restart </p>
<p>&nbsp;</p>
<h3>3 Creating A Virtual Host</h3>
<p>I will now create a lighttpd vhost (<span class="system">www.example.com</span>) in the directory <span class="system">/var/www/web1/web</span>. If you already have a vhost for which you&#8217;d like to enable WebDAV, you must adjust this tutorial to your situation.</p>
<p>First, we create the directory <span class="system">/var/www/web1/web</span> and make the lighttpd user (<span class="system">www-data</span>) the owner of that directory:</p>
<p class="command">mkdir -p /var/www/web1/web<br />
chown www-data:www-data /var/www/web1/web</p>
<p>Then we open <span class="system">/etc/lighttpd/lighttpd.conf</span> and add the following vhost to the end of the file: </p>
<p class="command">vi /etc/lighttpd/lighttpd.conf</p>
<tr>
<td class="">
<pre>[...]
$HTTP["host"] == "www.example.com" { server.document-root = "/var/www/web1/web"
}</pre>
</td>
</tr>
<p>Afterwards we restart lighttpd: </p>
<p class="command">/etc/init.d/lighttpd restart</p>
<div class="book">
<div class="tree">
<div class="menu">
<ul>
<li class="leaf"><a href="setting-up-webdav-with-lighttpd-debian-etch-p2">How To Set Up WebDAV With Lighttpd On Debian Etch &#8211; Page 2</a></li>
</ul>
</div>
</div>
<div class="nav">
<div class="links">
<div class="prev">&nbsp;</div>
<div class="next"><a href="setting-up-webdav-with-lighttpd-debian-etch-p2" title="View the next page.">next</a></div>
</div>
<div class="titles">
<div class="next">How To Set Up WebDAV With Lighttpd On Debian Etch &#8211; Page 2</div>
</div>
</div>
</div>
<p>
<div class="copyright-footer">Copyright © 2008 Falko Timme<br />All Rights Reserved.</div>
</div>
</div>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Ftusforyou.com%2Fsetting-up-webdav-with-lighttpd-debian-etch&amp;title=How+To+Set+Up+WebDAV+With+Lighttpd+On+Debian+Etch" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Ftusforyou.com%2Fsetting-up-webdav-with-lighttpd-debian-etch&amp;title=How+To+Set+Up+WebDAV+With+Lighttpd+On+Debian+Etch" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Ftusforyou.com%2Fsetting-up-webdav-with-lighttpd-debian-etch&amp;title=How+To+Set+Up+WebDAV+With+Lighttpd+On+Debian+Etch" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Ftusforyou.com%2Fsetting-up-webdav-with-lighttpd-debian-etch&amp;headline=How+To+Set+Up+WebDAV+With+Lighttpd+On+Debian+Etch" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=How+To+Set+Up+WebDAV+With+Lighttpd+On+Debian+Etch&amp;url=http%3A%2F%2Ftusforyou.com%2Fsetting-up-webdav-with-lighttpd-debian-etch" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=How+To+Set+Up+WebDAV+With+Lighttpd+On+Debian+Etch&amp;u=http%3A%2F%2Ftusforyou.com%2Fsetting-up-webdav-with-lighttpd-debian-etch" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=How+To+Set+Up+WebDAV+With+Lighttpd+On+Debian+Etch&amp;url=http%3A%2F%2Ftusforyou.com%2Fsetting-up-webdav-with-lighttpd-debian-etch" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=How+To+Set+Up+WebDAV+With+Lighttpd+On+Debian+Etch&amp;url=http%3A%2F%2Ftusforyou.com%2Fsetting-up-webdav-with-lighttpd-debian-etch" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=How+To+Set+Up+WebDAV+With+Lighttpd+On+Debian+Etch&amp;url=http%3A%2F%2Ftusforyou.com%2Fsetting-up-webdav-with-lighttpd-debian-etch" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Ftusforyou.com%2Fsetting-up-webdav-with-lighttpd-debian-etch&amp;title=How+To+Set+Up+WebDAV+With+Lighttpd+On+Debian+Etch&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Ftusforyou.com%2Fsetting-up-webdav-with-lighttpd-debian-etch" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Ftusforyou.com%2Fsetting-up-webdav-with-lighttpd-debian-etch" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Ftusforyou.com%2Fsetting-up-webdav-with-lighttpd-debian-etch" ><img class="lightsocial_img" src="http://tusforyou.com/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://tusforyou.com/setting-up-webdav-with-lighttpd-debian-etch/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
