<?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>*.hosting &#187; Hosting</title>
	<atom:link href="http://www.stardothosting.com/blog/category/hosting/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.stardothosting.com/blog</link>
	<description>Star Dot Hosting : Technology, Security, Virtualization and Cloud Computing</description>
	<lastBuildDate>Wed, 16 May 2012 19:07:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Automated Amazon EBS snapshot backup script with 7 day retention</title>
		<link>http://www.stardothosting.com/blog/2012/05/16/automated-amazon-ebs-snapshot-backup-script-with-7-day-retention/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=automated-amazon-ebs-snapshot-backup-script-with-7-day-retention</link>
		<comments>http://www.stardothosting.com/blog/2012/05/16/automated-amazon-ebs-snapshot-backup-script-with-7-day-retention/#comments</comments>
		<pubDate>Wed, 16 May 2012 18:50:24 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[Amazon API]]></category>
		<category><![CDATA[Cloud Hosting]]></category>
		<category><![CDATA[Hosting]]></category>
		<category><![CDATA[Managed Hosting Services]]></category>
		<category><![CDATA[Managed VPS Hosting]]></category>
		<category><![CDATA[Shell Scripting]]></category>
		<category><![CDATA[amazon cloud]]></category>
		<category><![CDATA[amazon ebs]]></category>
		<category><![CDATA[amazon ebs snapshot]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[cloud]]></category>
		<category><![CDATA[shell scripting]]></category>
		<category><![CDATA[systems administration]]></category>

		<guid isPermaLink="false">http://www.stardothosting.com/blog/?p=573</guid>
		<description><![CDATA[Hello there! We have recently been implementing several different backup strategies for properties that reside on the Amazon cloud platform. These strategies include scripts that incorporate s3sync and s3fs for offsite or redundant &#8220;limitless&#8221; backup storage capabilities. One of the more recent strategies we have implemented for several clients is an automated Amazon EBS volume [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2012%2F05%2F16%2Fautomated-amazon-ebs-snapshot-backup-script-with-7-day-retention%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2012%2F05%2F16%2Fautomated-amazon-ebs-snapshot-backup-script-with-7-day-retention%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Hello there!</p>
<p>We have recently been implementing several different backup strategies for properties that reside on the Amazon cloud platform.</p>
<p>These strategies include scripts that incorporate s3sync and s3fs for offsite or redundant &#8220;limitless&#8221; backup storage capabilities. One of the more recent strategies we have implemented for several clients is an automated Amazon EBS volume snapshot script that only keeps 7 day retention on all snapshot backups.</p>
<p>The script itself is fairly straightforward, but took several dry-runs in order to fine tune it so that it would reliably create the snapshots, but more importantly would clear out old snapshots older than 7 days. </p>
<p>You can see the for loop for deleting older snapshots. This is done by parsing snapshot dates, converting the dates to a pure numeric value and comparing said numeric value to a &#8220;7 days ago&#8221; date variable.</p>
<p>Take a look at the script below, hopefully it will be useful to you! There could be more error checking, but that should be fairly easy to do.</p>
<pre>
#!/bin/bash
# EBS Snapshot volume script
# Written by Star Dot Hosting
# www.stardothosting.com

# Constants
ec2_bin="/opt/aws/bin"
my_cert="/opt/aws/cert.txt"
my_key="/opt/aws/key.txt"
instance_id=`wget -q -O- http://169.254.169.254/latest/meta-data/instance-id`

# Dates
datecheck_7d=`date +%Y-%m-%d --date '7 days ago'`
datecheck_s_7d=`date --date="$datecheck_7d" +%s`

# Get all volume info and copy to temp file
$ec2_bin/ec2-describe-volumes -C $my_cert -K $my_key  --filter "attachment.instance-id=$instance_id" > /tmp/volume_info.txt 2>&#038;1

# Get all snapshot info
$ec2_bin/ec2-describe-snapshots -C $my_cert -K $my_key | grep "$instance_id" > /tmp/snap_info.txt 2>&#038;1

# Loop to remove any snapshots older than 7 days
for obj0 in $(cat /tmp/snap_info.txt)
do

        snapshot_name=`cat /tmp/snap_info.txt | grep "$obj0" | awk '{print $2}'`
        datecheck_old=`cat /tmp/snap_info.txt | grep "$snapshot_name" | awk '{print $5}' | awk -F "T" '{printf "%s\n", $1}'`
        datecheck_s_old=`date --date=$datecheck_old" +%s`

#       echo "snapshot name: $snapshot_name"
#       echo "datecheck 7d : $datecheck_7d"
#       echo "datecheck 7d s : $datecheck_s_7d"
#       echo "datecheck old s: $datecheck_s_old"

        if (( $datecheck_s_old <= $datecheck_s_7d ));
        then
                echo "deleting snapshot $snapshot_name ..."
                $ec2_bin/ec2-delete-snapshot -C $my_cert -K $my_key $snapshot_name
        else
                echo "not deleting snapshot $snapshot_name ..."

        fi

done

# Create snapshot
for volume in $(cat /tmp/volume_info.txt | grep "VOLUME" | awk '{print $2}')
do
        description="`hostname`_backup-`date +%Y-%m-%d`"
        echo "Creating Snapshot for the volume: $volume with description: $description"
        $ec2_bin/ec2-create-snapshot -C $my_cert -K $my_key -d $description $volume
done
</pre>
<p><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2012%2F05%2F16%2Fautomated-amazon-ebs-snapshot-backup-script-with-7-day-retention%2F&amp;linkname=Automated%20Amazon%20EBS%20snapshot%20backup%20script%20with%207%20day%20retention" title="Digg" rel="nofollow" target="_blank"><img src="http://www.stardothosting.com/blog/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2012%2F05%2F16%2Fautomated-amazon-ebs-snapshot-backup-script-with-7-day-retention%2F&amp;linkname=Automated%20Amazon%20EBS%20snapshot%20backup%20script%20with%207%20day%20retention" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.stardothosting.com/blog/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_reddit" href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2012%2F05%2F16%2Fautomated-amazon-ebs-snapshot-backup-script-with-7-day-retention%2F&amp;linkname=Automated%20Amazon%20EBS%20snapshot%20backup%20script%20with%207%20day%20retention" title="Reddit" rel="nofollow" target="_blank"><img src="http://www.stardothosting.com/blog/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2012%2F05%2F16%2Fautomated-amazon-ebs-snapshot-backup-script-with-7-day-retention%2F&amp;linkname=Automated%20Amazon%20EBS%20snapshot%20backup%20script%20with%207%20day%20retention" title="Delicious" rel="nofollow" target="_blank"><img src="http://www.stardothosting.com/blog/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_google_plusone addtoany_special_service" data-annotation="none" data-href="http://www.stardothosting.com/blog/2012/05/16/automated-amazon-ebs-snapshot-backup-script-with-7-day-retention/"></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2012%2F05%2F16%2Fautomated-amazon-ebs-snapshot-backup-script-with-7-day-retention%2F&amp;title=Automated%20Amazon%20EBS%20snapshot%20backup%20script%20with%207%20day%20retention" id="wpa2a_2"><img src="http://www.stardothosting.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.stardothosting.com/blog/2012/05/16/automated-amazon-ebs-snapshot-backup-script-with-7-day-retention/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Managed VPS hosting services from Star Dot Hosting</title>
		<link>http://www.stardothosting.com/blog/2012/02/15/managed-vps-hosting-services-from-star-dot-hosting/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=managed-vps-hosting-services-from-star-dot-hosting</link>
		<comments>http://www.stardothosting.com/blog/2012/02/15/managed-vps-hosting-services-from-star-dot-hosting/#comments</comments>
		<pubDate>Wed, 15 Feb 2012 21:49:09 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[Company Announcements]]></category>
		<category><![CDATA[Hosting]]></category>
		<category><![CDATA[Managed Hosting Services]]></category>
		<category><![CDATA[Managed VPS Hosting]]></category>
		<category><![CDATA[company announcements]]></category>
		<category><![CDATA[managd hosting services]]></category>
		<category><![CDATA[managed vps hosting]]></category>

		<guid isPermaLink="false">http://www.stardothosting.com/blog/?p=561</guid>
		<description><![CDATA[Click here for a free quote for managed vps hosting! Hello, I thought I&#8217;d update our blog to let everyone know that we offer our extensive managed services catalog on our VPS infrastructure! If you are looking for high quality managed services from systems administrators with extensive experience, then contact our sales department for a [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2012%2F02%2F15%2Fmanaged-vps-hosting-services-from-star-dot-hosting%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2012%2F02%2F15%2Fmanaged-vps-hosting-services-from-star-dot-hosting%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>
<center><big><b><a href="http://www.stardothosting.com/managed-hosting/" target="_new">Click here for a free quote for managed vps hosting!</a></b></big></center></p>
<p>Hello,</p>
<p>I thought I&#8217;d update our blog to let everyone know that we offer our extensive managed services catalog on our VPS infrastructure!</p>
<p>If you are looking for high quality managed services from systems administrators with extensive experience, then contact our sales department for a consultation / quotation!</p>
<p>Find below just a SAMPLE of some of the managed services we provide :</p>
<p><b><big>Support Services</b></big><br />
- 24/7/365 Technical Support (Ticketing system)<br />
- 24/7/365 Alert monitoring on-call rotation pager system<br />
- Online Customer Service Center 		</p>
<p><b><big>Linux Administration</b></big><br />
- Installs, reinstalls and updates<br />
- Trouble Shooting and configuration<br />
- Apache configuration, optimization &#038; Setup<br />
- Linux X64 installation, optimization and maintenance<br />
- Security optimizations<br />
- Proactive and reactive maintenance<br />
- Installs, reinstalls and updates<br />
- Trouble Shooting and configuration</p>
<p><b><big>Managed MySQL and MSSQL</b></big><br />
- MySQL and MS SQL first time install service<br />
- MySQL maintenance and troubleshooting</p>
<p><b><big>24/7/365 System Availability</b></big><br />
- Availability monitoring (Ping and Synthetic Transactions)<br />
- Performance monitoring of key server parameters<br />
- Graphing and trending		</p>
<p><b><big>Security Services</b></big><br />
- Routine Security Patching<br />
- Routine Security scanning and auditing<br />
- Penetration testing, SQL Injection<br />
- Quarterly security audit reporting<br />
- Dedicated hardware firewalls for all clients	</p>
<p><b><big>Hardware Maintenance</b></big><br />
- Hardware failure alerting and monitoring		</p>
<p><b><big>Offsite Backups</b></big><br />
- Remote off-site backups per 50gb nightly		</p>
<p>
<center><big><b><a href="http://www.stardothosting.com/managed-hosting/" target="_new">Click here for a free quote for managed vps hosting!</a></b></big></center></p>
<p><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2012%2F02%2F15%2Fmanaged-vps-hosting-services-from-star-dot-hosting%2F&amp;linkname=Managed%20VPS%20hosting%20services%20from%20Star%20Dot%20Hosting" title="Digg" rel="nofollow" target="_blank"><img src="http://www.stardothosting.com/blog/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2012%2F02%2F15%2Fmanaged-vps-hosting-services-from-star-dot-hosting%2F&amp;linkname=Managed%20VPS%20hosting%20services%20from%20Star%20Dot%20Hosting" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.stardothosting.com/blog/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_reddit" href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2012%2F02%2F15%2Fmanaged-vps-hosting-services-from-star-dot-hosting%2F&amp;linkname=Managed%20VPS%20hosting%20services%20from%20Star%20Dot%20Hosting" title="Reddit" rel="nofollow" target="_blank"><img src="http://www.stardothosting.com/blog/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2012%2F02%2F15%2Fmanaged-vps-hosting-services-from-star-dot-hosting%2F&amp;linkname=Managed%20VPS%20hosting%20services%20from%20Star%20Dot%20Hosting" title="Delicious" rel="nofollow" target="_blank"><img src="http://www.stardothosting.com/blog/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_google_plusone addtoany_special_service" data-annotation="none" data-href="http://www.stardothosting.com/blog/2012/02/15/managed-vps-hosting-services-from-star-dot-hosting/"></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2012%2F02%2F15%2Fmanaged-vps-hosting-services-from-star-dot-hosting%2F&amp;title=Managed%20VPS%20hosting%20services%20from%20Star%20Dot%20Hosting" id="wpa2a_4"><img src="http://www.stardothosting.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.stardothosting.com/blog/2012/02/15/managed-vps-hosting-services-from-star-dot-hosting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Checking and repairing mysql replication automatically</title>
		<link>http://www.stardothosting.com/blog/2012/02/02/checking-and-repairing-mysql-replication-automatically/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=checking-and-repairing-mysql-replication-automatically</link>
		<comments>http://www.stardothosting.com/blog/2012/02/02/checking-and-repairing-mysql-replication-automatically/#comments</comments>
		<pubDate>Thu, 02 Feb 2012 17:15:02 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Hosting]]></category>
		<category><![CDATA[Shell Scripting]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[mysql replication]]></category>
		<category><![CDATA[systems administration]]></category>

		<guid isPermaLink="false">http://www.stardothosting.com/blog/?p=486</guid>
		<description><![CDATA[Hello! MySQL replication has been known to easily break, as a result of a large multitude of potential causes. Sometimes the replication can even break if an erroneous query is executed on the master server. With all the potential issues that may break replication, we thought it prudent to write an automated check script that [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2012%2F02%2F02%2Fchecking-and-repairing-mysql-replication-automatically%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2012%2F02%2F02%2Fchecking-and-repairing-mysql-replication-automatically%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Hello!</p>
<p>MySQL replication has been known to easily break, as a result of a large multitude of potential causes.</p>
<p>Sometimes the replication can even break if an erroneous query is executed on the master server.</p>
<p>With all the potential issues that may break replication, we thought it prudent to write an automated check script that can run on a scheduled basis (i.e. every 10-15 minutes), check the Slave status, report on any errors if applicable and attempt to repair replication.</p>
<p>We have built this script to exit and send mail alerts if any step of the checking and repairing process fails or generates an error in itself.</p>
<p>The script also generates a lock file to ensure that no more than one check process can run at any given time. We feel this script could be best used for scenarios for remote MySQL slaves, for example. Adding this extra layer may ensure a more reliable replication. </p>
<p>The repair process is simply 3 MySQL Commands :</p>
<pre>
stop slave;
reset slave;
slave start;
</pre>
<p>The above directives assume that you have a master.info with the mysql master server information statically set. No CHANGE MASTER commands have to be executed as a result. Resetting the slave clears the error and resumes replication, and all the queries missed during the time it failed should be queued and applied after it starts again.</p>
<p>Here is the script : </p>
<pre>
#!/bin/sh
# Slave replication auto recovery and alert
# Star Dot Hosting 2012

currentmonth=`date "+%Y-%m-%d"`
lock_file=/tmp/slave_alert.lck

echo "MySQL Replication Check Script" > /var/log/replication_check.log 2>&#038;1
echo "------------------------------" >> /var/log/replication_check.log 2>&#038;1
echo "$currentmonth" >> /var/log/replication_check.log 2>&#038;1
echo "" >> /var/log/replication_check.log 2>&#038;1

# Check if lock file exists
if [ -f $lock_file ];
then
        echo "Lock file exists! Possible conflict!" >> /var/log/replication_check.log 2>&#038;1
        mail_alert
        exit 1
else
        touch $lock_file
fi

# Fix slave
function fix_replication () {
        mysql -u root --password="XXXXX" -Bse "stop slave" >> /var/log/replication_check.log 2>&#038;1
        if [ "$?" -eq 0 ];
        then
                echo "Stop slave succeeded..." >> /var/log/replication_check.log 2>&#038;1
        else
                echo "Slave recover function failed" >> /var/log/replication_check.log 2>&#038;1
                mail_alert
                exit 1
        fi
        mysql -u root --password="XXXXX" -Bse "reset slave" >> /var/log/replication_check.log 2>&#038;1
        if [ "$?" -eq 0 ];
        then
                echo "Reset slave succeeded..." >> /var/log/replication_check.log 2>&#038;1
        else
                echo "Slave recover function failed" >> /var/log/replication_check.log 2>&#038;1
                mail_alert

                exit 1
        fi
        mysql -u root --password="XXXXX" -Bse "slave start" >> /var/log/replication_check.log 2>&#038;1
        if [ "$?" -eq 0 ];
        then
                echo "Slave start succeeded." >> /var/log/replication_check.log 2>&#038;1
        else
                echo "Slave recover function failed" >> /var/log/replication_check.log 2>&#038;1
                mail_alert
                exit 1
        fi
}

# Alert function
function mail_alert () {
        cat /var/log/replication_check.log | mail -s "Replication check errors!" kkutzko@n49.com
}

# Check if Slave is running properly
Slave_IO_Running=`mysql -u root --password="XXXXX" -Bse "show slave status\G" | grep Slave_IO_Running | awk '{ print $2 }'`
Slave_SQL_Running=`mysql -u root --password="XXXXX" -Bse "show slave status\G" | grep Slave_SQL_Running | awk '{ print $2 }'`
Last_error=`mysql -u root --password="XXXXX" -Bse "show slave status\G" | grep Last_error | awk -F \: '{ print $2 }'`

# If no values are returned, slave is not running
if [ -z $Slave_IO_Running -o -z $Slave_SQL_Running ];
then
        echo "Replication is not configured or you do not have the required access to MySQL"
        exit 1
fi

# If everythings running, remove lockfile if it exists and exit
if [ $Slave_IO_Running == 'Yes' ] &#038;&#038; [ $Slave_SQL_Running == 'Yes' ];
then
        rm $lock_file
        echo "Replication slave is running" >> /var/log/replication_check.log 2>&#038;1
        echo "Removed Alert Lock" >> /var/log/replication_check.log 2>&#038;1
elif [ $Slave_SQL_Running == 'No' ] || [ $Slave_IO_Running == 'No' ];
then
        echo "SQL thread not running on server `hostname -s`!" >> /var/log/replication_check.log 2>&#038;1
        echo "Last Error:" $Last_error >> /var/log/replication_check.log 2>&#038;1
        fix_replication
        mail_alert
        rm $lock_file
fi

echo "Script complete!" >> /var/log/replication_check.log 2>&#038;1
exit 0
</pre>
<p><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2012%2F02%2F02%2Fchecking-and-repairing-mysql-replication-automatically%2F&amp;linkname=Checking%20and%20repairing%20mysql%20replication%20automatically" title="Digg" rel="nofollow" target="_blank"><img src="http://www.stardothosting.com/blog/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2012%2F02%2F02%2Fchecking-and-repairing-mysql-replication-automatically%2F&amp;linkname=Checking%20and%20repairing%20mysql%20replication%20automatically" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.stardothosting.com/blog/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_reddit" href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2012%2F02%2F02%2Fchecking-and-repairing-mysql-replication-automatically%2F&amp;linkname=Checking%20and%20repairing%20mysql%20replication%20automatically" title="Reddit" rel="nofollow" target="_blank"><img src="http://www.stardothosting.com/blog/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2012%2F02%2F02%2Fchecking-and-repairing-mysql-replication-automatically%2F&amp;linkname=Checking%20and%20repairing%20mysql%20replication%20automatically" title="Delicious" rel="nofollow" target="_blank"><img src="http://www.stardothosting.com/blog/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_google_plusone addtoany_special_service" data-annotation="none" data-href="http://www.stardothosting.com/blog/2012/02/02/checking-and-repairing-mysql-replication-automatically/"></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2012%2F02%2F02%2Fchecking-and-repairing-mysql-replication-automatically%2F&amp;title=Checking%20and%20repairing%20mysql%20replication%20automatically" id="wpa2a_6"><img src="http://www.stardothosting.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.stardothosting.com/blog/2012/02/02/checking-and-repairing-mysql-replication-automatically/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Clone a XEN VPS server that resides on a LVM / Logical Volume Manager</title>
		<link>http://www.stardothosting.com/blog/2011/08/25/clone-a-xen-vps-server-that-resides-on-a-lvm-logical-volume-manager/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=clone-a-xen-vps-server-that-resides-on-a-lvm-logical-volume-manager</link>
		<comments>http://www.stardothosting.com/blog/2011/08/25/clone-a-xen-vps-server-that-resides-on-a-lvm-logical-volume-manager/#comments</comments>
		<pubDate>Thu, 25 Aug 2011 20:38:35 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[Hosting]]></category>
		<category><![CDATA[Xen]]></category>
		<category><![CDATA[lvm]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[systems administration]]></category>
		<category><![CDATA[vps backup]]></category>
		<category><![CDATA[xen]]></category>
		<category><![CDATA[xen backup]]></category>

		<guid isPermaLink="false">http://blog.stardothosting.com/?p=467</guid>
		<description><![CDATA[Hello! We thought it would be important to share this information as it might be interesting to someone who wants to replicate the same VPS across many instances in order to create a farm of web servers (for example). This uses very similar concepts to our LVM XEN backup post a while back. Step 1: [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2011%2F08%2F25%2Fclone-a-xen-vps-server-that-resides-on-a-lvm-logical-volume-manager%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2011%2F08%2F25%2Fclone-a-xen-vps-server-that-resides-on-a-lvm-logical-volume-manager%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Hello!</p>
<p>We thought it would be important to share this information as it might be interesting to someone who wants to replicate the same VPS across many instances in order to create a farm of web servers (for example).</p>
<p>This uses very similar concepts to our <A href="http://blog.stardothosting.com/2010/03/19/how-to-backup-xen-with-logical-volume-mounts-works-with-hypervm-solusvm-fluidvm-and-more/">LVM XEN backup</a> post a while back.</p>
<p><big><b>Step 1: Take a snapshot of the current VPS</b></big></p>
<p>This is simple. Use the <b>lvcreate</b> command with the <b>-s</b> option to create a snapshot of the running VPS. We assume your VPS is 5GB in size, so just replace that with however large your VPS is :</p>
<pre>
lvcreate -s -L 5GB -n snapshot_name /dev/VolGroup00/running_vps_image
</pre>
<p><big><b>Step 2: Create your new VPS</b></big></p>
<p>This is important. You want to create a new vps, assign a MAC and IP address first and let the creation process fully finish. Then shut the VPS down.</p>
<p><big><b>Step 3: Copy the snapshot to the new VPS</b></big></p>
<p>All you have to do is use the <b>dd</b> command to transfer the snapshot image to the newly created VPS image :</p>
<pre>
dd if=/dev/VolGroup00/snapshot_name of=/dev/VolGroup00/new_vps_image
</pre>
<p>All done! Dont forget to remove the snapshot after your done with it :</p>
<pre>
lvremove -f /dev/VolGroup00/snapshot_name
</pre>
<p>Start up the new vps and you should have a carbon copy of the previous vps!</p>
<p><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2011%2F08%2F25%2Fclone-a-xen-vps-server-that-resides-on-a-lvm-logical-volume-manager%2F&amp;linkname=Clone%20a%20XEN%20VPS%20server%20that%20resides%20on%20a%20LVM%20%2F%20Logical%20Volume%20Manager" title="Digg" rel="nofollow" target="_blank"><img src="http://www.stardothosting.com/blog/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2011%2F08%2F25%2Fclone-a-xen-vps-server-that-resides-on-a-lvm-logical-volume-manager%2F&amp;linkname=Clone%20a%20XEN%20VPS%20server%20that%20resides%20on%20a%20LVM%20%2F%20Logical%20Volume%20Manager" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.stardothosting.com/blog/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_reddit" href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2011%2F08%2F25%2Fclone-a-xen-vps-server-that-resides-on-a-lvm-logical-volume-manager%2F&amp;linkname=Clone%20a%20XEN%20VPS%20server%20that%20resides%20on%20a%20LVM%20%2F%20Logical%20Volume%20Manager" title="Reddit" rel="nofollow" target="_blank"><img src="http://www.stardothosting.com/blog/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2011%2F08%2F25%2Fclone-a-xen-vps-server-that-resides-on-a-lvm-logical-volume-manager%2F&amp;linkname=Clone%20a%20XEN%20VPS%20server%20that%20resides%20on%20a%20LVM%20%2F%20Logical%20Volume%20Manager" title="Delicious" rel="nofollow" target="_blank"><img src="http://www.stardothosting.com/blog/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_google_plusone addtoany_special_service" data-annotation="none" data-href="http://www.stardothosting.com/blog/2011/08/25/clone-a-xen-vps-server-that-resides-on-a-lvm-logical-volume-manager/"></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2011%2F08%2F25%2Fclone-a-xen-vps-server-that-resides-on-a-lvm-logical-volume-manager%2F&amp;title=Clone%20a%20XEN%20VPS%20server%20that%20resides%20on%20a%20LVM%20%2F%20Logical%20Volume%20Manager" id="wpa2a_8"><img src="http://www.stardothosting.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.stardothosting.com/blog/2011/08/25/clone-a-xen-vps-server-that-resides-on-a-lvm-logical-volume-manager/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux VPS, Virtual Hosting, XEN VPS Hosting, CPanel VPS Hosting or Managed Hosting Services</title>
		<link>http://www.stardothosting.com/blog/2011/08/16/linux-vps-virtual-hosting-xen-vps-hosting-cpanel-vps-hosting-or-managed-hosting-services/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=linux-vps-virtual-hosting-xen-vps-hosting-cpanel-vps-hosting-or-managed-hosting-services</link>
		<comments>http://www.stardothosting.com/blog/2011/08/16/linux-vps-virtual-hosting-xen-vps-hosting-cpanel-vps-hosting-or-managed-hosting-services/#comments</comments>
		<pubDate>Tue, 16 Aug 2011 07:13:26 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[Company Announcements]]></category>
		<category><![CDATA[Hosting]]></category>
		<category><![CDATA[linux vps]]></category>
		<category><![CDATA[managed hosting services]]></category>
		<category><![CDATA[star dot hosting]]></category>
		<category><![CDATA[vps hosting]]></category>
		<category><![CDATA[web hosting]]></category>
		<category><![CDATA[xen vps]]></category>

		<guid isPermaLink="false">http://blog.stardothosting.com/?p=462</guid>
		<description><![CDATA[Hey there, Before I update regarding my continued experiences with Xen, KVM, Varnish, FreeBSD and all the other (exciting) things that I do, I thought I&#8217;d remind anyone here who is looking for linux vps hosting, virtual hosting or specifically xen vps hosting or even cpanel vps hosting to check out our company website : [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2011%2F08%2F16%2Flinux-vps-virtual-hosting-xen-vps-hosting-cpanel-vps-hosting-or-managed-hosting-services%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2011%2F08%2F16%2Flinux-vps-virtual-hosting-xen-vps-hosting-cpanel-vps-hosting-or-managed-hosting-services%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Hey there,</p>
<p>Before I update regarding my continued experiences with Xen, KVM, Varnish, FreeBSD and all the other (exciting) things that I do, I thought I&#8217;d remind anyone here who is looking for linux vps hosting, virtual hosting or specifically xen vps hosting or even cpanel vps hosting to check out our company website : <a href="http://www.stardothosting.com" target="_new">www.stardothosting.com</a></p>
<p>If you&#8217;re looking for managed hosting services, dedicated hosting or anything along those lines, feel free to fill out our managed hosting quotation form here : <a href="http://www.stardothosting.com/managed-hosting/" target="_new">www.stardothosting.com/managed-hosting</a></p>
<p>Thanks!</p>
<p><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2011%2F08%2F16%2Flinux-vps-virtual-hosting-xen-vps-hosting-cpanel-vps-hosting-or-managed-hosting-services%2F&amp;linkname=Linux%20VPS%2C%20Virtual%20Hosting%2C%20XEN%20VPS%20Hosting%2C%20CPanel%20VPS%20Hosting%20or%20Managed%20Hosting%20Services" title="Digg" rel="nofollow" target="_blank"><img src="http://www.stardothosting.com/blog/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2011%2F08%2F16%2Flinux-vps-virtual-hosting-xen-vps-hosting-cpanel-vps-hosting-or-managed-hosting-services%2F&amp;linkname=Linux%20VPS%2C%20Virtual%20Hosting%2C%20XEN%20VPS%20Hosting%2C%20CPanel%20VPS%20Hosting%20or%20Managed%20Hosting%20Services" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.stardothosting.com/blog/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_reddit" href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2011%2F08%2F16%2Flinux-vps-virtual-hosting-xen-vps-hosting-cpanel-vps-hosting-or-managed-hosting-services%2F&amp;linkname=Linux%20VPS%2C%20Virtual%20Hosting%2C%20XEN%20VPS%20Hosting%2C%20CPanel%20VPS%20Hosting%20or%20Managed%20Hosting%20Services" title="Reddit" rel="nofollow" target="_blank"><img src="http://www.stardothosting.com/blog/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2011%2F08%2F16%2Flinux-vps-virtual-hosting-xen-vps-hosting-cpanel-vps-hosting-or-managed-hosting-services%2F&amp;linkname=Linux%20VPS%2C%20Virtual%20Hosting%2C%20XEN%20VPS%20Hosting%2C%20CPanel%20VPS%20Hosting%20or%20Managed%20Hosting%20Services" title="Delicious" rel="nofollow" target="_blank"><img src="http://www.stardothosting.com/blog/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_google_plusone addtoany_special_service" data-annotation="none" data-href="http://www.stardothosting.com/blog/2011/08/16/linux-vps-virtual-hosting-xen-vps-hosting-cpanel-vps-hosting-or-managed-hosting-services/"></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2011%2F08%2F16%2Flinux-vps-virtual-hosting-xen-vps-hosting-cpanel-vps-hosting-or-managed-hosting-services%2F&amp;title=Linux%20VPS%2C%20Virtual%20Hosting%2C%20XEN%20VPS%20Hosting%2C%20CPanel%20VPS%20Hosting%20or%20Managed%20Hosting%20Services" id="wpa2a_10"><img src="http://www.stardothosting.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.stardothosting.com/blog/2011/08/16/linux-vps-virtual-hosting-xen-vps-hosting-cpanel-vps-hosting-or-managed-hosting-services/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Varnish Caching with Joomla</title>
		<link>http://www.stardothosting.com/blog/2011/08/08/varnish-caching-with-joomla/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=varnish-caching-with-joomla</link>
		<comments>http://www.stardothosting.com/blog/2011/08/08/varnish-caching-with-joomla/#comments</comments>
		<pubDate>Mon, 08 Aug 2011 21:05:50 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[Hosting]]></category>
		<category><![CDATA[Load Balancing]]></category>
		<category><![CDATA[Varnish Cache]]></category>
		<category><![CDATA[joomla]]></category>
		<category><![CDATA[systems administration]]></category>
		<category><![CDATA[varnish cache]]></category>
		<category><![CDATA[varnish joomla]]></category>

		<guid isPermaLink="false">http://blog.stardothosting.com/?p=437</guid>
		<description><![CDATA[Hello There! One of the exciting new technologies to come out in the last few years is a tremendously efficient and dynamic caching system called Varnish (see : http://www.varnish-cache.org). We have been employing the use of Varnish for high traffic websites for the purposes of user experience improvements as well as for redundancy and load [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2011%2F08%2F08%2Fvarnish-caching-with-joomla%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2011%2F08%2F08%2Fvarnish-caching-with-joomla%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Hello There!</p>
<p>One of the exciting new technologies to come out in the last few years is a tremendously efficient and dynamic caching system called Varnish (see : <a href="http://www.varnish-cache.org" target="_new">http://www.varnish-cache.org</a>).</p>
<p>We have been employing the use of Varnish for high traffic websites for the purposes of user experience improvements as well as for redundancy and load balancing purposes.</p>
<p>Varnish can do it all &#8211; complex load balancing and polling based on many different weighting methodologies for fail over, as well as holding on to a &#8220;stale&#8221; cache in the event of a back end web server outage, or perhaps for geographic redundancy (holding a stale cache in a secondary data center).</p>
<p>One of the challenges we have faced in the many different implementations of varnish into web stacks, is dealing with dynamic and user session (i.e. &#8220;logged in&#8221;) content. </p>
<p>If the Internet was full of only static (see 1995) html files, varnish would work beautifully out of the box. Unfortunately the web is a complicated mess of session based authentication, POSTS, GETS and query strings among a few things.</p>
<p>One of our recent accomplishments was getting the Joomla 1.5 content management system to work with Varnish 2.1.</p>
<p>The biggest challenge for Joomla was that it creates a session cookie for all users. This means the session is created and established for any guest visiting the site, and if they decide to log in , that same session is used to establish a logged in session through authentication. This is an apparent effort to deter or avoid session hijacking.</p>
<p>The problem with this is that Varnish ends up caching all the logged in session content, as well as the anonymous front page content. </p>
<p>I spent a significant amount of time fine tuning my VCL (varnish configuration language) to play nice with Joomla. Unfortunately it became apparent that some minor modifications to the Joomla code was necessary in order for it to communicate properly with Varnish.</p>
<p><big><u><b>Step 1 : Move the login form off the front page</big></u></b></p>
<p>I realize this might be a hard decision. I cant offer an alternative. If you have an integrated login form on the front page of your site, and you wish to cache that page with varnish, you will likely have to chose one or the other. It would probably be ideal to replace that login form with a button to bring the user to a secondary page off the main page. </p>
<p>For the sake of argument, lets call our site &#8220;example.com&#8221; and the login page url within Joomla should look like the following :</p>
<p><b>http://www.example.com/index.php?option=com_user&#038;view=login</b></p>
<p>Take note of <b>login</b> URI in this string.</p>
<p>The reason we need the login form on a secondary page is because we need an almost &#8220;sandboxed&#8221; section of the site where the anonymous session cookie can be established, and passed through the authentication process to a logged in session. We will tell varnish to essentially ignore this page.</p>
<p><big><u><b>Step 2 : Modify Joomla to send HTTP headers for user/guest sessions</big></u></b></p>
<p>This isn&#8217;t that hard. In the Joomla code, there is a section where it defines the HTTP headers it sends to the browser for cache variables such as expire times and whatnot. I&#8217;m going to assume you have turned off the built-in Joomla caching system. </p>
<p>What you need to do is tell Joomla to send a special HTTP header that will give either a True or False value if the user is logged in or not. This is useful information. It will allow varnish to not cache any logged in content such as &#8220;Welcome back, USERNAME&#8221; after the user is passed back to the front page from logging in.</p>
<p>In my joomla installation, I modified the following file :</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">libraries/joomla/environment/response.php</div></div>
<p>The parent folder being the public_html / root folder for your Joomla installation. In this file, please find the line that determines if the Joomla caching system is disabled :</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">if (JResponse::allowCache() === false)</div></div>
<p>After this line, you will see about 5 HTTP header declarations (expires, last-modified, cache-control, cache-control again and pragma). Above those declarations , add the following 6 lines of code :</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$user =&amp; JFactory::getUser();<br />
if (!$user-&gt;guest) {<br />
JResponse::setHeader( 'X-Logged-In', 'True', true);<br />
} else {<br />
JResponse::setHeader( 'X-Logged-In', 'False', true );<br />
}</div></div>
<p>If you read the above code, its fairly straight forward. I do a check to see if the user is a guest (aka anonymous) or not. If they are logged in I send an HTTP header called &#8220;X-Logged-In&#8221;, and assign a &#8220;True&#8221; value to it. If the user is not logged in, it sets it to &#8220;False&#8221;.</p>
<p>Pretty easy, right?</p>
<p>This will allow varnish to avoid caching a logged in user&#8217;s page.</p>
<p><big><u><b>Step 3 : Configure Varnish</big></u></b></p>
<p>This is the part that took the most time during this entire process. Mind you patching the Joomla code and whatnot took some time as well, this process took a lot of experimentation and long hours examining session cookies and host headers. </p>
<p>What I will do is break down the generalized configuration directives into two groups : VCL_RECV and VCL_FETCH.</p>
<p><big><b>VCL_RECV</big></b></p>
<p>In here, I set a bunch of IF statement directives to tell varnish what it should look up in the cache and what it should pipe to the backend and what it should pass. This could probably be optimized and improved upon, but it works for me :</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># If user sends an http POST, pipe to backend<br />
if (req.request == &quot;POST&quot;) {<br />
set req.backend = iamloggedin;<br />
return(pipe);<br />
}<br />
<br />
# http authenticated sessions are piped<br />
if (req.http.Authenticate || req.http.Authorization) {<br />
set req.backend = iamloggedin;<br />
return(pipe);<br />
}<br />
<br />
# if the user is coming FROM the login page, pipe to backend <br />
if (req.http.referer ~ &quot;(?i)(com_user|login)&quot;) {<br />
set req.backend = iamloggedin;<br />
return(pipe);<br />
}</div></div>
<p><big><b>VCL_FETCH</big></b></p>
<p>The fetch section is a little bit easier. I only have about 5 directives. The first one is the most important one you want to look at. It &#8220;unsets&#8221; the cookie from any page on the site, EXCEPT the login page. This allows varnish to properly establish the logged in session. The subsequent rules determine what to deliver and what to pass based on URI or HTTP header checks :</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># discard backend setcookie unless it equals the following<br />
if (!req.url ~ &quot;(?i)(login|com_user|user|logout)&quot;) {<br />
unset beresp.http.Set-Cookie;<br />
}<br />
<br />
if (req.http.referer ~ &quot;(?i)(com_user|login|logout)&quot;) {<br />
set req.backend = iamloggedin;<br />
return(pass);<br />
}<br />
<br />
if (beresp.http.x-logged-in ~ &quot;False&quot;){<br />
set req.backend = webfarm;<br />
return(deliver);<br />
}<br />
<br />
if (beresp.http.x-logged-in ~ &quot;True&quot;){<br />
set req.backend = iamloggedin;<br />
return(pass);<br />
}<br />
<br />
if (req.http.Authenticate || req.http.Authorization) {<br />
set req.backend = iamloggedin;<br />
return(pass);<br />
}</div></div>
<p>Thats it! I just saved you many sleepless nights (I hope!). Hopefully your headers will look something like this after you implement varnish in front of Joomla :</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Set-Cookie&nbsp; example_auth_129bf15asdfasdf52f3afaafawef; path=/<br />
P3P CP=&quot;NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM&quot;<br />
X-Logged-In False<br />
Expires Mon, 1 Jan 2001 00:00:00 GMT<br />
Last-Modified &nbsp; Mon, 08 Aug 2011 20:49:37 GMT<br />
Cache-Control &nbsp; post-check=0, pre-check=0<br />
Pragma&nbsp; no-cache<br />
Content-Type&nbsp; &nbsp; text/html; charset=utf-8<br />
Content-Length&nbsp; 85898<br />
Date&nbsp; &nbsp; Mon, 08 Aug 2011 21:01:52 GMT<br />
X-Varnish &nbsp; 761778669 761751685<br />
Age 735<br />
Via 1.1 varnish<br />
Connection&nbsp; keep-alive<br />
X-Cache-Svr cache.example.com<br />
X-Cache HIT<br />
X-Cache-Hits&nbsp; &nbsp; 121</div></div>
<p><b><big><u>UPDATE : 12/08/2011</b></big></u></p>
<p>I realize I made a mistake and have corrected this post. In vcl_fetch, i had the following :</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># discard backend setcookie unless it equals the following<br />
if (!req.url ~ &quot;(?i)(login|com_user|user|logout)&quot;) {<br />
unset req.http.Set-Cookie;<br />
}</div></div>
<p>Well I realize I should be unsetting the response cookie, not the set cookie. For some reason, the above (erroneous) directive works only right after you login. If you start clicking around the site, your logged in session disappears. I suspect this is because either joomla or varnish is mistakenly unsetting a logged in session.</p>
<p>This is the correct entry (I have fixed it in my original post as well) :</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># discard backend setcookie unless it equals the following<br />
if (!req.url ~ &quot;(?i)(login|com_user|user|logout)&quot;) {<br />
unset beresp.http.Set-Cookie;<br />
}</div></div>
<p>After making the above change, I can login and browse the site and my session stays intact. Mind you, the Joomla site I am testing with is definitely not a vanilla Joomla installation. </p>
<p>I&#8217;d love to hear from anyone who has accomplished the above scenario either way!</p>
<p><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2011%2F08%2F08%2Fvarnish-caching-with-joomla%2F&amp;linkname=Varnish%20Caching%20with%20Joomla" title="Digg" rel="nofollow" target="_blank"><img src="http://www.stardothosting.com/blog/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2011%2F08%2F08%2Fvarnish-caching-with-joomla%2F&amp;linkname=Varnish%20Caching%20with%20Joomla" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.stardothosting.com/blog/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_reddit" href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2011%2F08%2F08%2Fvarnish-caching-with-joomla%2F&amp;linkname=Varnish%20Caching%20with%20Joomla" title="Reddit" rel="nofollow" target="_blank"><img src="http://www.stardothosting.com/blog/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2011%2F08%2F08%2Fvarnish-caching-with-joomla%2F&amp;linkname=Varnish%20Caching%20with%20Joomla" title="Delicious" rel="nofollow" target="_blank"><img src="http://www.stardothosting.com/blog/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_google_plusone addtoany_special_service" data-annotation="none" data-href="http://www.stardothosting.com/blog/2011/08/08/varnish-caching-with-joomla/"></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2011%2F08%2F08%2Fvarnish-caching-with-joomla%2F&amp;title=Varnish%20Caching%20with%20Joomla" id="wpa2a_12"><img src="http://www.stardothosting.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.stardothosting.com/blog/2011/08/08/varnish-caching-with-joomla/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>50% off any hosting plan for the first THREE months!</title>
		<link>http://www.stardothosting.com/blog/2010/12/13/50-off-any-hosting-plan-for-the-three-months/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=50-off-any-hosting-plan-for-the-three-months</link>
		<comments>http://www.stardothosting.com/blog/2010/12/13/50-off-any-hosting-plan-for-the-three-months/#comments</comments>
		<pubDate>Mon, 13 Dec 2010 21:17:52 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[Company Announcements]]></category>
		<category><![CDATA[Hosting]]></category>
		<category><![CDATA[coupon]]></category>
		<category><![CDATA[deal]]></category>
		<category><![CDATA[stardothosting]]></category>
		<category><![CDATA[web hosting deal]]></category>
		<category><![CDATA[web hosting discount]]></category>

		<guid isPermaLink="false">http://blog.stardothosting.com/?p=420</guid>
		<description><![CDATA[We are excited about a new promotion for our web hosting catalog here at *.hosting. We are offering a 50% discount for ANY of our SHARED or VPS hosting plans for the first 3 (thats THREE) months!!!! Simply enter the following promotional code during the signup process : SDH50OFF2010 It&#8217;s that simple! The 50% discount [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2010%2F12%2F13%2F50-off-any-hosting-plan-for-the-three-months%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2010%2F12%2F13%2F50-off-any-hosting-plan-for-the-three-months%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>We are excited about a new promotion for our web hosting catalog here at *.hosting.</p>
<p><b><big>We are offering a 50% discount for ANY of our SHARED or VPS hosting plans for the first 3 (thats THREE) months!!!!</big></b></p>
<p>Simply enter the following promotional code during the signup process :</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">SDH50OFF2010</div></div>
<p>It&#8217;s that simple! The 50% discount will then be immediately applied to the first three months of hosting &#8212; no matter what the hosting plan you chose!</p>
<p><center><b><big><a href="http://www.stardothosting.com" target="_new">View our hosting plans here</a></big></b></center></p>
<p>Happy Holidays from Star Dot Hosting! </p>
<p><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2010%2F12%2F13%2F50-off-any-hosting-plan-for-the-three-months%2F&amp;linkname=50%25%20off%20any%20hosting%20plan%20for%20the%20first%20THREE%20months%21" title="Digg" rel="nofollow" target="_blank"><img src="http://www.stardothosting.com/blog/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2010%2F12%2F13%2F50-off-any-hosting-plan-for-the-three-months%2F&amp;linkname=50%25%20off%20any%20hosting%20plan%20for%20the%20first%20THREE%20months%21" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.stardothosting.com/blog/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_reddit" href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2010%2F12%2F13%2F50-off-any-hosting-plan-for-the-three-months%2F&amp;linkname=50%25%20off%20any%20hosting%20plan%20for%20the%20first%20THREE%20months%21" title="Reddit" rel="nofollow" target="_blank"><img src="http://www.stardothosting.com/blog/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2010%2F12%2F13%2F50-off-any-hosting-plan-for-the-three-months%2F&amp;linkname=50%25%20off%20any%20hosting%20plan%20for%20the%20first%20THREE%20months%21" title="Delicious" rel="nofollow" target="_blank"><img src="http://www.stardothosting.com/blog/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_google_plusone addtoany_special_service" data-annotation="none" data-href="http://www.stardothosting.com/blog/2010/12/13/50-off-any-hosting-plan-for-the-three-months/"></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2010%2F12%2F13%2F50-off-any-hosting-plan-for-the-three-months%2F&amp;title=50%25%20off%20any%20hosting%20plan%20for%20the%20first%20THREE%20months%21" id="wpa2a_14"><img src="http://www.stardothosting.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.stardothosting.com/blog/2010/12/13/50-off-any-hosting-plan-for-the-three-months/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Migrate from Linux to Xen with Rsync</title>
		<link>http://www.stardothosting.com/blog/2010/11/11/migrate-from-linux-to-xen-with-rsync/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=migrate-from-linux-to-xen-with-rsync</link>
		<comments>http://www.stardothosting.com/blog/2010/11/11/migrate-from-linux-to-xen-with-rsync/#comments</comments>
		<pubDate>Thu, 11 Nov 2010 17:30:06 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[Hosting]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Xen]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[rsync]]></category>
		<category><![CDATA[systems administration]]></category>
		<category><![CDATA[xen]]></category>

		<guid isPermaLink="false">http://blog.stardothosting.com/?p=410</guid>
		<description><![CDATA[I decided to write this little guide to provide the relatively simple steps needed to migrate your linux system to a Xen (HVM) virtual instance. It is assumed that on your source and destination boxes, that you only have one root &#8220;/&#8221; partition. If you partitioned out your file system differently, you will have to [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2010%2F11%2F11%2Fmigrate-from-linux-to-xen-with-rsync%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2010%2F11%2F11%2Fmigrate-from-linux-to-xen-with-rsync%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>I decided to write this little guide to provide the relatively simple steps needed to migrate your linux system to a Xen (HVM) virtual instance.</p>
<p>It is assumed that on your source and destination boxes, that you only have one root &#8220;/&#8221; partition. If you partitioned out your file system differently, you will have to accommodate that based on these instructions.</p>
<p>The following steps walk you through the process of migrating linux to Xen from start to finish :</p>
<p><big><b>1. Install the exact same version of linux on your destination server</b></big><br />
This isn&#8217;t really 100% necessary, obviously. You could always boot into Finnix, partition your disk and install Grub. If you are uncomfortable doing that, install the distribution from start to finish. The file system will be overwritten anyways.</p>
<p><big><b>2. Boot into finnix on the destination system</b></big><br />
If you have never used  <a href="http://www.finnix.org/" target="_new">Finnix</a>, it is a &#8220;self contained, bootable linux distribution&#8221;. I like it alot actually and have used it for similar purposes, rescue operations and the like.</p>
<p><big><b>3. Setup networking on both destination and source systems</b></big><br />
If both systems are on the same network, you could assign local IP addresses to ensure the process of synchronisation is speedy and unobstructed.</p>
<p>Ensure you configure networking either way and that you set a root password and start ssh :</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">passwd<br />
/etc/init.d/ssh start</div></div>
<p><big><b>4. Mount the partition that you want to copy to on the destination server</b></big><br />
Remember, so far everything you are doing has been on the destination server. Mount the destination partition within finnix :</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">mount /dev/xvdb</div></div>
<p><big><b>5. On the source server, rsync all the files of the source partition to the destination partition</big></b><br />
When logged into the source server, simply issue the following rsync command and direct it to the destination server&#8217;s partition you just mounted :</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">rsync -aHSKDvz -e ssh / root@12.34.56.78:/mnt/xvdb/</div></div>
<p>The rsync process will complete and the partition on the destination server should be ready to boot into. Remember to change the networking configuration if you dont want any IP conflicts to happen.</p>
<p>I hope this helps!</p>
<p><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2010%2F11%2F11%2Fmigrate-from-linux-to-xen-with-rsync%2F&amp;linkname=Migrate%20from%20Linux%20to%20Xen%20with%20Rsync" title="Digg" rel="nofollow" target="_blank"><img src="http://www.stardothosting.com/blog/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2010%2F11%2F11%2Fmigrate-from-linux-to-xen-with-rsync%2F&amp;linkname=Migrate%20from%20Linux%20to%20Xen%20with%20Rsync" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.stardothosting.com/blog/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_reddit" href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2010%2F11%2F11%2Fmigrate-from-linux-to-xen-with-rsync%2F&amp;linkname=Migrate%20from%20Linux%20to%20Xen%20with%20Rsync" title="Reddit" rel="nofollow" target="_blank"><img src="http://www.stardothosting.com/blog/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2010%2F11%2F11%2Fmigrate-from-linux-to-xen-with-rsync%2F&amp;linkname=Migrate%20from%20Linux%20to%20Xen%20with%20Rsync" title="Delicious" rel="nofollow" target="_blank"><img src="http://www.stardothosting.com/blog/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_google_plusone addtoany_special_service" data-annotation="none" data-href="http://www.stardothosting.com/blog/2010/11/11/migrate-from-linux-to-xen-with-rsync/"></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2010%2F11%2F11%2Fmigrate-from-linux-to-xen-with-rsync%2F&amp;title=Migrate%20from%20Linux%20to%20Xen%20with%20Rsync" id="wpa2a_16"><img src="http://www.stardothosting.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.stardothosting.com/blog/2010/11/11/migrate-from-linux-to-xen-with-rsync/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Foundry Load Balancers HTTP sticky sessions</title>
		<link>http://www.stardothosting.com/blog/2010/08/30/foundry-load-balancers-http-sticky-sessions/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=foundry-load-balancers-http-sticky-sessions</link>
		<comments>http://www.stardothosting.com/blog/2010/08/30/foundry-load-balancers-http-sticky-sessions/#comments</comments>
		<pubDate>Mon, 30 Aug 2010 19:15:06 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[Hosting]]></category>
		<category><![CDATA[Load Balancing]]></category>
		<category><![CDATA[foundry]]></category>
		<category><![CDATA[load balancers]]></category>
		<category><![CDATA[sticky sessions]]></category>

		<guid isPermaLink="false">http://blog.stardothosting.com/?p=401</guid>
		<description><![CDATA[This post is intended to be a general guide for configuring &#8220;stickied&#8221; load balanced HTTP servers. Whether it&#8217;s F5 load balancers, foundry load balancers or open source based load balancers (keepalived/lvs), the concepts are the same and can be migrated across said platforms. If you have a paid of foundry&#8217;s and are looking to configure [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2010%2F08%2F30%2Ffoundry-load-balancers-http-sticky-sessions%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2010%2F08%2F30%2Ffoundry-load-balancers-http-sticky-sessions%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>This post is intended to be a general guide for configuring &#8220;stickied&#8221; load balanced HTTP servers. Whether it&#8217;s F5 load balancers, foundry load balancers or open source based load balancers (keepalived/lvs), the concepts are the same and can be migrated across said platforms.</p>
<p>If you have a paid of foundry&#8217;s and are looking to configure stickied load balanced HTTP servers, hopefully this guide will provide some assistance.</p>
<ul>
<strong>Logging into the load balancer</strong></ul>
<p>Telnet to the box and &#8216;enable&#8217; to allow admin access. The first thing you want to do is show the current configuration to view the existing setup for other working boxes :</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&gt; telnet 192.x.x.x<br />
Trying 192.x.x.x...<br />
Connected to 10.x.x.x.<br />
Escape character is '^]'.<br />
<br />
User Access Verification<br />
<br />
Please Enter Login Name: admin<br />
Please Enter Password: <br />
<br />
User login successful.<br />
<br />
SLB-telnet@XXXX&gt;enable<br />
Enable Password:<br />
Error - Incorrect username or password.<br />
SLB-telnet@XXXX&gt;enable<br />
Enable Password:<br />
SLB-telnet@XXXX#</div></div>
<ul>
<strong>Real servers : defining the multiple load balanced boxes</strong></ul>
<p>Show the existing configuration on the foundary :</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">sh config</div></div>
<p>Take a look at the configuration of two &#8220;real&#8221; servers, which are the two servers that are behind the load balancer that will have balanced sticky connections :</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">server real serverposapp01-tomcat01 192.168.1.141<br />
&nbsp;port default disable<br />
&nbsp;port 8001<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; <br />
!<br />
server real serverposapp03-tomcat01 192.168.1.143<br />
&nbsp;port default disable<br />
&nbsp;port 8001</div></div>
<p>The above example is balancing TCP 8001 traffic, which is for TOMCAT. Here are entries for two servers doing simple HTTP traffic :</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">server real serverapp01-vhost01 192.168.1.195<br />
&nbsp;port default disable &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp;port http<br />
&nbsp;port http keepalive<br />
&nbsp;port http url &quot;HEAD /&quot;<br />
!<br />
server real serverapp02-vhost01 192.168.1.196<br />
&nbsp;port default disable<br />
&nbsp;port http<br />
&nbsp;port http keepalive<br />
&nbsp;port http url &quot;HEAD /&quot;</div></div>
<p>This example is similar to the tomcat example, except you have several options. &#8220;port default disable&#8221; disables all other ports. &#8220;port http keepalive&#8221; and &#8220;port http url &#8220;HEAD /&#8221;" define the http checks that take place to ensure apache is running on that box. If not , it will fail over to the second box and stop sending traffic to it.</p>
<ul>
<strong>SSL Connections</strong></ul>
<p>SSL incoming connections are handled by the load balancer initially, then passed off to the actual server as regular http / port 80 traffic. The internal box configuration would be similar to the above configuration examples :</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">server virtual portal 192.168.1.104<br />
&nbsp;port default disable<br />
&nbsp;port ssl sticky<br />
&nbsp;port ssl ssl-terminate portal<br />
&nbsp;bind ssl serverapp01-portal01 http<br />
<br />
Notice how instead of &quot;port http sticky&quot; , its &quot;port ssl sticky&quot;. First of all, the sticky option is only set on the &quot;virtual&quot; configuration directives. Secondly, the SSL traffic is bound to the real servers via http in the last line of this example. Its pretty self explanatory.<br />
[edit] Regular HTTP Sticky Connections<br />
<br />
If no SSL Is being used on the site at all, then all you need is to set an HTTP virtual configuration :<br />
<br />
&lt;code&gt;<br />
server virtual serverapp-vhost01 192.168.1.106<br />
&nbsp;port default disable<br />
&nbsp;port http sticky &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;bind http serverapp02-vhost01 http</div></div>
<ul>
<strong>Configuring the external IP to NAT to the internal virtual</strong></ul>
<p>Typically, you will have a firewall in front of the load balancer that actaully holds the external ip addresses. The traffic is filtered initially by the firewall, then NAT&#8217;d to the virtual ip (VIP) of the load balancer, which then handles balancing the traffic.</p>
<p>You will need to either establish a new external ip , or use an existing one (for instance, if you are moving from 1 web server to 2 web servers , and want to balance the traffic using the load balancer). You need to setup the external IP address, and NAT it to the internal VIP.</p>
<ul>
<strong>Verifying the configuration works</strong></ul>
<p>Once everything is setup properly, and the external IP is being NAT&#8217;d to the load balancer, it is time to ensure the load balancer is seeing the connections. You could do this before doing the switchover on the firewall as well, just to ensure everything looks right before actually doing the switchover.</p>
<p>To see the active connections being load balanced, issue the following command (replacing the servername for whichever one you want to check) :</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">sh server real serverapp02-vhost01</div></div>
<p>That should display information similar to this :</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Real Servers Info<br />
========================<br />
State(St) - ACT:active, ENB:enabled, FAL:failed, TST:test, DIS:disabled,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; UNK:unknown, UNB:unbind, AWU:await-unbind, AWD:await-delete<br />
<br />
Name: serverapp02-vhost01 &nbsp; &nbsp; State: Active &nbsp; &nbsp; &nbsp; Cost: 0 &nbsp;IP:192.168.1.196: &nbsp; 1<br />
Mac: 0012.7990.d06a &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Weight: 0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;MaxConn: 2000000<br />
SrcNAT: not-cfg, not-op &nbsp; &nbsp; &nbsp;DstNAT: not-cfg, not-op &nbsp; &nbsp;Serv-Rsts: 0<br />
tcp conn rate:udp conn rate = 1:0, max tcp conn rate:max udp conn rate = 8:0<br />
BP max local conn configured No: 0 0 0 0 0 0 <br />
BP max conn percentage configured No: 0 0 0 0 0 0 <br />
Use local conn : No<br />
<br />
Port &nbsp; &nbsp;St &nbsp;Ms ServerConn TotConn &nbsp; &nbsp;Rx-pkts &nbsp; Tx-pkts &nbsp; Rx-octet &nbsp; Tx-octet &nbsp; Reas<br />
---- &nbsp; &nbsp;-- &nbsp;-- ------- ------- &nbsp; &nbsp;------- &nbsp; ------- &nbsp; -------- &nbsp; -------- &nbsp; ----<br />
default DIS 0 &nbsp;0 &nbsp; &nbsp; &nbsp; 0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0 &nbsp; &nbsp; &nbsp; &nbsp; 0 &nbsp; &nbsp; &nbsp; &nbsp; 0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0 &nbsp;<br />
http &nbsp; &nbsp;ACT 0 &nbsp;104 &nbsp; &nbsp; 13094 &nbsp; &nbsp; &nbsp;181671 &nbsp; &nbsp;150813 &nbsp; &nbsp;162364862 &nbsp;20325115 &nbsp; 0 &nbsp;<br />
<br />
Server &nbsp;Total &nbsp;104 &nbsp; &nbsp; 13094 &nbsp; &nbsp; &nbsp;181671 &nbsp; &nbsp;150813 &nbsp; &nbsp;162364862 &nbsp;20325115 &nbsp; 0</div></div>
<p>The above is displaying the specific connection details for a single real server. To check the VIP / Virtual server :</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">sh server virtual tomcat</div></div>
<p>Which will display the following :</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Virtual Servers Info<br />
<br />
Name: tomcat &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; State: Enabled &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; IP:192.168.1.101: &nbsp; 1<br />
Pred: least-conn &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ACL-Id: 0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;TotalConn: 149959<br />
<br />
Port &nbsp; &nbsp;State &nbsp; &nbsp; Sticky &nbsp;Concur &nbsp;Proxy &nbsp;DSR &nbsp; ServerConn &nbsp;TotConn &nbsp;PeakConn &nbsp;<br />
---- &nbsp; &nbsp;----- &nbsp; &nbsp; ------ &nbsp;------ &nbsp;----- &nbsp;--- &nbsp; ------- &nbsp;------- &nbsp;-------- &nbsp;<br />
<br />
default disabled &nbsp;NO &nbsp; &nbsp; &nbsp;NO &nbsp; &nbsp; &nbsp;NO &nbsp; &nbsp; NO &nbsp; &nbsp;0 &nbsp; &nbsp; &nbsp; &nbsp;0 &nbsp; &nbsp; &nbsp; &nbsp;0 &nbsp; &nbsp; &nbsp; &nbsp; <br />
ssl &nbsp; &nbsp; enabled &nbsp; YES &nbsp; &nbsp; NO &nbsp; &nbsp; &nbsp;NO &nbsp; &nbsp; NO &nbsp; &nbsp;46 &nbsp; &nbsp; &nbsp; 149959 &nbsp; 443</div></div>
<p>You can see that &#8220;ServerConn&#8221; is displaying 46 connections. Thats it! </p>
<p><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2010%2F08%2F30%2Ffoundry-load-balancers-http-sticky-sessions%2F&amp;linkname=Foundry%20Load%20Balancers%20HTTP%20sticky%20sessions" title="Digg" rel="nofollow" target="_blank"><img src="http://www.stardothosting.com/blog/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2010%2F08%2F30%2Ffoundry-load-balancers-http-sticky-sessions%2F&amp;linkname=Foundry%20Load%20Balancers%20HTTP%20sticky%20sessions" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.stardothosting.com/blog/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_reddit" href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2010%2F08%2F30%2Ffoundry-load-balancers-http-sticky-sessions%2F&amp;linkname=Foundry%20Load%20Balancers%20HTTP%20sticky%20sessions" title="Reddit" rel="nofollow" target="_blank"><img src="http://www.stardothosting.com/blog/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2010%2F08%2F30%2Ffoundry-load-balancers-http-sticky-sessions%2F&amp;linkname=Foundry%20Load%20Balancers%20HTTP%20sticky%20sessions" title="Delicious" rel="nofollow" target="_blank"><img src="http://www.stardothosting.com/blog/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_google_plusone addtoany_special_service" data-annotation="none" data-href="http://www.stardothosting.com/blog/2010/08/30/foundry-load-balancers-http-sticky-sessions/"></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2010%2F08%2F30%2Ffoundry-load-balancers-http-sticky-sessions%2F&amp;title=Foundry%20Load%20Balancers%20HTTP%20sticky%20sessions" id="wpa2a_18"><img src="http://www.stardothosting.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.stardothosting.com/blog/2010/08/30/foundry-load-balancers-http-sticky-sessions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hosting Coupon : 60% off the first month for ANY plan!</title>
		<link>http://www.stardothosting.com/blog/2010/07/15/hosting-coupon-60-off-the-first-month-for-any-plan/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=hosting-coupon-60-off-the-first-month-for-any-plan</link>
		<comments>http://www.stardothosting.com/blog/2010/07/15/hosting-coupon-60-off-the-first-month-for-any-plan/#comments</comments>
		<pubDate>Thu, 15 Jul 2010 17:02:16 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[Company Announcements]]></category>
		<category><![CDATA[Hosting]]></category>
		<category><![CDATA[coupon]]></category>
		<category><![CDATA[star dot hosting]]></category>
		<category><![CDATA[web hosting]]></category>
		<category><![CDATA[web hosting discount]]></category>

		<guid isPermaLink="false">http://blog.stardothosting.com/?p=380</guid>
		<description><![CDATA[Hello there, Just thought I&#8217;d share an exclusive coupon / discount for all of our shared / vps hosting plans that allows for 60% off the first month of hosting fee&#8217;s : COUPON CODE : SDHTWT2010 Take a look at our main site for plan details. This coupon expires and there is only a limited [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2010%2F07%2F15%2Fhosting-coupon-60-off-the-first-month-for-any-plan%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2010%2F07%2F15%2Fhosting-coupon-60-off-the-first-month-for-any-plan%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Hello there,</p>
<p>Just thought I&#8217;d share an exclusive coupon / discount for all of our shared / vps hosting plans that allows for 60% off the first month of hosting fee&#8217;s :</p>
<p><big><b>COUPON CODE : SDHTWT2010</big></b></p>
<p>Take a look at our <a href="http://www.stardothosting.com" target="_new">main site</a> for plan details. This coupon expires and there is only a limited number of them available!</p>
<p>Don&#8217;t say we never gave you nothin&#8217; <img src='http://www.stardothosting.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2010%2F07%2F15%2Fhosting-coupon-60-off-the-first-month-for-any-plan%2F&amp;linkname=Hosting%20Coupon%20%3A%2060%25%20off%20the%20first%20month%20for%20ANY%20plan%21" title="Digg" rel="nofollow" target="_blank"><img src="http://www.stardothosting.com/blog/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2010%2F07%2F15%2Fhosting-coupon-60-off-the-first-month-for-any-plan%2F&amp;linkname=Hosting%20Coupon%20%3A%2060%25%20off%20the%20first%20month%20for%20ANY%20plan%21" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.stardothosting.com/blog/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_reddit" href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2010%2F07%2F15%2Fhosting-coupon-60-off-the-first-month-for-any-plan%2F&amp;linkname=Hosting%20Coupon%20%3A%2060%25%20off%20the%20first%20month%20for%20ANY%20plan%21" title="Reddit" rel="nofollow" target="_blank"><img src="http://www.stardothosting.com/blog/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2010%2F07%2F15%2Fhosting-coupon-60-off-the-first-month-for-any-plan%2F&amp;linkname=Hosting%20Coupon%20%3A%2060%25%20off%20the%20first%20month%20for%20ANY%20plan%21" title="Delicious" rel="nofollow" target="_blank"><img src="http://www.stardothosting.com/blog/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_google_plusone addtoany_special_service" data-annotation="none" data-href="http://www.stardothosting.com/blog/2010/07/15/hosting-coupon-60-off-the-first-month-for-any-plan/"></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2010%2F07%2F15%2Fhosting-coupon-60-off-the-first-month-for-any-plan%2F&amp;title=Hosting%20Coupon%20%3A%2060%25%20off%20the%20first%20month%20for%20ANY%20plan%21" id="wpa2a_20"><img src="http://www.stardothosting.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.stardothosting.com/blog/2010/07/15/hosting-coupon-60-off-the-first-month-for-any-plan/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

