<?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>AskApache &#187; Search Results  &#187;  hostgator</title>
	<atom:link href="http://www.askapache.com/search/hostgator/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.askapache.com</link>
	<description>Advanced Web Development</description>
	<lastBuildDate>Thu, 26 Apr 2012 11:29:28 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Questions I Ask Web Hosting Companies, Before Buying</title>
		<link>http://www.askapache.com/hosting/before-buying-web-hosting.html</link>
		<comments>http://www.askapache.com/hosting/before-buying-web-hosting.html#comments</comments>
		<pubDate>Sun, 25 Apr 2010 10:15:16 +0000</pubDate>
		<dc:creator>AskApache</dc:creator>
				<category><![CDATA[Hosting]]></category>

		<guid isPermaLink="false">http://www.askapache.com/?p=4419</guid>
		<description><![CDATA[<p>The following is a transcript of a chat I had with a company called tektonic, and at that time I was looking for a cheap linux host to use for some redundancy/failover operations.  I generally contact a new hosting company like this every few months.. I like to have options available in case of some kind of failure or network attack, so it's always a good idea to have a few ace linux servers in your back pocket.</p>
<p>If you've read any other articles on AskApache, you can see a certain obsession towards optimization, speed, and security -- so that is the purpose of the following questions.</p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.askapache.com/hosting/before-buying-web-hosting.html"></a><a href="http://www.askapache.com/hosting/before-buying-web-hosting.html"><cite>AskApache.com</cite></a></p><p>I'm always on the lookout for cheap hosting and great hosting companies, and being that I have done this for many years, on many platforms, and with many hosts, my only requirement is that the host uses a UNIX/BSD/LINUX operating system.  I'm just not one of those people who likes to do things the hard way, constantly, if its even possible on a non-nix, or one of those people who enjoys getting hacked or my sites defaced by a cracker.  So *nix is definitely a requirement.  This is just a current look at the basic idea I use when looking for a web host.  If you were smart you would do a whole lot more than this.</p>

<h2>Research the People</h2>
<p>Ok, in a web hosting company there are 5 distinct groups of people, at least generally, that you will want to get in contact with or at least do some background research on (like the owners/founders).  Depending on which of these groups you talk to will determine the amount and quality of information you get, the difference is night and day. Because of my past experience with really bad hosts (DreamHost), and really great hosts (<a rel="nofollow" href="http://www.wiredtree.com/298.html">WiredTree</a>), I am very cautious and purposeful in making this decision, so I go to great lengths to contact at least one person from each of these groups.  Most good advice says to also get in touch with customers.. I don't usually need/want to do that though because most customers don't know jack.  But of course I know a few of the customers because I research the hosts network block and test the speed and servers that run on their IP block.</p>

<h3>Who / Why</h3>
<p>Being a curious and inquisitive person by nature, I always do background research on who started the company, how they started it, and what skills they have.  Knowing who the owners are and if they are real unix/network experts or just snake oil salesmen really makes a difference in this world of smoke and mirrors.
<p> Here's my recommendation of which group to contact, in order of best to worst:</p>
<ol>
<li><strong>Owners/Founders</strong> - The Founders have been involved since the start of the company.  Always contact.</li>
<li><strong>System Admins</strong> - Programmers and System Operators who keep things running, fix problems tech support cant.  Always contact.</li>
<li><strong>Sales/Marketing</strong> - Both types have different motivations for what they say, and how they say it.  Always contact both.</li>
<li><strong>Tech Support</strong> - They make the web go round, will always know a lot about problems and issues their customers frequently experience.  Always contact.</li>
<li><strong>Management</strong> - These people are in charge of the day-to-day operations, overseers.  Contact optional.</li>
</ol>



<h2>Questions to Ask</h2>
<p>The following is a transcript of a chat I had with a company called <a href="http://tektonic.net/">tektonic</a>, and at that time I was looking for a cheap linux host to use for some redundancy/failover operations.  I generally contact a new hosting company like this every few months.. I like to have options available in case of some kind of failure or network attack, so it's always a good idea to have a few ace linux servers in your back pocket.</p>
<p>If you've read any other articles on AskApache, you can see a certain obsession towards optimization, speed, and security -- so that is the purpose of the following questions.</p>
<table cellspacing="0" cellpadding="5" border="1" width="100%" dir="ltr">
    <tbody>
        <tr>
            <td colspan="2"><div>General Info</div></td>
        </tr>
        <tr>
            <td><strong>Chat start time</strong></td>
            <td> Apr 7, 2010 7:18:07 AM EST</td>
        </tr>
        <tr>
            <td><strong>Chat end time</strong></td>
            <td> Apr 7, 2010 8:38:52 AM EST</td>
        </tr>
        <tr>
            <td><strong>Duration (actual chatting time)</strong></td>
            <td> 01:20:44</td>
        </tr>
        <tr>
            <td><strong>Operator</strong></td>
            <td> Vish</td>
        </tr>
    </tbody>
</table>
<h2>Chat Transcript</h2>
<div class="zebra3" style="font-size:1.1em;line-height:.9em;">

<blockquote>
    <p style="color:#ccc"><strong>info:</strong> Please wait for a site operator to respond. You are 1 out of 1 in the queue. The average wait time is 0 minutes and 30 seconds.</p>
    <p style="color:#ccc"><strong>info:</strong> You are now chatting with &#39;Vish&#39;</p>
    <p><strong>Vish:</strong> Hello</p>
    <p class="aa21"><strong>AskApache:</strong> Hi vish, i was looking to purchase a planwith you guys but had some questions.. is this the right place to ask?</p>
    <p><strong>Vish:</strong> yeah sure</p>
    <p><strong>Vish:</strong> Let me know how may I assist you with ?</p>
    <p class="aa21"><strong>AskApache:</strong> what is your cheapest plan that includes ssh?</p>
    <p><strong>Vish:</strong> <a href="http://tektonic.net/vps.php">http://tektonic.net/vps.php</a></p>
    <p><strong>Vish:</strong> Linux-360</p>
    <p class="aa21"><strong>AskApache:</strong> im there.. </p>
    <p><strong>Vish:</strong> It is cheapest plan you can have</p>
    <p class="aa21"><strong>AskApache:</strong> what does full root access mean for you guys? </p>
    <p class="aa21"><strong>AskApache:</strong> do you have swap? jailshell?</p>
    <p><strong>Vish:</strong> you have full access of you server .</p>
    <p class="aa21"><strong>AskApache:</strong> including network interface device access? ie.. is it possible to setup virtual nics?</p>
    <p><strong>Vish:</strong> Sorry we do not provide it.</p>
    <p><strong>Vish:</strong> hold on </p>
    <p><strong>Vish:</strong> Let me check</p>
    <p class="aa21"><strong>AskApache:</strong> how can i find out more about the limits of the machine for the Linux-360?</p>
    <p class="aa21"><strong>AskApache:</strong> like how many processes, fd descriptors.. </p>
    <p><strong>Vish:</strong> You can mail us at sales department.</p>
    <p><strong>Vish:</strong> They will get back to you with in few hrs with your answers </p>
    <p><strong>Vish:</strong> You can just drop mail at <a href="mailto:sales@tektonic.net">sales@tektonic.net</a></p>
    <p class="aa21"><strong>AskApache:</strong> no thanks.</p>
    <p class="aa21"><strong>AskApache:</strong> jw if you had that info offhand.</p>
    <p class="aa21"><strong>AskApache:</strong> do you know if cpanel is optinoal?</p>
    <p class="aa21"><strong>AskApache:</strong> could it be uninstalled?</p>
    <p><strong>Vish:</strong> yeah</p>
    <p><strong>Vish:</strong> you can install or uninstall as you wish </p>
    <p class="aa21"><strong>AskApache:</strong> Thanks vish you are being very helpful... a few more.. </p>
    <p><strong>Vish:</strong> sure</p>
    <p class="aa21"><strong>AskApache:</strong> what operating system?</p>
    <p><strong>Vish:</strong> Hold on ..</p>
    <p><strong>Vish:</strong> allow me a moment. </p>
    <p class="aa21"><strong>AskApache:</strong> please take your time</p>
    <p><strong>Vish:</strong> We do provide Ubantu , Centos and Debian</p>
    <p><strong>Vish:</strong> You can reinstall your server any time with one click </p>
    <p class="aa21"><strong>AskApache:</strong> what devices are supported in /dev ?</p>
    <p class="aa21"><strong>AskApache:</strong> do you support loop devices, ramdisk/tmpfs/swap?</p>
    <p><strong>Vish:</strong> One moment please..</p>
    <p class="aa21"><strong>AskApache:</strong> no rush at all, thanks</p>
    <p><strong>Vish:</strong> We do provide tmpfs but ramdisk and swap is not available .</p>
    <p><strong>Vish:</strong> All basic device are available with us optional devices like TUN is also enabled for you automatically. </p>
    <p class="aa21"><strong>AskApache:</strong> sweet</p>
    <p class="aa21"><strong>AskApache:</strong> is ipv6 supported?</p>
    <p><strong>Vish:</strong> It is there but we do support currently .</p>
    <p><strong>Vish:</strong> We are thinking to provide it in near future for our clients ;)</p>
    <p class="aa21"><strong>AskApache:</strong> good idea, people will start using it in 5years or so.. maybe</p>
    <p class="aa21"><strong>AskApache:</strong> how is the internal network segmented? vlans? </p>
    <p class="aa21"><strong>AskApache:</strong> for security..</p>
    <p><strong>Vish:</strong> Yeah, We do have Vlans</p>
    <p class="aa21"><strong>AskApache:</strong> security is very crucial.</p>
    <p><strong>Vish:</strong> You can check  more info in network here <a href="http://tektonic.net/network.php">network</a></p>
    <p class="aa21"><strong>AskApache:</strong> ok thanks brb</p>
    <p class="aa21"><strong>AskApache:</strong> do you allow kernel modules? or reloading the kernel like kexec?</p>
    <p><strong>Vish:</strong> a moment please.</p>
    <p><strong>Vish:</strong> What type kernel module you are looking for exactly ?</p>
    <p><strong>Vish:</strong> kexex is  for fast reboot .</p>
    <p><strong>Vish:</strong> Is there any specific requirement ?</p>
    <p><strong>Vish:</strong> As we do not allow kernel modules on VPS they are not supported by virtuzzo. </p>
    <p class="aa21"><strong>AskApache:</strong> ok.. so far so good. let me think a minute.</p>
    <p class="aa21"><strong>AskApache:</strong> what kind of failovers do you have? </p>
    <p class="aa21"><strong>AskApache:</strong> like if a machine fails to reboot or goes offline</p>
    <p><strong>Vish:</strong> we do not provide failover services for vpses at this time. You  will have power panel in hand using it you can reboot or reinstall your machine in one click. You can reach us 24*7 for live support.</p>
    <p class="aa21"><strong>AskApache:</strong> one problem that I&#39;ve seen on other vps&#39;s is sometimes a vps upon reboot fails to recognize the network interface/fails to connect to the web.. When that happens we are unable to ssh into the box to fix the problem and rely on support.. is this something that would be easy/normal for your support (to have to manually login to the vps locally)</p>
    <p><strong>Vish:</strong> There are the possiblities for the issue so we need to check in server but you can reach us anytime for live chat and ticket system.</p>
    <p><strong>Vish:</strong> as you are on live chat right now ;)</p>
    <p class="aa21"><strong>AskApache:</strong> so your support does have access to the vps locally? </p>
    <p class="aa21"><strong>AskApache:</strong> in case the network is down due to vps errors</p>
    <p><strong>Vish:</strong> Yes, We have the access</p>
    <p class="aa21"><strong>AskApache:</strong> do you run any packet filtering on the network or is this controlled solely with the vps?</p>
    <p class="aa21"><strong>AskApache:</strong> like iptables stuff.. switch/router filtering beyond defaults..</p>
    <p><strong>Vish:</strong> No , we dont have packet filtering the port we block is IRC only.</p>
    <p class="aa21"><strong>AskApache:</strong> great</p>
    <p><strong>Vish:</strong> I&#39;m sorry for the delay. I&#39;ll be right with you.</p>
    <p><strong>Vish:</strong> Is there anything else I may assist you with ?</p>
    <p class="aa21"><strong>AskApache:</strong> no problem, you&#39;ve answered all my questions so far.. trying to think of anything else I&#39;d like to know before buying.. </p>
    <p><strong>Vish:</strong> Sure</p>
    <p><strong>Vish:</strong> Is there anything else I can help you with ?</p>
    <p class="aa21"><strong>AskApache:</strong> Does the Linux-360 support filesystems? what storage devices are included (usually just 1 ext2/3/4 fs for vps).. Is it possible to repartition the drive? </p>
    <p class="aa21"><strong>AskApache:</strong> Oh and the other kernel module I would love to have on a vps is fuse so that I can mount remote filesystems (such as sshfs or nbd)</p>
    <p><strong>Vish:</strong> We do not provide kernel modules on VPS.</p>
    <p class="aa21"><strong>AskApache:</strong> do you allow kernel compilation? (that way i can build the module statically into the kernel) </p>
    <p><strong>Vish:</strong> A moment please.</p>
    <p><strong>Vish:</strong> We do not allow kernel compilation on VPS.</p>
    <p class="aa21"><strong>AskApache:</strong> ok, thats smart security</p>
    <p class="aa21"><strong>AskApache:</strong> what about the linux-360 partitioning question?</p>
    <p><strong>Vish:</strong> Thanks. :)</p>
    <p><strong>Vish:</strong> it is tmpfs on VPS</p>
    <p><strong>Vish:</strong> and we dot allow repartition.</p>
    <p class="aa21"><strong>AskApache:</strong> which is ultimately mounted on.. filesystems? like could I modify an ext3 / to ext4 or reiserfs?</p>
    <p class="aa21"><strong>AskApache:</strong> expected.. ok</p>
    <p><strong>Vish:</strong> No, it is vzfs</p>
    <p class="aa21"><strong>AskApache:</strong> even better.</p>
    <p class="aa21"><strong>AskApache:</strong> thats what i mostly use.</p>
    <p><strong>Vish:</strong> great</p>
    <p class="aa21"><strong>AskApache:</strong> What vps os install images do you use? like where do you get the CentOS/Ubuntu/Debian vps images? And are they modified/customized by you guys in any way?</p>
    <p class="aa21"><strong>AskApache:</strong> Or just all defaults?</p>
    <p><strong>Vish:</strong> they include basic services such as httpd, sendmail</p>
    <p class="aa21"><strong>AskApache:</strong> sorry for all the q&#39;s ... I wasn&#39;t thinking that I&#39;d actually find a good host to purchase, but so far tek is looking really good.. might go ahead within the hour.</p>
    <p><strong>Vish:</strong> otherwise default </p>
    <p><strong>Vish:</strong> We get it from parallels</p>
    <p><strong>Vish:</strong> Okay great.</p>
    <p><strong>Vish:</strong> Is there anything else I can help you with ?</p>
    <p class="aa21"><strong>AskApache:</strong> like: <a href="http://download.openvz.org/template/precreated/">http://download.openvz.org/template/precreated/</a></p>
    <p class="aa21"><strong>AskApache:</strong> do you use templates like that.. </p>
    <p><strong>Vish:</strong> We get it  from parallels</p>
    <p class="aa21"><strong>AskApache:</strong> how many employees do you have? how many customers? </p>
    <p><strong>Vish:</strong> Sorry, We do not disclose this information</p>
    <p class="aa21"><strong>AskApache:</strong> thats fine.. </p>
    <p><strong>Vish:</strong> For more you can contact sales department.</p>
    <p><strong>Vish:</strong> You are on technical department live chat.</p>
    <p class="aa21"><strong>AskApache:</strong> can you give me more info on what type of parallels products you utilize? </p>
    <p class="aa21"><strong>AskApache:</strong> I wouldn&#39;t last long on any other chat.. ;)</p>
    <p class="aa21"><strong>AskApache:</strong> I&#39;m curious so if it&#39;s a template/container I haven&#39;t used before I can test it out on my own machine.</p>
    <p><strong>Vish:</strong> We provide power panel from parallels</p>
    <p class="aa21"><strong>AskApache:</strong> i mean like the templates/container versions you use.. I want to check that you use updated/new versions and are valid licensed.</p>
    <p><strong>Vish:</strong> you mean OS version ?</p>
    <p class="aa21"><strong>AskApache:</strong> basically, do you know if you use the latest available os images from parallels.. </p>
    <p class="aa21"><strong>AskApache:</strong> and I will let you go with that.. </p>
    <p style="color:#ccc"><strong>info:</strong> Your chat transcript will be sent to your email at the end of your chat.</p>
    <p><strong>Vish:</strong> Yes , We do provide latest OS version as per requirement. </p>
    <p class="aa21"><strong>AskApache:</strong> thank you vish, you&#39;ve been most helpful. I am going to do a little more digging online about you guys and will probably be back with a couple questions.. cya around, have an awesome day</p>
</blockquote>
</div>

<h2>Hosts used by AskApache.com</h2>
<p><a rel="nofollow" href="http://www.wiredtree.com/298.html">WiredTree</a> is the main hosting company that I mainly use for this site and my business.  It took me 10+ years of trial and error before I found them, you can believe I will be posting alot more about them on this site, stay tuned.  I also use <a rel="nofollow" href="http://secure.hostgator.com/~affiliat/cgi-bin/affiliates/clickthru.cgi?id=askapache">HostGator</a>, and several other dependable nix hosts that are dirt cheap.</p>

<h2>Finding A Host</h2>
<p>I used to spend days and weeks googling for a host that wouldn't end up burning me later, oh that really sucked.  Now I use a site developed by a colleague of mine, <a href="http://www.webhostingsearch.com/">Web Hosting Search</a> as it lets me fairly quickly find a linux host with my bare requirements.  From THERE is when I start my own research.  This includes email and followups on the phone, visiting wiki's, googling owners, sneaking around in customer areas, etc..</p>



<h2>Who do you Use?</h2>
<p>I'd love to hear about anyone's experiences with specific hosts, recommendations especially!</p><p><a href="http://www.askapache.com/hosting/before-buying-web-hosting.html"></a><a href="http://www.askapache.com/hosting/before-buying-web-hosting.html">Questions I Ask Web Hosting Companies, Before Buying</a> originally appeared on <cite>AskApache.com</cite> </p>]]></content:encoded>
			<wfw:commentRss>http://www.askapache.com/hosting/before-buying-web-hosting.html/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Custom bash_profile for Advanced Shell Users</title>
		<link>http://www.askapache.com/linux/bash_profile-functions-advanced-shell.html</link>
		<comments>http://www.askapache.com/linux/bash_profile-functions-advanced-shell.html#comments</comments>
		<pubDate>Mon, 23 Nov 2009 20:32:26 +0000</pubDate>
		<dc:creator>AskApache</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.askapache.com/?p=3183</guid>
		<description><![CDATA[<p>Looking for some <strong>advanced uses for the shell</strong>?  Here is <del>some of</del> my best.  The shell is where 70% of my work takes place, and I have at least one terminal open almost 100% of the time, for viewing tailing color-coded logs, and of course for the SSH Tunnels that I use to route various networking through, like my email.  So I decided that to standardize and create a bash_profile containing the most time-saving and helpful functions that I could use on all the various hosting environments would really be some sweet sugar, so here is my constant Work-in-progress.</p>
<p>It works for all shells I encounter, including BackTrack, Debian, Knoppix, Arch Linux, etc.   Also works for many hosting environments I use including DreamHost, HostGator, WiredTree, and pretty much any linux VPS.</p>
<p>I also rely on this heavily from within shell scripts I write to access all the functions and stuff in this .bash_profile, and to do that I just do like:</p>
<pre>
#!/bin/bash
&#160;
source ~/.bash_profile &#38;amp;&#62;/dev/nulll
&#160;
pm "PM is a function to output nice messages with color"
yn "Are you enjoying the shell" &#38;amp;&#38;amp; pm "Thats great!" &#124;&#124; pm "Perhaps you&#039;re better suited for DOS"
yn "Show Calendar" &#38;amp;&#38;amp; aa_calendar
yn "Show Fortune" &#38;amp;&#38;amp; aa_fortune
</pre>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.askapache.com/linux/bash_profile-functions-advanced-shell.html"></a><a href="http://www.askapache.com/linux/bash_profile-functions-advanced-shell.html"><cite>AskApache.com</cite></a></p><p>Looking for some <strong>advanced uses for the shell</strong>?  Here is <del>some of</del> my best.  Works for all shells I encounter, including BackTrack, Debian, Knoppix, Arch Linux, etc.   Also works for many hosting environments I use including DreamHost, HostGator, WiredTree, and pretty much any linux VPS.</p>

<p class="anote">Want to get started?  Type the following in your shell to download the script and run it.  You should go over the code first and then you can just save it as your .bash_profile - whenever you want to get updated to the latest version just type aaup, a cool update function that auto dos2unix's and runs via an exec command.</p>
<pre>
curl -O http://static.askapache.com/askapache-bash-profile.txt &amp;&amp; source askapache-bash-profile.txt
Or if you trust me and my hosting provider (and you aren&#039;t on production)
curl -o ~/.bash_profile http://static.askapache.com/askapache-bash-profile.txt &amp;&amp; exec bash -l
</pre>

<p>For those of you power users and server admins that use Bash, ksh, csh, vanilla sh, etc.., or if you are just passionate about shell scripting, because it allows you to get advanced tasks done fast and efficiently, not to mention automated automatically.  I give you my .bash_profile file.   You should edit it to fit your needs, (especially the exported vars like PATH, LDFLAGS, if you don't understand something just comment it out) but it's pretty universal because I work on alot of other people's servers not to mention many different distros and platforms, and when I get hired to do some server work through a shell, I bring this script along for the ride.</p>


<h2>askapache-bash-profile.txt</h2>
<p>You can download the latest version: <a href="http://static.askapache.com/askapache-bash-profile.txt">http://static.askapache.com/askapache-bash-profile.txt</a></p>
<p>The functions and variables below are the way bash sees them, using declare -f, and alias, to make it easier for you to read and understand them.    The actual file at <a href="http://static.askapache.com/askapache-bash-profile.txt">http://static.askapache.com/askapache-bash-profile.txt</a> will always be the most updated version, as I use it personally.  And it has the whole file the way I wrote it, meaning many extra notes and much simpler to follow. Enjoy!</p>


<h2>Gist of the Script..</h2>
<p>I also rely on this heavily from within shell scripts I write to access all the functions and stuff in this .bash_profile, and to do that I just do like:</p>
<pre class='prettyprint'>
#!/bin/bash
&nbsp;
source ~/.bash_profile &amp;&gt;/dev/nulll
&nbsp;
pm "PM is a function to output nice messages with color"
yn "Are you enjoying the shell" &amp;&amp; pm "Thats great!" || pm "Perhaps you&#039;re better suited for DOS"
yn "Show Calendar" &amp;&amp; aa_calendar
yn "Show Fortune" &amp;&amp; aa_fortune
</pre>

<pre>
alias chmod=&#039;command chmod -c&#039;
alias cpr=&#039;command cp -rpv&#039;
alias df=&#039;command df -kTh&#039;
alias df1=&#039;command df -iTa&#039;
alias diff=&#039;diff -up&#039;
alias dsiz=&#039;du -sk * | sort -n --&#039;
alias du=&#039;command du -kh&#039;
alias du1=&#039;echo *|tr " " "\n" |xargs -iFF command du -hs FF|sort&#039;
alias env=&#039;command env | sort&#039;
alias h=&#039;history&#039;
alias inice=&#039;ionice -c3 -n7 nice&#039;
alias j=&#039;jobs -l&#039;
alias la=&#039;command ls -Al --color=auto&#039;
alias lc=&#039;command ls -lAcr --color=auto&#039;
alias less=&#039;vless&#039;
alias lessc=&#039;ccze -A |`type -P less` -R&#039;
alias lk=&#039;command ls -lASr --color=auto&#039;
alias llh=&#039;ll -h&#039;
alias lll=&#039;stat -c %a\ %N\ %G\ %U ${PWD}/*|sort&#039;
alias lr=&#039;command ls -lAR --color=auto&#039;
alias lt=&#039;command ls -lAtr --color=auto&#039;
alias lu=&#039;command ls -lAur --color=auto&#039;
alias lx=&#039;command ls -lAXB --color=auto&#039;
alias mann=&#039;command man -H&#039;
alias n=&#039;/usr/bin/nano3&#039;
alias p=&#039;command ps -HAcl -F S -A f|uniq -w3&#039;
alias path=&#039;echo -e ${PATH//:/\\n}&#039;
alias php=&#039;php -d report_memleaks=1 -d report_zend_debug=1 -d log_errors=0 -d ignore_repeated_errors=0 -d ignore_repeated_source=0 -d error_reporting=30719 -d display_startup_errors=1 -d display_errors=1&#039;
alias pp=&#039;command ps -HAcl -F S -A f&#039;
alias ps1=&#039;command ps -lFA&#039;
alias ps2=&#039;command ps -H&#039;
alias resetw=&#039;echo $&#039;\&#039;&#039;\33[H\33[2J&#039;\&#039;&#039;&#039;
alias subash=&#039;sudo sh -c &#039;\&#039;&#039;export HOME=/root; cd /root; exec bash -l&#039;\&#039;&#039;&#039;
alias top=&#039;top -c&#039;
alias tree=&#039;command tree -Csuflapi&#039;
alias updatedb=&#039;( ( updatedb 2&gt;/dev/null ) &amp; )&#039;
alias vim=&#039;command vim --noplugin&#039;
alias who=&#039;command who -ar -pld&#039;
alias wtf=&#039;watch -n 1 w -hs&#039;
</pre>




<p><a href="http://uploads.askapache.com/2009/08/askapache-bash_profile.png"><img src="http://uploads.askapache.com/2009/08/askapache-bash_profile.png" alt="Custom bash profile for Advanced Shell Users" title="askapache-bash_profile" width="571" height="2879" /></a></p><p><a href="http://www.askapache.com/linux/bash_profile-functions-advanced-shell.html"></a><a href="http://www.askapache.com/linux/bash_profile-functions-advanced-shell.html">Custom bash_profile for Advanced Shell Users</a> originally appeared on <cite>AskApache.com</cite> </p>]]></content:encoded>
			<wfw:commentRss>http://www.askapache.com/linux/bash_profile-functions-advanced-shell.html/feed</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>DNS Round Robin Configuration using Rsync over SSH</title>
		<link>http://www.askapache.com/linux/dns-round-robin-rsync-over-ssh.html</link>
		<comments>http://www.askapache.com/linux/dns-round-robin-rsync-over-ssh.html#comments</comments>
		<pubDate>Tue, 14 Apr 2009 05:46:20 +0000</pubDate>
		<dc:creator>AskApache</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.askapache.com/?p=2540</guid>
		<description><![CDATA[<p><a class="IFL" href="http://www.askapache.com/linux/dns-round-robin-rsync-over-ssh.html" id="id12"></a><strong>The goal is to add the HostGator server</strong> to be an exact mirror of the static.askapache.com domain, then to add that server as a 2nd A record to my DNS zone.  That way half the visitors to the size will be taking up resources and bandwidth on the <a href="http://secure.hostgator.com/cgi-bin/affiliates/clickthru.cgi?id=AskApache-rrdns">HostGator</a> server instead of mine.<br /><br /><strong>Round Robin A records</strong> in DNS are intended to evenly distribute queries between each host of the same name.  Using some tricks straight out of a hackers toolbox we can verify if the distribution is taking place.  (<a href="http://www.askapache.com/linux/dns-round-robin-rsync-over-ssh.html#dns-robin-works">It is.</a>)  <br class="C" /></p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.askapache.com/linux/dns-round-robin-rsync-over-ssh.html"></a><a href="http://www.askapache.com/linux/dns-round-robin-rsync-over-ssh.html"><cite>AskApache.com</cite></a></p><p>My traffic is growing, alot, and I need to plan how I'm going to maintain scalability, high availability, and redundancy.   Scalability is an application's ability to support a growing number of users. High availability can be defined as redundancy or speed.  I decided to setup <a href="#dns-robin-round">Round Robin DNS</a> for <a href="http://static.askapache.com/">static.askapache.com</a>, which is the "static" <a href="http://www.askapache.com/htaccess/apache-speed-subdomains.html">subdomain</a> of <a href="http://www.askapache.com/">AskApache</a> that serves all the static assets like images, javascript, css, etc.. (<em>BTW, the z stands for ZAP</em>)..  All I needed to attempt setting this up was another hosting account on a separate server.  I have hosting accounts with around 10 different companies from working with various clients over the years, like <a href="http://www.powweb.com/join/index.bml?AffID=582654">Powweb</a> and I don't use them because they suck in terms of the unix environment.  Many of these web hosts are actually very fast bandwidth-wise..</p>

<h2><a id="#round-robin-concept" name="#round-robin-concept"></a>Round Robin Concept</h2>
<p><a class="IFL" href="#"><img src="http://uploads.askapache.com/2009/04/round-robin-dns.png" alt="Round Robin DNS" title="Round Robin DNS" width="396" height="335" class="size-full wp-image-2622" /></a><strong>A few months ago</strong> I was given a free hosting account on <a href="http://secure.hostgator.com/cgi-bin/affiliates/clickthru.cgi?id=AskApache-rrdns">HostGator</a> to evaluate and tempt me away from DreamHost to become a Gator.  I get a lot of these types of offers from time to time from the smaller Web companies who read AskApache.. but when I noticed the SSH access was jailed and saw how restrictive the shell was I felt like I was on a windows box..  I want a shell, cpanel sucks.  I compile and run everything from the shell so thats was a deal-breaker and I sorta forgot all about it.<br /><br /><strong>The goal is to add the HostGator server</strong> to be an <a href="http://www.askapache.com/security/mirror-using-rsync-ssh.html">exact mirror</a> of the static.askapache.com domain, then to add that server as a 2nd A record to my DNS zone.  That way half the visitors to the size will be taking up resources and bandwidth on the <a href="http://secure.hostgator.com/cgi-bin/affiliates/clickthru.cgi?id=AskApache-rrdns">HostGator</a> server instead of mine.<br /><br /><strong>Round Robin A records</strong> in DNS are intended to evenly distribute queries between each host of the same name.  Using some tricks straight out of a <a href="http://www.askapache.com/security/computer-security-toolbox-2.html">hackers toolbox</a> we can <a href="#dns-robin-works">verify if the distribution</a> is taking place.  (<a href="#dns-robin-works">It is.</a>)  <br class="C" /></p>


<h2><a id="#dns-robin-dns" name="#dns-robin-dns"></a>DNS - Domain Name System</h2>
<p>The Domain Name System is often analogized as a "phone book" for the Internet because it translates human-friendly computer hostnames into IP addresses. For example, <code>www.askapache.com</code> translates to <code>208.113.134.190</code>.  Every request for a human-friendly hostname first needs to be translated to the IP before the server can be queried.  Normally each hostname corresponds to exactly 1 IP address.  But in a Round Robin setup, the idea is to have the hostname correspond to multiple IP addresses, which are different servers that house the exact same content, resulting in some hosts requesting files from one server, and another host requesting files from the other server, resulting in less CPU resources and bandwidth.</p>
<p>Here is an the zone for <code>static.askapache.com</code> Round Robin records:</p>
<table summary="Round Robin DNS Records" id="ver-zebra"><colgroup><col class="e" /><col class="o" /><col class="e" /><col class="o" /><col class="e" /></colgroup><thead><tr><th scope="col" class="e">QUERY</th><th scope="col" class="o">TTL</th><th scope="col" class="e">CLASS</th><th scope="col" class="o">TYPE</th><th scope="col" class="e">ANSWER</th></tr></thead><tbody><tr><td>static.askapache.com</td><td>13084</td><td>IN</td><td>A</td><td>64.111.114.111</td></tr><tr><td>static.askapache.com</td><td>13084</td><td>IN</td><td>A</td><td>69.56.174.114</td></tr></tbody></table>


<h2><a id="#dns-robin-round" name="#dns-robin-round"></a>Round Robin DNS</h2>
<p>Round robin DNS is a technique of load distribution, load balancing, or fault-tolerance provisioning multiple, redundant Internet Protocol service hosts, e.g., Web servers, FTP servers, by managing the Domain Name System's (DNS) responses to address requests from client computers according to an appropriate statistical model.</p>
<p>In its simplest implementation Round-robin DNS works by responding to DNS requests not only with a single IP address, but a list of IP addresses of several servers that host identical services. The order in which IP addresses from the list are returned is the basis for the term round robin. With each DNS response, the IP address sequence in the list is permuted. Usually, basic IP clients attempt connections with the first address returned from a DNS query so that on different connection attempts clients would receive service from different providers, thus distributing the overall load among servers.</p>
<p>Round robin DNS is often used for balancing the load of geographically-distributed Web servers. For example, a company has one domain name and three identical web sites residing on three servers with three different IP addresses. When one user accesses the home page it will be sent to the first IP address. The second user who accesses the home page will be sent to the next IP address, and the third user will be sent to the third IP address. In each case, once the IP address is given out, it goes to the end of the list. The fourth user, therefore, will be sent to the first IP address, and so forth.</p>

<p>Although easy to implement, round robin DNS has problematic drawbacks, such as those arising from record caching in the DNS hierarchy itself, as well as client-side address caching and reuse, the combination of which can be difficult to manage. Round robin DNS should not solely be relied upon for service availability. If a service at one of the addresses in the list fails, the DNS will continue to hand out that address and clients will still attempt to reach the inoperable service.</p>



<h2><a id="#dns-robin-works" name="#dns-robin-works" title="Efficacy of DNS Load Balancing"></a>Does Round Robin Work</h2>
<p>Definately.  I can look at the access logs for both servers and see that they are splitting the requests nicely.   It is definately not an exact split however, look at these statistics and you'll see what I mean.</p>
<pre>$ dig @ns1.dreamhost.com +authority +all static.askapache.com
&nbsp;
;; ANSWER SECTION:
static.askapache.com.        14400   IN      A       69.56.174.114
static.askapache.com.        14400   IN      A       64.111.114.111
&nbsp;
$ dig @ns1.dreamhost.com +authority +all static.askapache.com
&nbsp;
;; ANSWER SECTION:
static.askapache.com.        14400   IN      A       64.111.114.111
static.askapache.com.        14400   IN      A       69.56.174.114</pre>

<p>The effects of caching will distort the effectiveness of any IP address allocation algorithm unless a 0 TTL is used which has the effect of significantly increasing the load on the DNS (and is not always implemented consistently). In this case the cure may be worse than the disease Good news we have good load balancing on our web servers. Bad news we need 17 more DNS servers!. Intuitively, and without running any experiments to verify, we would suggest that given a normal TTL (12 hours or more) and ANY IP allocation algorithm other than a single static list, loads should be reasonably balanced .</p>
<p><br /><strong>Full root server query</strong></p>
<pre>Tracing to static.askapache.com[a] via A.ROOT-SERVERS.NET, maximum of 3 retries
A.ROOT-SERVERS.NET [.] (198.41.0.4)
 |\___ L.GTLD-SERVERS.NET [com] (192.41.162.30)
 |     |\___ ns3.dreamhost.com [askapache.com] (66.33.216.216) Got authoritative answer
 |     |\___ ns2.dreamhost.com [askapache.com] (208.96.10.221)
 |      \___ ns1.dreamhost.com [askapache.com] (66.33.206.206) Got authoritative answer
 |\___ D.GTLD-SERVERS.NET [com] (192.31.80.30)
 |     |\___ ns3.dreamhost.com [askapache.com] (66.33.216.216) Got authoritative answer
 |     |\___ ns2.dreamhost.com [askapache.com] (208.96.10.221)
 |      \___ ns1.dreamhost.com [askapache.com] (66.33.206.206) Got authoritative answer
 |\___ J.GTLD-SERVERS.NET [com] (192.48.79.30)
 |     |\___ ns3.dreamhost.com [askapache.com] (66.33.216.216) Got authoritative answer
 |     |\___ ns2.dreamhost.com [askapache.com] (208.96.10.221)
 |      \___ ns1.dreamhost.com [askapache.com] (66.33.206.206) Got authoritative answer
 |\___ H.GTLD-SERVERS.NET [com] (192.54.112.30)
 |     |\___ ns3.dreamhost.com [askapache.com] (66.33.216.216) Got authoritative answer
 |     |\___ ns2.dreamhost.com [askapache.com] (208.96.10.221)
 |      \___ ns1.dreamhost.com [askapache.com] (66.33.206.206) Got authoritative answer
 |\___ E.GTLD-SERVERS.NET [com] (192.12.94.30)
 |     |\___ ns3.dreamhost.com [askapache.com] (66.33.216.216) Got authoritative answer
 |     |\___ ns2.dreamhost.com [askapache.com] (208.96.10.221)
 |      \___ ns1.dreamhost.com [askapache.com] (66.33.206.206) Got authoritative answer
 |\___ F.GTLD-SERVERS.NET [com] (192.35.51.30)
 |     |\___ ns3.dreamhost.com [askapache.com] (66.33.216.216) Got authoritative answer
 |     |\___ ns2.dreamhost.com [askapache.com] (208.96.10.221)
 |      \___ ns1.dreamhost.com [askapache.com] (66.33.206.206) Got authoritative answer
 |\___ I.GTLD-SERVERS.NET [com] (192.43.172.30)
 |     |\___ ns3.dreamhost.com [askapache.com] (66.33.216.216) Got authoritative answer
 |     |\___ ns2.dreamhost.com [askapache.com] (208.96.10.221)
 |      \___ ns1.dreamhost.com [askapache.com] (66.33.206.206) Got authoritative answer
 |\___ G.GTLD-SERVERS.NET [com] (192.42.93.30)
 |     |\___ ns3.dreamhost.com [askapache.com] (66.33.216.216) Got authoritative answer
 |     |\___ ns2.dreamhost.com [askapache.com] (208.96.10.221)
 |      \___ ns1.dreamhost.com [askapache.com] (66.33.206.206) Got authoritative answer
 |\___ B.GTLD-SERVERS.NET [com] (2001:0503:231d:0000:0000:0000:0002:0030) Not queried
 |\___ B.GTLD-SERVERS.NET [com] (192.33.14.30)
 |     |\___ ns3.dreamhost.com [askapache.com] (66.33.216.216) Got authoritative answer
 |     |\___ ns2.dreamhost.com [askapache.com] (208.96.10.221)
 |      \___ ns1.dreamhost.com [askapache.com] (66.33.206.206) Got authoritative answer
 |\___ A.GTLD-SERVERS.NET [com] (2001:0503:a83e:0000:0000:0000:0002:0030) Not queried
 |\___ A.GTLD-SERVERS.NET [com] (192.5.6.30)
 |     |\___ ns3.dreamhost.com [askapache.com] (66.33.216.216) Got authoritative answer
 |     |\___ ns2.dreamhost.com [askapache.com] (208.96.10.221)
 |      \___ ns1.dreamhost.com [askapache.com] (66.33.206.206) Got authoritative answer
 |\___ C.GTLD-SERVERS.NET [com] (192.26.92.30)
 |     |\___ ns3.dreamhost.com [askapache.com] (66.33.216.216) Got authoritative answer
 |     |\___ ns2.dreamhost.com [askapache.com] (208.96.10.221)
 |      \___ ns1.dreamhost.com [askapache.com] (66.33.206.206) Got authoritative answer
 |\___ M.GTLD-SERVERS.NET [com] (192.55.83.30)
 |     |\___ ns3.dreamhost.com [askapache.com] (66.33.216.216) Got authoritative answer
 |     |\___ ns2.dreamhost.com [askapache.com] (208.96.10.221)
 |      \___ ns1.dreamhost.com [askapache.com] (66.33.206.206) Got authoritative answer
  \___ K.GTLD-SERVERS.NET [com] (192.52.178.30)
       |\___ ns3.dreamhost.com [askapache.com] (66.33.216.216) Got authoritative answer
       |\___ ns2.dreamhost.com [askapache.com] (208.96.10.221)
        \___ ns1.dreamhost.com [askapache.com] (66.33.206.206) Got authoritative answer
&nbsp;
  ns1.dreamhost.com (66.33.206.206)       static.askapache.com -&gt; 64.111.114.111
  ns1.dreamhost.com (66.33.206.206)       static.askapache.com -&gt; 69.56.174.114
  ns3.dreamhost.com (66.33.216.216)       static.askapache.com -&gt; 64.111.114.111
  ns3.dreamhost.com (66.33.216.216)       static.askapache.com -&gt; 69.56.174.114
  ns1.dreamhost.com (66.33.206.206)       static.askapache.com -&gt; 64.111.114.111
  ns1.dreamhost.com (66.33.206.206)       static.askapache.com -&gt; 69.56.174.114
  ns3.dreamhost.com (66.33.216.216)       static.askapache.com -&gt; 64.111.114.111
  ns3.dreamhost.com (66.33.216.216)       static.askapache.com -&gt; 69.56.174.114
  ns1.dreamhost.com (66.33.206.206)       static.askapache.com -&gt; 64.111.114.111
  ns1.dreamhost.com (66.33.206.206)       static.askapache.com -&gt; 69.56.174.114
  ns3.dreamhost.com (66.33.216.216)       static.askapache.com -&gt; 64.111.114.111
  ns3.dreamhost.com (66.33.216.216)       static.askapache.com -&gt; 69.56.174.114
  ns1.dreamhost.com (66.33.206.206)       static.askapache.com -&gt; 64.111.114.111
  ns1.dreamhost.com (66.33.206.206)       static.askapache.com -&gt; 69.56.174.114
  ns3.dreamhost.com (66.33.216.216)       static.askapache.com -&gt; 64.111.114.111
  ns3.dreamhost.com (66.33.216.216)       static.askapache.com -&gt; 69.56.174.114
  ns1.dreamhost.com (66.33.206.206)       static.askapache.com -&gt; 64.111.114.111
  ns1.dreamhost.com (66.33.206.206)       static.askapache.com -&gt; 69.56.174.114
  ns3.dreamhost.com (66.33.216.216)       static.askapache.com -&gt; 64.111.114.111
  ns3.dreamhost.com (66.33.216.216)       static.askapache.com -&gt; 69.56.174.114
  ns1.dreamhost.com (66.33.206.206)       static.askapache.com -&gt; 64.111.114.111
  ns1.dreamhost.com (66.33.206.206)       static.askapache.com -&gt; 69.56.174.114
  ns3.dreamhost.com (66.33.216.216)       static.askapache.com -&gt; 69.56.174.114
  ns3.dreamhost.com (66.33.216.216)       static.askapache.com -&gt; 64.111.114.111
  ns1.dreamhost.com (66.33.206.206)       static.askapache.com -&gt; 64.111.114.111
  ns1.dreamhost.com (66.33.206.206)       static.askapache.com -&gt; 69.56.174.114
  ns3.dreamhost.com (66.33.216.216)       static.askapache.com -&gt; 64.111.114.111
  ns3.dreamhost.com (66.33.216.216)       static.askapache.com -&gt; 69.56.174.114
  ns1.dreamhost.com (66.33.206.206)       static.askapache.com -&gt; 64.111.114.111
  ns1.dreamhost.com (66.33.206.206)       static.askapache.com -&gt; 69.56.174.114
  ns3.dreamhost.com (66.33.216.216)       static.askapache.com -&gt; 69.56.174.114
  ns3.dreamhost.com (66.33.216.216)       static.askapache.com -&gt; 64.111.114.111
  ns1.dreamhost.com (66.33.206.206)       static.askapache.com -&gt; 69.56.174.114
  ns1.dreamhost.com (66.33.206.206)       static.askapache.com -&gt; 64.111.114.111
  ns3.dreamhost.com (66.33.216.216)       static.askapache.com -&gt; 64.111.114.111
  ns3.dreamhost.com (66.33.216.216)       static.askapache.com -&gt; 69.56.174.114
  ns1.dreamhost.com (66.33.206.206)       static.askapache.com -&gt; 64.111.114.111
  ns1.dreamhost.com (66.33.206.206)       static.askapache.com -&gt; 69.56.174.114
  ns3.dreamhost.com (66.33.216.216)       static.askapache.com -&gt; 69.56.174.114
  ns3.dreamhost.com (66.33.216.216)       static.askapache.com -&gt; 64.111.114.111
  ns1.dreamhost.com (66.33.206.206)       static.askapache.com -&gt; 69.56.174.114
  ns1.dreamhost.com (66.33.206.206)       static.askapache.com -&gt; 64.111.114.111
  ns3.dreamhost.com (66.33.216.216)       static.askapache.com -&gt; 64.111.114.111
  ns3.dreamhost.com (66.33.216.216)       static.askapache.com -&gt; 69.56.174.114
  ns1.dreamhost.com (66.33.206.206)       static.askapache.com -&gt; 64.111.114.111
  ns1.dreamhost.com (66.33.206.206)       static.askapache.com -&gt; 69.56.174.114
  ns3.dreamhost.com (66.33.216.216)       static.askapache.com -&gt; 69.56.174.114
  ns3.dreamhost.com (66.33.216.216)       static.askapache.com -&gt; 64.111.114.111
  ns1.dreamhost.com (66.33.206.206)       static.askapache.com -&gt; 64.111.114.111
  ns1.dreamhost.com (66.33.206.206)       static.askapache.com -&gt; 69.56.174.114
  ns3.dreamhost.com (66.33.216.216)       static.askapache.com -&gt; 64.111.114.111
  ns3.dreamhost.com (66.33.216.216)       static.askapache.com -&gt; 69.56.174.114</pre>




<h2><a id="#dns-online-tools" name="#dns-online-tools"></a>Live Online DNS Tools</h2>
<ul>
<li><a href="http://member.dnsstuff.com/amember/go.php?r=323972&i=l0">DNSstuff.com - Your Destination for DNS and Networking Tools</a></li>
<li><a href="http://www.zonecheck.fr/cgi-bin/zc.cgi?zone=askapache.com&amp;ns0=ns1.dreamhost.com&amp;ips0=&amp;ns1=ns2.dreamhost.com&amp;ips1=&amp;ns2=ns3.dreamhost.com&amp;ips2=&amp;ns3=&amp;ips3=&amp;ns4=&amp;ips4=&amp;ns5=&amp;ips5=&amp;ns6=&amp;ips6=&amp;ns7=&amp;ips7=&amp;intro=t&amp;explain=t&amp;details=t&amp;progress=counter&amp;report=byseverity&amp;format=html&amp;lang=en&amp;errorlvl=allwarning&amp;profile=automatic&amp;chkmail=t&amp;chkzone=t&amp;chkrir=t&amp;transp3=ipv4&amp;transp3=ipv6&amp;transp4=std">ZoneCheck</a></li>
<li><a href="http://pingability.com/zoneinfo.jsp?domain=askapache.com">Quick Check - Pingability.com</a></li>
<li><a href="http://www.squish.net/dnscheck/dnscheck.cgi?host=askapache.com&amp;type=ANY&amp;show_rootservers=on&amp;removebroken=on&amp;cnameprocessing=on&amp;show_mainworkings=on&amp;show_resolving=on&amp;show_allservers=on&amp;getbindversions=on&amp;retries=5&amp;querylevel=15">Squishywishywoo: complete dns traversal checking</a></li>
<li><a href="http://www.zonecut.net/dns/?domain=askapache.com&amp;find_subs=on">ZoneCut DNS</a></li>
<li><a href="http://atrey.karlin.mff.cuni.cz/~mj/sleuth/?domain=askapache.com&amp;verbose=ON&amp;server=ns1.dreamhost.com&amp;serverip=&amp;action=Submit&amp;.cgifields=verbose">DNS Sleuth</a></li>
<li><a href="http://www.pweb.cz/en/dns-test/dom.php">DNS test - Domain name DNS test - pweb.cz</a></li>
<li><a href="http://www.opendns.com/support/cache/?d=static.askapache.com">OpenDNS - Support - CacheCheck</a></li>
<li><a href="http://www.dnscolos.com/dnsreport.php">DNSReport</a></li>
<li><a href="http://freedns.afraid.org/domain/dnstrace.php?domain=askapache.com&amp;submit=Trace">DNSTrace</a></li>
<li><a href="http://www.intodns.com/askapache.com">intoDNS</a></li>
<li><a href="http://www.dnsthru.com/">DNSthru.com</a></li>
<li><a href="http://demo.dnsdoctor.org/cgi-bin/diagnose.cgi?zone=askapache.com&amp;ns0=ns1.dreamhost.com&amp;ips0=&amp;ns1=ns2.dreamhost.com&amp;ips1=&amp;ns2=ns3.dreamhost.com&amp;ips2=&amp;ns3=&amp;ips3=&amp;ns4=&amp;ips4=67.19.1.10&amp;ns5=&amp;ips5=67.19.0.10&amp;ns6=&amp;ips6=67.18.150.114&amp;ns7=&amp;ips7=&amp;intro=t&amp;format=html&amp;lang=en&amp;testname=t&amp;explain=t&amp;details=t&amp;progress=testdesc&amp;errorlvl=allwarning&amp;dontstop=nostop&amp;profile=automatic&amp;report=byseverity&amp;chkmail=t&amp;transp3=ipv4&amp;transp3=ipv6&amp;transp4=std">DNS Doctor</a></li>
<li><a href="http://www.checkdns.net/powercheck.aspx">Power Check</a></li>
</ul>












<h2><a id="#dns-links" name="#dns-links"></a>More Reading</h2>
<ul>
<li><a href="http://www.zytrax.com/books/dns/ch9/rr.html">HOWTO - Configure Load Balancing</a></li>
<li><a href="http://ntrg.cs.tcd.ie/undergrad/4ba2.01/group8/DNS.html">Load Sharing with DNS</a></li>
</ul>




<h3><a id="#dns-rfc-list" name="#dns-rfc-list"></a>RFC's related to DNS</h3>
<ul>
  <li><a href="http://rfc.askapache.com/rfc920/rfc920.html" title="protocol,signature,resource,dnssec,records,response,record,dnskey,algorithm,standards,domain,server,resolver,security">RFC 920</a>:  Specified original TLDs: .arpa, .com, .edu, .org, .gov, .mil and two-character country codes</li>
  <li><a href="http://rfc.askapache.com/rfc1032/rfc1032.html">RFC 1032</a>:  Domain administrators guide</li>
  <li><a href="http://rfc.askapache.com/rfc1033/rfc1033.html">RFC 1033</a>:  Domain administrators operations guide</li>
  <li><a href="http://rfc.askapache.com/rfc1034/rfc1034.html">RFC 1034</a>:  Domain Names - Concepts and Facilities.</li>
  <li><a href="http://rfc.askapache.com/rfc1035/rfc1035.html">RFC 1035</a>:  Domain Names - Implementation and Specification</li>
  <li><a href="http://rfc.askapache.com/rfc1101/rfc1101.html">RFC 1101</a>:  DNS Encodings of Network Names and Other Types</li>
  <li><a href="http://rfc.askapache.com/rfc1123/rfc1123.html">RFC 1123</a>:  Requirements for Internet Hosts -- Application and Support</li>
  <li><a href="http://rfc.askapache.com/rfc1912/rfc1912.html">RFC 1912</a>:  Common DNS Operational and Configuration Errors</li>
  <li><a href="http://rfc.askapache.com/rfc1995/rfc1995.html">RFC 1995</a>:  Incremental Zone Transfer in DNS</li>
  <li><a href="http://rfc.askapache.com/rfc1996/rfc1996.html">RFC 1996</a>:  A Mechanism for Prompt Notification of Zone Changes (DNS NOTIFY)</li>
  <li><a href="http://rfc.askapache.com/rfc2136/rfc2136.html">RFC 2136</a>:  Dynamic Updates in the domain name system (DNS UPDATE)</li>
  <li><a href="http://rfc.askapache.com/rfc2181/rfc2181.html">RFC 2181</a>:  Clarifications to the DNS Specification</li>
  <li><a href="http://rfc.askapache.com/rfc2182/rfc2182.html">RFC 2182</a>:  Selection and Operation of Secondary DNS Servers</li>
  <li><a href="http://rfc.askapache.com/rfc2308/rfc2308.html">RFC 2308</a>:  Negative Caching of DNS Queries (DNS NCACHE)</li>
  <li><a href="http://rfc.askapache.com/rfc2317/rfc2317.html">RFC 2317</a>:  Classless IN-ADDR.ARPA delegation</li>
  <li><a href="http://rfc.askapache.com/rfc2671/rfc2671.html">RFC 2671</a>:  Extension Mechanisms for DNS (EDNS0)</li>
  <li><a href="http://rfc.askapache.com/rfc3597/rfc3597.html">RFC 3597</a>:  Handling of Unknown DNS Resource Record (RR) Types</li>
  <li><a href="http://rfc.askapache.com/rfc3696/rfc3696.html">RFC 3696</a>:  Application Techniques for Checking and Transformation of Names</li>
  <li><a href="http://rfc.askapache.com/rfc4343/rfc4343.html">RFC 4343</a>:  Domain Name System (DNS) Case Insensitivity Clarification</li>
  <li><a href="http://rfc.askapache.com/rfc4592/rfc4592.html">RFC 4592</a>:  The Role of Wildcards in the Domain Name System</li>
  <li><a href="http://rfc.askapache.com/rfc4892/rfc4892.html">RFC 4892</a>:  Requirements for a Mechanism Identifying a Name Server Instance</li>
  <li><a href="http://rfc.askapache.com/rfc5001/rfc5001.html">RFC 5001</a>:  DNS Name Server Identifier Option (NSID)</li>
  <li>RFC 5395:  Domain Name System (DNS) IANA Considerations</li>
</ul>



<p class="wikicop">This page contains content by <a rel="nofollow" href="http://en.wikipedia.org/w/index.php?title=Round_robin_DNS&amp;action=history">Author</a> of <a href="http://en.wikipedia.org/wiki/Round_robin_DNS" rel="nofollow">Article</a> from <a href="http://en.wikipedia.org/wiki/Main_Page" rel="nofollow">Wikipedia</a> and is licensed under the <a href="http://www.askapache.com/gnu-fdl.txt" rel="nofollow">GNU FDL</a>.</p>

<p><br /><strong>Table of Contents</strong></p>
<ul>
<li><a href="#round-robin-concept">Round Robin Concept</a></li>
<li><a href="#dns-robin-dns">DNS - Domain Name System</a></li>
<li><a href="#dns-robin-round">Round Robin DNS</a></li>
<li><a href="#dns-robin-works">Efficacy of DNS Load Balancing</a></li>
<li><a href="#dns-online-tools">Live Online DNS Tools</a></li>
<li><a href="#dns-links">More Reading</a></li>
<li><a href="#dns-rfc-list">RFC's related to DNS</a></li>
</ul><p><a href="http://www.askapache.com/linux/dns-round-robin-rsync-over-ssh.html"></a><a href="http://www.askapache.com/linux/dns-round-robin-rsync-over-ssh.html">DNS Round Robin Configuration using Rsync over SSH</a> originally appeared on <cite>AskApache.com</cite> </p>]]></content:encoded>
			<wfw:commentRss>http://www.askapache.com/linux/dns-round-robin-rsync-over-ssh.html/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Mirroring an Entire Site using Rsync over SSH</title>
		<link>http://www.askapache.com/security/mirror-rsync-ssh.html</link>
		<comments>http://www.askapache.com/security/mirror-rsync-ssh.html#comments</comments>
		<pubDate>Fri, 10 Apr 2009 11:40:44 +0000</pubDate>
		<dc:creator>AskApache</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[rsync]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://www.askapache.com/?p=2581</guid>
		<description><![CDATA[<p><a href="http://www.askapache.com/security/mirror-using-rsync-ssh.html" class="IFL" id="id19"></a><strong>Sometimes there is an urgent need</strong> for creating an exact duplicate or "mirror" of a web site on a separate server.  This could be needed for creating Round Robin Setups, Load-Balancing, Failovers, or for just plain vanilla backups.  In the past I have used a lot of different methods to copy data from one server to another, including creating an archive of the whole directory and then using scp to send the file over, creating an archive and then encrypting it and then sending that file over using ftp, <a href="http://curl.askapache.com/">curl</a>, etc., and my <strong>persistence at learning new ways to do things has paid off</strong> because now I use rsync to keep an exact replica of the entire directory on an external server, without having to use all the CPU and resources of other mirroring methods.<br class="C" /></p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.askapache.com/security/mirror-rsync-ssh.html"></a><a href="http://www.askapache.com/security/mirror-rsync-ssh.html"><cite>AskApache.com</cite></a></p><p><a href="http://www.askapache.com/security/mirror-using-rsync-ssh.html" class="IFL" id="id19"></a><strong>Sometimes there is an urgent need</strong> for creating an exact duplicate or "mirror" of a web site on a separate server.  This could be needed for creating Round Robin Setups, Load-Balancing, Failovers, or for just plain vanilla backups.  In the past I have used a lot of different methods to copy data from one server to another, including creating an archive of the whole directory and then using scp to send the file over, creating an archive and then encrypting it and then sending that file over using ftp, <a href="http://curl.askapache.com/">curl</a>, etc., and my <strong>persistence at learning new ways to do things has paid off</strong> because now I use rsync to keep an exact replica of the entire directory on an external server, without having to use all the CPU and resources of other mirroring methods.<br class="C" /></p>

<p>For this article I will show how I setup a web mirror of <var>static.askapache.com</var> from my DreamHost server to my HostGator Server.  For the transfer and synchronization of the directories we will be using rsync over SSH.  We will also be automating this task using a cronjob with no user-interaction, so creating public and private keys for the ssh will be neccessary.  Finally, I provide a simple shell script that prevents anyone from logging into your account with the created keys for any purpose other than to rsync.</p>







<h2>Rsync Synchronization Magic</h2>
<div><a class="IFL" href="http://rsync.samba.org/"><img src="http://uploads.askapache.com/2009/04/200px-newrsynclogo.jpg" alt="Mirroring an Entire Site using Rsync over SSH" title="rsync" width="200" height="125" /></a>
    <dl>
      <dt><strong>rsync</strong></dt>
      <dd><a href="http://rsync.samba.org/">rsync</a> is an <a href="http://www.opensource.org/">open source</a> file transfer program for Unix systems that uses the "rsync algorithm" which provides a very fast method for synchronizing files and directories from one location to another while minimizing data transfer using delta encoding when appropriate. An important feature of rsync not found in most similar programs/protocols is that the mirroring takes place with only one transmission in each direction.. It does this by sending just the differences in the files across the link, without requiring that both sets of files are present at one of the ends of the link beforehand. </dd>
    </dl>
<br class="C" /></div>




<h2>Securing Rsync with SSH</h2>
<p>I NEVER transfer any unencrypted data around unless that data is transported encrypted and to a trusted recipient, (<em>I use HTTPS for WordPress administration</em>) and I haven't had time to probe the HostGator system for security issues yet, so right away I decided I needed an automated way to securely transfer static.askapache.com files TO hostgator, while not allowing my hostgator account access back on my main server.  So if the hostgator account were to get hacked somehow, the cracker/spammer wouldn't have access back to my main server.</p>


<h2>Generate Keys with No Password</h2>
<p>First I created a private key, specifically a passwordless host key, meaning to gain access with ssh you only need to supply the key, not a password+key like normal.</p>
<pre>
[local@dreamhost] $ mkdir -p ~/.ssh &amp;&amp; chmod 700 ~/.ssh
&nbsp;
# Create the public and private keys
# public key at: z.askapache-hostgator.id_rsa.pub
# private key at: z.askapache-hostgator.id_rsa
[local@dreamhost] $ ssh-keygen -t rsa -b 2048 -f ~/.ssh/z.askapache-hostgator.id_rsa
&nbsp;
# add the public key to remote hosts ~/.ssh/authorized_keys file
[local@dreamhost] $ ssh-copy-id -i ~/.ssh/z.askapache-hostgator.id_rsa.pub remoteuser@remotehost
&nbsp;
# or use scp + ssh to add the public key
[local@dreamhost] $ scp ~/.ssh/z.askapache-hostgator.id_rsa.pub remoteuser@remotehost:/home/remoteuser/
[local@dreamhost] $ ssh remoteuser@remotehost
[gatoraskapache@gator] $ mkdir -p ~/.ssh &amp;&amp; chmod 700 ~/.ssh
[gatoraskapache@gator] $ cat ~/z.askapache-hostgator.id_rsa.pub &gt;&gt; ~/.ssh/authorized_keys
[gatoraskapache@gator] $ chmod 600 ~/.ssh/authorized_keys
</pre>


<h2>Custom SSH Connection Info</h2>
<p>This helps alot, by adding this to the very top of my ~/.ssh/config file I don't have to add all this stuff to the rsync command-line.  Basically when I reference connecting to the host 'gator' it uses all these options.  Very helpful and you can add as many entries as you want.</p>
<pre>
Host gator
   IdentityFile ~/.ssh/z.askapache-hostgator.id_rsa
   Port 2222
   Protocol 2
   User gatoraskapache
   HostName gator555.hostgator.com
   PasswordAuthentication no
</pre>



<h2>Creating Cronjob for Synchronization</h2>
<p>This cronjob runs every 30 minutes, copying all modified files from my local directory <code>~/static.askapache.com/</code> to the remote directory <code>~/public_html/z/</code>.  First I backup the current crontab, then I edit the crontab and add this.</p>
<p><kbd>crontab -l > .crontab-`date +%F.backup`; crontab -e</kbd></p>
<pre>
*/30 * * * * /usr/bin/rsync -e &#039;ssh&#039; -rt --delete ~/static.askapache.com/ gator:&#039;~/public_html/z/&#039; 1&gt;/dev/null
@midnight /usr/bin/find ~/static.askapache.com/ -type d ! -perm 755 -exec chmod 755 {} \; 1&gt;/dev/null
@midnight /usr/bin/find ~/static.askapache.com/ -type f ! -perm 644 -exec chmod 644 {} \; 1&gt;/dev/null
</pre>
<p>Those 2 find commands scheduled to run at midnight simply fix and permissions on files and directories in my static folder.  They are all static files so there is no reason they need to have any other permission.</p>




<h2>Only Allow rsync</h2>
<p>This is SWEET!  If you like candy that is..  It's called each time anything logs into your machine using the password less key we created above, and it simple checks what command the login process is attempting to issue.  To set this up you need to edit the ~/.ssh/authorized_keys file on the remote host and prefix your public key that you added with a command directive to execute a script:</p>
<pre>
command="/home/remoteuser/validate-rsync.sh" ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAwBhj6UCS7JbJ08C8pWJqCh2iXZMN7tXpYZh47f4gZZBwrNHZQ== localuser@dreamhost
</pre>

<h3>validate-rsync.sh</h3>
<p>For rsync requests it will always be <code>rsync --server</code> at the start of the command, so if the command is anything else then this script:</p>
<ol>
<li>Sends you an email notifying you somethings up..</li>
<li>Moves the <code>~/.ssh</code> folder to <code>~/.locked-ssh</code></li>
<li>Adds cronjob to move the folder back in about an hour.</li>
</ol>

<pre>
#!/bin/bash
# Author: http://www.askapache.com
# Version: 1.2
# Date: 04-08-2009
&nbsp;
# If the command used to login to ssh correctly starts with &#039;rsync --server&#039;
# then exit this script and dont process the rest of the script
case "$SSH_ORIGINAL_COMMAND" in &#039;rsync --server&#039;*) exit 0; ;; esac;
&nbsp;
# the home directory where the .ssh folder is located
H=/home/remoteuser
&nbsp;
# if there is a locked ssh folder, kill the rsync and die
[[ -d $H/.lssh ]] &amp;&amp; echo "REJECTED" &amp;&amp; exit 1
&nbsp;
EMAIL=webmaster@askapache.com # notified about locked status
OC=$H/old-crontab.txt # the original crontab
NC=$H/new-crontab.txt #the new crontab
&nbsp;
# When to unlock the rsync
UNLOCK_AT=$(( date +%M\ %k --date=&#039;30 minute 1 hour&#039; ))
&nbsp;
# move the .ssh to .lssh which locks all key-logins
mv $H/.ssh $H/.lssh
&nbsp;
# mail a notice to the boss
echo $SSH_CONNECTION | mail -s &#039;RSYNC LOCKED!!!&#039; "$EMAIL"
&nbsp;
# subshell backs-up crontab then deletes active cron
(
&nbsp;
 crontab -l &gt; $OC &amp;&gt;/dev/null || echo -n #backup current crontab
 crontab -r &gt;/dev/null 2&gt;&amp;1 || echo -n # delete current crontab
)
&nbsp;
# subshell creates new crontab combined with old crontab
(
 # create new crontab
 echo -en "MAILTO=&#039;${EMAIL}&#039;\n${UNLOCK_AT} * * * mv $H/.lssh $H/.ssh" &gt;&gt; $NC
 echo -n " &amp;&amp; date|mail -s &#039;UNLOCKED!!!&#039; &#039;${EMAIL}&#039; &amp;&amp; crontab $OC || rm $OC &amp;&amp; rm $OC" &gt;&gt; $NC
&nbsp;
 # add old crontab to new crontab minus any MAILTO lines
 cat $OC | sed &#039;/^MAILTO/d&#039; &gt;&gt; $NC
&nbsp;
 # load the new crontab and if it doesnt work notify boss
 crontab $NC || echo "manually mv .lssh to .ssh" mail -s &#039;CRONTAB PROBLEM!!!&#039; "$EMAIL"
&nbsp;
 # remove new crontab
 rm $NC
)
&nbsp;
exit $?
</pre>

<p><strong>Here is the cronjob entry</strong> it creates... This will enable the rsync again by moving the folder back, then it mails you to alert you that its back up, and finally the original crontab is restored.</p>
<pre>
MAILTO="askapache@gmail.com"
03 9 * * * mv ~/.locked-ssh ~/.ssh &amp;&amp; date|mail -s &#039;RUNLOCKED!!!&#039; "webmaster@askapache.com" &amp;&amp; crontab ~/old-crontab.txt
</pre>


<h2>Rsync/SSH Debugging and Stats</h2>
<p>Adding the option -v to the ssh command, ie <kbd>rsync -e 'ssh -vv'</kbd> will give you a lot of debugging info.</p>
<p>By adding --stats to your rsync command you can get a detailed look at its efficacy.</p>
<pre>
Number of files: 14900
Number of files transferred: 0
Total file size: 1456832331 bytes
Total transferred file size: 0 bytes
Literal data: 0 bytes
Matched data: 0 bytes
File list size: 320551
File list generation time: 17.393 seconds
File list transfer time: 0.000 seconds
Total bytes sent: 320571
Total bytes received: 20
&nbsp;
sent 320571 bytes  received 20 bytes  17329.24 bytes/sec
total size is 1456832331  speedup is 4544.21
</pre>








<h2>Rsync Algorithm</h2>
<p>The rsync utility uses an algorithm (invented by the Australian computer programmer Andrew Tridgell) for efficiently transmitting a structure (such as a file) across a communications link when the receiving computer already has a different version of the same structure.</p>
<p>The recipient splits its copy of the file into fixed-size non-overlapping chunks, of size S, and computes two checksums for each chunk: the MD4 hash, and a weaker 'rolling checksum'. It sends these checksums to the sender. Version 30 of the protocol (released with rsync version 3.0.0) now uses MD5 hashes rather than MD4.</p>
<p>The sender computes the rolling checksum for every chunk of size S in its own version of the file, even overlapping chunks. This can be calculated efficiently because of a special property of the rolling checksum: if the rolling checksum of bytes n through n + S − 1 is R, the rolling checksum of bytes n + 1 through n + S can be computed from R, byte n, and byte n + S without having to examine the intervening bytes. Thus, if one had already calculated the rolling checksum of bytes 1–25, one could calculate the rolling checksum of bytes 2–26 solely from the previous checksum, and from bytes 1 and 26.</p>
<p>The rolling checksum used in rsync is based on Mark Adler's adler-32 checksum, which is used in zlib, and which itself is based on Fletcher's checksum.  The sender then compares its rolling checksums with the set sent by the recipient to determine if any matches exist. If they do, it verifies the match by computing the MD4 checksum for the matching block and by comparing it with the MD4 checksum sent by the recipient.</p>
<p>The sender then sends the recipient those parts of its file that did not match any of the recipient's blocks, along with assembly instructions on how to merge these blocks into the recipient's version. In practice, this creates a file identical to the sender's copy. However, it is in principle possible that the recipient's copy differs at this point from the sender's: this can happen when the two files have different chunks that nonetheless possess the same MD4 hash and rolling checksum; the chances for this to happen are in practice extremely remote.</p>
<p>If the sender's and recipient's versions of the file have many sections in common, the utility needs to transfer relatively little data to synchronize the files.</p>
<p>While the rsync algorithm forms the heart of the rsync application that essentially optimizes transfers between two computers over TCP/IP, the rsync application supports other key features that aid significantly in data transfers or backup. They include compression and decompression of data block by block using zlib at sending and receiving ends, respectively, and support for protocols such as ssh that enables encrypted transmission of compressed and efficient differential data using rsync algorithm. Instead of ssh, stunnel can also be used to create an encrypted tunnel to secure the data transmitted.</p>
<p>Finally, rsync is capable of limiting the bandwidth consumed during a transfer, a useful feature that few other standard file transfer protocol offer.</p>

<p class="wikicop">This page contains content by <a rel="nofollow" href="http://en.wikipedia.org/w/index.php?title=Rsync&amp;action=history">Author</a> of <a href="http://en.wikipedia.org/wiki/Rsync" rel="nofollow">Article</a> from <a href="http://en.wikipedia.org/wiki/Main_Page" rel="nofollow">Wikipedia</a> and is licensed under the <a href="http://www.askapache.com/gnu-fdl.txt" rel="nofollow">GNU FDL</a>.</p><p><a href="http://www.askapache.com/security/mirror-rsync-ssh.html"></a><a href="http://www.askapache.com/security/mirror-rsync-ssh.html">Mirroring an Entire Site using Rsync over SSH</a> originally appeared on <cite>AskApache.com</cite> </p>]]></content:encoded>
			<wfw:commentRss>http://www.askapache.com/security/mirror-rsync-ssh.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

