<?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; Kevin</title>
	<atom:link href="http://www.stardothosting.com/blog/author/admin/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>Fri, 03 Feb 2012 21:43:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Massive Amazon Route53 API Bind Zone Import Script</title>
		<link>http://www.stardothosting.com/blog/2012/02/03/massive-amazon-route53-api-bind-zone-import-script/</link>
		<comments>http://www.stardothosting.com/blog/2012/02/03/massive-amazon-route53-api-bind-zone-import-script/#comments</comments>
		<pubDate>Fri, 03 Feb 2012 16:39:31 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[Amazon API]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Shell Scripting]]></category>
		<category><![CDATA[amazon]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[bind]]></category>
		<category><![CDATA[route53]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[systems administration]]></category>
		<category><![CDATA[systems automation]]></category>

		<guid isPermaLink="false">http://www.stardothosting.com/blog/?p=491</guid>
		<description><![CDATA[Hello there, Occasionally some of our managed services work has us dealing directly with other cloud providers such as Amazon. One of our clients set a requirement to migrate over 5,000 domain&#8217;s to Amazon&#8217;s Route53 DNS service. There was little doubt that this could be automated, but since we have never done this massive of [...]]]></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%2F03%2Fmassive-amazon-route53-api-bind-zone-import-script%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2012%2F02%2F03%2Fmassive-amazon-route53-api-bind-zone-import-script%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Hello there,</p>
<p>Occasionally some of our managed services work has us dealing directly with other cloud providers such as Amazon. One of our clients set a requirement to migrate over 5,000 domain&#8217;s to Amazon&#8217;s Route53 DNS service. </p>
<p>There was little doubt that this could be automated, but since we have never done this massive of a deployment through Amazon&#8217;s API directly, we thought it might be interesting to post the process as well as the script through which we managed the import process.</p>
<p>Essentially the script utilizes a master domain name list file as its basis for looping through the import. The master list refers to the bind zone files and imports them into Amazon&#8217;s Route53 via the Cli53 tool package.</p>
<p>One final note, the script outputs all completed domain imports into a CSV file with the following format :</p>
<pre>
domain.com,ns1.nameserver.com,ns2.nameserver.com,ns3.nameserver.com,ns4.nameserver.com
</pre>
<p>This is because when facilitating the actual nameserver change request, all the nameservers assigned to domains when imported to Route53 are randomly generated, so the script has to keep track of these nameserver/domain associations.</p>
<p>The script isn&#8217;t perfect and could benefit from some optimizations and more error checking (it does a lot of error checking already, however), but here it is in its entirety. We hope you will have some use for it!</p>
<pre>
#!/bin/sh
# Import all zone files into amazon
# Star Dot Hosting 2012
# www.stardothosting.com

currentmonth=`date "+%Y-%m-%d"`

#sanitize input and verify input was given
command=`echo "$1" | sed 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`

if [ -z "$1" ];
then
        echo "AWS ZONE IMPORT"
        echo "---------------"
        echo ""
        echo "Usage : ./importzone.sh file.txt"
        echo ""
        exit 0
fi

echo "zone import log : $currentmonth" > /var/log/importzone.log 2>&#038;1
echo " " >> /var/log/importzone.log 2>&#038;1

for obj0 in $(cat $1);
do
        echo "checking if $obj0 was already migrated ..."
        ls -la /usr/local/zones/$1-zones/complete | grep -w $obj0 >> /dev/null 2>&#038;1
        if [ "$?" -eq 1 ]
        then
        echo "importing $obj0 ..."

        #check if zone file has NS records
        cat /usr/local/zones/$1-zones/$obj0.txt | grep NS >> /dev/null 2>&#038;1
        if [ "$?" -eq 0 ]
        then
                echo "Nameserver exists, continuing..."
        else
                echo "Adding nameserver to record..."
                echo "$obj0. 43201 IN NS ns1.nameserver.com." >> /usr/local/zones/$1-zones/$obj0.txt
        fi

        #check if zone exists
        /usr/local/zones/cli53/bin/cli53 info $obj0 >> /var/log/importzone.log 2>&#038;1
        if [ "$?" -eq 0 ]
        then
                # grab NAMESERVERS
                nameservers=`/usr/local/zones/cli53/bin/cli53 rrlist $obj0 | grep "NS" | awk -F "NS\t" '{printf "%s\n", $2}' | sed 's/.$/g' | sed ':a;N;$!ba;s/\n/,/g'`
   # import zone file
                /usr/local/zones/cli53/bin/cli53 import $obj0 -r -f /usr/local/zones/$1-zones/$obj0.txt
                if [ "$?" -eq 0 ]
                then
                        #move to complete folder
                        mv /usr/local/zones/$1-zones/$obj0.txt /usr/local/zones/$1-zones/complete
                else
                        echo "There was an error in importing the zone file!" >> /var/log/importzone.log
                        exit 1
                fi
        else
                #create on route53
                /usr/local/zones/cli53/bin/cli53 create $obj0 >> /var/log/importzone.log 2>&#038;1
                # grab NAMESERVERS
                nameservers=`/usr/local/zones/cli53/bin/cli53 rrlist $obj0 | grep "NS" | awk -F "NS\t" '{printf "%s\n", $2}' | sed 's/.$/g' | sed ':a;N;$!ba;s/\n/,/g'`
                # import zone file
                /usr/local/zones/cli53/bin/cli53 import $obj0 -r -f /usr/local/zones/$1-zones/$obj0.txt
                if [ "$?" -eq 0 ]
                then
                        #move to complete folder
                        mv /usr/local/zones/$1-zones/$obj0.txt /usr/local/zones/$1-zones/complete
                else
                        echo "There was an error in importing the zone file!" >> /var/log/importzone.log
                        exit 1
                fi
        fi

        # output domain + nameservers in a CSV with format : domain.com,ns1,ns2,ns3,ns4
        echo "$obj0,$nameservers" >> nameserver_registrar_request.txt 2&#038;>1
        else
                echo "Domain already migrated .. !"
        fi
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%2F02%2F03%2Fmassive-amazon-route53-api-bind-zone-import-script%2F&amp;linkname=Massive%20Amazon%20Route53%20API%20Bind%20Zone%20Import%20Script" 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%2F03%2Fmassive-amazon-route53-api-bind-zone-import-script%2F&amp;linkname=Massive%20Amazon%20Route53%20API%20Bind%20Zone%20Import%20Script" 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%2F03%2Fmassive-amazon-route53-api-bind-zone-import-script%2F&amp;linkname=Massive%20Amazon%20Route53%20API%20Bind%20Zone%20Import%20Script" 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%2F03%2Fmassive-amazon-route53-api-bind-zone-import-script%2F&amp;linkname=Massive%20Amazon%20Route53%20API%20Bind%20Zone%20Import%20Script" 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><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2012%2F02%2F03%2Fmassive-amazon-route53-api-bind-zone-import-script%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2012%2F02%2F03%2Fmassive-amazon-route53-api-bind-zone-import-script%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><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%2F03%2Fmassive-amazon-route53-api-bind-zone-import-script%2F&amp;title=Massive%20Amazon%20Route53%20API%20Bind%20Zone%20Import%20Script" 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/02/03/massive-amazon-route53-api-bind-zone-import-script/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/</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><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2012%2F02%2F02%2Fchecking-and-repairing-mysql-replication-automatically%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2012%2F02%2F02%2Fchecking-and-repairing-mysql-replication-automatically%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><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_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/02/checking-and-repairing-mysql-replication-automatically/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Managed hosting services from Star Dot Hosting</title>
		<link>http://www.stardothosting.com/blog/2012/01/17/managed-hosting-services-from-star-dot-hosting/</link>
		<comments>http://www.stardothosting.com/blog/2012/01/17/managed-hosting-services-from-star-dot-hosting/#comments</comments>
		<pubDate>Tue, 17 Jan 2012 14:36:51 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[Company Announcements]]></category>
		<category><![CDATA[company announcements]]></category>
		<category><![CDATA[managed hosting services]]></category>
		<category><![CDATA[star dot hosting]]></category>
		<category><![CDATA[stardothosting]]></category>

		<guid isPermaLink="false">http://blog.stardothosting.com/?p=481</guid>
		<description><![CDATA[Hello There, This update is to highlight the managed hosting services and systems administration services offered by Star Dot Hosting. We are proud to offer some of the highest standards of managed hosting services in the industry. Here are some of the services we offer : - 24x7x365 Monitoring, Alerting &#038; Trending - 24x7x365 ~15minute [...]]]></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%2F01%2F17%2Fmanaged-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%2F01%2F17%2Fmanaged-hosting-services-from-star-dot-hosting%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Hello There,</p>
<p>This update is to highlight the managed hosting services and systems administration services offered by Star Dot Hosting.</p>
<p>We are proud to offer some of the highest standards of managed hosting services in the industry. Here are some of the services we offer :</p>
<p>- 24x7x365 Monitoring, Alerting &#038; Trending<br />
- 24x7x365 ~15minute response time support ticketing system<br />
- Quarterly Security Auditing &#038; Reporting<br />
- Patch management &#038; Maintenance<br />
- Administration, troubleshooting, deployment and code pushes<br />
- Hardware upgrades, deployments, expansion<br />
- Dedicated load balancing<br />
- Dedicated firewalls<br />
- Database replication &#038; clustering<br />
- Dedicated edge content caching</p>
<p>Those are just some of the services we would provide to you! Our quotation process involves rigorous consultations which includes technology assessment and especially a complete understanding of how your scenario can be designed and where improvements can be made, if any.</p>
<p>Feel free to click the link below to visit our managed hosting page, and fill out a quotation request form! </p>
<p><center><br />
<a href="http://www.stardothosting.com/managed-hosting/" target="_new"><big><b>http://www.stardothosting.com/managed-hosting/</big></b></a><br />
</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%2F01%2F17%2Fmanaged-hosting-services-from-star-dot-hosting%2F&amp;linkname=Managed%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%2F01%2F17%2Fmanaged-hosting-services-from-star-dot-hosting%2F&amp;linkname=Managed%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%2F01%2F17%2Fmanaged-hosting-services-from-star-dot-hosting%2F&amp;linkname=Managed%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%2F01%2F17%2Fmanaged-hosting-services-from-star-dot-hosting%2F&amp;linkname=Managed%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><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2012%2F01%2F17%2Fmanaged-hosting-services-from-star-dot-hosting%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2012%2F01%2F17%2Fmanaged-hosting-services-from-star-dot-hosting%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><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%2F01%2F17%2Fmanaged-hosting-services-from-star-dot-hosting%2F&amp;title=Managed%20hosting%20services%20from%20Star%20Dot%20Hosting" 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/01/17/managed-hosting-services-from-star-dot-hosting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Backup, compress and encrpyt your git repository</title>
		<link>http://www.stardothosting.com/blog/2011/11/25/backup-compress-and-encrpyt-your-git-repository/</link>
		<comments>http://www.stardothosting.com/blog/2011/11/25/backup-compress-and-encrpyt-your-git-repository/#comments</comments>
		<pubDate>Fri, 25 Nov 2011 17:45:57 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[GIT]]></category>
		<category><![CDATA[Shell Scripting]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[git backup]]></category>
		<category><![CDATA[scripting]]></category>

		<guid isPermaLink="false">http://blog.stardothosting.com/?p=471</guid>
		<description><![CDATA[Greetings, I thought I&#8217;d share a quick script in the scope of backing up GIT repositories for the purposes of encrypted and compressed off-site backups. Unfortunately git does not have an equivalent of svnadmin dump or export, which can conveniently be piped to stdout. What the above scenario would do is shorten the amount of [...]]]></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%2F11%2F25%2Fbackup-compress-and-encrpyt-your-git-repository%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2011%2F11%2F25%2Fbackup-compress-and-encrpyt-your-git-repository%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Greetings,</p>
<p>I thought I&#8217;d share a quick script in the scope of backing up GIT repositories for the purposes of encrypted and compressed off-site backups.</p>
<p>Unfortunately git does not have an equivalent of svnadmin dump or export, which can conveniently be piped to stdout.</p>
<p>What the above scenario would do is shorten the amount of commands a script would require in order to accomplish a similar task.</p>
<p>Find below a quick bash script that clones a repository, tar/gzip&#8217;s it, encrypts the archive and keeps 7 days worth of archive files :</p>
<pre>
#!/bin/sh
# GIT Backup script
# Written by Star Dot Hosting

todaysdate=`date "+%Y-%m-%d"`

#check command input
if [ -z "$1" ];
then
        echo "GIT BACKUP SCRIPT"
        echo "-----------------"
        echo ""
        echo "Usage : ./backup.sh reponame , i.e. yourdomain.git"
        echo ""
        exit 0
fi

echo "GIT Backup Log: " $currentmonth > /var/log/backup.log
echo -e "----------------------------------------" >> /var/log/backup.log
echo -e "" >> /var/log/backup.log

# Find and remove files older than 7 days
/usr/bin/find /data/git/git-backups -type f -mtime +7 -delete >> /var/log/backup.log 2>&#038;1

# Begin creating working directory to clone into
/bin/mkdir /data/git/git-backup/working >> /var/log/backup.log 2>&#038;1
/usr/bin/git clone /data/git/$1 /data/git/git-backup/working >> /var/log/backup.log 2>&#038;1

# Archive working directory into repo name encrpyted tar file
/bin/tar -czvf - /data/git/git-backup/working | /usr/bin/openssl enc -aes-256-cbc -pass pass:abcABC123 -e | dd of=/data/git/git-backup/$1.tar.gz.enc >> /var/log/backup.log 2>&#038;1

# Remove working directory
/bin/rm -rf /data/git/git-backup/working >> /var/log/backup.log 2>&#038;1
</pre>
<p>FYI if you ever needed to decrypt the openssl encrypted backup archive, the command below should do the job :</p>
<pre>
openssl aes-256-cbc -d -pass pass:abcABC123 -in $1.tar.gz.enc -out decrypted.tar.gz
</pre>
<p><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2011%2F11%2F25%2Fbackup-compress-and-encrpyt-your-git-repository%2F&amp;linkname=Backup%2C%20compress%20and%20encrpyt%20your%20git%20repository" 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%2F11%2F25%2Fbackup-compress-and-encrpyt-your-git-repository%2F&amp;linkname=Backup%2C%20compress%20and%20encrpyt%20your%20git%20repository" 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%2F11%2F25%2Fbackup-compress-and-encrpyt-your-git-repository%2F&amp;linkname=Backup%2C%20compress%20and%20encrpyt%20your%20git%20repository" 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%2F11%2F25%2Fbackup-compress-and-encrpyt-your-git-repository%2F&amp;linkname=Backup%2C%20compress%20and%20encrpyt%20your%20git%20repository" 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><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2011%2F11%2F25%2Fbackup-compress-and-encrpyt-your-git-repository%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2011%2F11%2F25%2Fbackup-compress-and-encrpyt-your-git-repository%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><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%2F11%2F25%2Fbackup-compress-and-encrpyt-your-git-repository%2F&amp;title=Backup%2C%20compress%20and%20encrpyt%20your%20git%20repository" 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/11/25/backup-compress-and-encrpyt-your-git-repository/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/</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><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?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;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?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;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><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_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/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/</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><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?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;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?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;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><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_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/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/</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><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2011%2F08%2F08%2Fvarnish-caching-with-joomla%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2011%2F08%2F08%2Fvarnish-caching-with-joomla%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><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_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/2011/08/08/varnish-caching-with-joomla/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>New website re-design</title>
		<link>http://www.stardothosting.com/blog/2011/06/14/new-website-re-design/</link>
		<comments>http://www.stardothosting.com/blog/2011/06/14/new-website-re-design/#comments</comments>
		<pubDate>Tue, 14 Jun 2011 04:47:47 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[Company Announcements]]></category>

		<guid isPermaLink="false">http://blog.stardothosting.com/?p=434</guid>
		<description><![CDATA[We have re-designed our website and are very proud of the new look! Take a look for yourself : WWW.STARDOTHOSTING.COM Let us know what you think!]]></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%2F06%2F14%2Fnew-website-re-design%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2011%2F06%2F14%2Fnew-website-re-design%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>We have re-designed our website and are very proud of the new look! Take a look for yourself :</p>
<p><big><strong><a href="http://www.stardothosting.com" target="_new">WWW.STARDOTHOSTING.COM</a></big></strong></p>
<p>Let us know what you think!</p>
<p><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2011%2F06%2F14%2Fnew-website-re-design%2F&amp;linkname=New%20website%20re-design" 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%2F06%2F14%2Fnew-website-re-design%2F&amp;linkname=New%20website%20re-design" 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%2F06%2F14%2Fnew-website-re-design%2F&amp;linkname=New%20website%20re-design" 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%2F06%2F14%2Fnew-website-re-design%2F&amp;linkname=New%20website%20re-design" 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><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2011%2F06%2F14%2Fnew-website-re-design%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2011%2F06%2F14%2Fnew-website-re-design%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><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%2F06%2F14%2Fnew-website-re-design%2F&amp;title=New%20website%20re-design" 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/2011/06/14/new-website-re-design/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Centralized remote backup script with SSH key authentication</title>
		<link>http://www.stardothosting.com/blog/2011/02/09/centralized-remote-backup-script-with-ssh-key-authentication/</link>
		<comments>http://www.stardothosting.com/blog/2011/02/09/centralized-remote-backup-script-with-ssh-key-authentication/#comments</comments>
		<pubDate>Wed, 09 Feb 2011 20:26:39 +0000</pubDate>
		<dc:creator>Kevin</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Shell Scripting]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[centralized]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[systems administration]]></category>

		<guid isPermaLink="false">http://blog.stardothosting.com/?p=427</guid>
		<description><![CDATA[Greetings, It has been a while since we posted any useful tidbits for you , so we have decided to share one of our quick &#038; dirty centralized backup scripts. The script relies on ssh key based authentication, described here on this blog. It essentially parses a configuration file where each variable is separated by [...]]]></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%2F02%2F09%2Fcentralized-remote-backup-script-with-ssh-key-authentication%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2011%2F02%2F09%2Fcentralized-remote-backup-script-with-ssh-key-authentication%2F&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Greetings,</p>
<p>It has been a while since we posted any useful tidbits for you , so we have decided to share one of our quick &#038; dirty centralized backup scripts.</p>
<p>The script relies on ssh key based authentication, described <a href="http://blog.stardothosting.com/2009/12/07/script-to-distribute-ssh-keys-across-many-servers/">here</a> on this blog. It essentially parses a configuration file where each variable is separated by a comma and colon, as in the example config here :</p>
<pre>
hostname1,192.168.1.1,etc:var:root
hostname2,192.168.1.2,etc:var:root:usr
</pre>
<p>Note the intended backup directories in the 3rd variable, separated by colon&#8217;s. Simply populate the <b>backup-hosts.txt</b> config file (located in the same folder as the script) with all the hosts you want to be backed up. </p>
<p>The script then ssh&#8217;s to the intended host, and sends a tar -czf stream (securely) over ssh, to be output into the destination of your choice. Ideally you should centralize this script on a box that has direct access to alot of disk space.</p>
<p>Find the script here :</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">#!/bin/sh<br />
# Centralized Linux Backup Script<br />
# By Star Dot Hosting , www.stardothosting.com<br />
# Uses SSH Key based authentication and remote ssh commands to tar.gz folders to iSCSI storage<br />
<br />
<br />
todaysdate=`date &quot;+%Y-%m-%d %H:%M:%S&quot;`<br />
backupdest=&quot;/backups/linux-backups&quot;<br />
<br />
echo &quot;Centralized Linux Backup: &quot; $todaysdate &gt; /var/log/linux-backup.log<br />
echo -e &quot;----------------------------------------------&quot; &gt;&gt; /var/log/linux-backup.log<br />
echo -e &gt;&gt; /var/log/linux-backup.log<br />
<br />
<br />
for obj0 in $(cat /usr/local/bin/backup-hosts.txt | grep -v &quot;\#&quot; | awk -F &quot;,&quot; '{printf &quot;%s\n&quot;, $2}');<br />
do<br />
&nbsp; &nbsp; &nbsp; &nbsp; backupname=`cat /usr/local/bin/backup-hosts.txt | grep -v &quot;\#&quot; | grep $obj0 | awk -F &quot;,&quot; '{printf &quot;%s\n&quot;, $1}'`<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; for obj1 in $(cat /usr/local/bin/backup-hosts.txt | grep -v &quot;\#&quot; | grep $obj0 | awk -F &quot;,&quot; '{printf &quot;%s\n&quot;, $3'} | awk '{gsub(&quot;:&quot;,&quot;\n&quot;);printf&quot;%s&quot;, $<br />
0}');<br />
&nbsp; &nbsp; &nbsp; &nbsp; do<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo -e &quot;backing up $obj0 with $obj1 directory&quot; &gt;&gt; /var/log/linux-backup.log<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ssh -l root $obj0 &quot;(cd /$obj1/ &amp;&amp; tar -czf - . -C /$obj1)&quot; &gt;&gt; $backupdest/$backupname.$obj1.tar.gz 2&gt;&amp;1<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if [ &quot;$?&quot; -eq 1 ]<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo -e &quot;There were some errors while backing up $obj0 / $backupname within the $obj1 directory&quot; &gt;&gt; /var/log/linux-backup.log<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #exit 1<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo -e &quot;Backup completed on $obj0 / $backupname while backing up $obj1 directory&quot; &gt;&gt; /var/log/linux-backup.log<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fi<br />
&nbsp; &nbsp; &nbsp; &nbsp; done<br />
done<br />
<br />
echo &quot;Backup Script Completed.&quot; &gt;&gt; /var/log/linux-backup.log<br />
cat /var/log/linux-backup.log | mail -s &quot;Centralized Backup Complete&quot; topsoperations@topscms.com</div></div>
<p>You could modify this script to keep different daily backups , pruned to keep only X number of days of backups (i.e. only 7 days worth). There is alot you can do here.</p>
<p>If you have a handful of linux or bsd servers that you would like to backup in a centralized location, without having an individual script to maintain on each server, then perhaps you could use or modify this script to suit your needs.</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%2F2011%2F02%2F09%2Fcentralized-remote-backup-script-with-ssh-key-authentication%2F&amp;linkname=Centralized%20remote%20backup%20script%20with%20SSH%20key%20authentication" 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%2F02%2F09%2Fcentralized-remote-backup-script-with-ssh-key-authentication%2F&amp;linkname=Centralized%20remote%20backup%20script%20with%20SSH%20key%20authentication" 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%2F02%2F09%2Fcentralized-remote-backup-script-with-ssh-key-authentication%2F&amp;linkname=Centralized%20remote%20backup%20script%20with%20SSH%20key%20authentication" 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%2F02%2F09%2Fcentralized-remote-backup-script-with-ssh-key-authentication%2F&amp;linkname=Centralized%20remote%20backup%20script%20with%20SSH%20key%20authentication" 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><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2011%2F02%2F09%2Fcentralized-remote-backup-script-with-ssh-key-authentication%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2011%2F02%2F09%2Fcentralized-remote-backup-script-with-ssh-key-authentication%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><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%2F02%2F09%2Fcentralized-remote-backup-script-with-ssh-key-authentication%2F&amp;title=Centralized%20remote%20backup%20script%20with%20SSH%20key%20authentication" 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/2011/02/09/centralized-remote-backup-script-with-ssh-key-authentication/feed/</wfw:commentRss>
		<slash:comments>1</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/</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><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2010%2F12%2F13%2F50-off-any-hosting-plan-for-the-three-months%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.stardothosting.com%2Fblog%2F2010%2F12%2F13%2F50-off-any-hosting-plan-for-the-three-months%2F&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><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_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/12/13/50-off-any-hosting-plan-for-the-three-months/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

