<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>The Gahooa Perspective &#187; System Administration</title>
	<atom:link href="http://blog.gahooa.com/category/system-administration/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.gahooa.com</link>
	<description>Thoughts on Life, Engineering, Technology, Business, and more...</description>
	<lastBuildDate>Sun, 11 Dec 2011 19:44:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='blog.gahooa.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>The Gahooa Perspective &#187; System Administration</title>
		<link>http://blog.gahooa.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://blog.gahooa.com/osd.xml" title="The Gahooa Perspective" />
	<atom:link rel='hub' href='http://blog.gahooa.com/?pushpress=hub'/>
		<item>
		<title>Essentials of DNS: understand the basics well</title>
		<link>http://blog.gahooa.com/2010/12/15/essentials-of-dns-understand-the-basics-well/</link>
		<comments>http://blog.gahooa.com/2010/12/15/essentials-of-dns-understand-the-basics-well/#comments</comments>
		<pubDate>Thu, 16 Dec 2010 00:01:48 +0000</pubDate>
		<dc:creator>Jason Garber</dc:creator>
				<category><![CDATA[Interesting]]></category>
		<category><![CDATA[Perspective]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[Technique]]></category>
		<category><![CDATA[Distibuted Systems]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">https://gahooa.wordpress.com/2010/12/15/essentials-of-dns-understand-the-basics-well/</guid>
		<description><![CDATA[DNS&#160;stands for &#8220;Domain Name Service&#8221;. &#160;It is the mechanism in which the internet is able to map a name (eg www.sgasoftware.com) to an IP address (eg 12.34.56.78). This writeup is not designed to be 100% technically accurate. &#160;Rather, it is designed to give a layman understanding of relevant parts of the DNS system. Much more [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.gahooa.com&amp;blog=6218261&amp;post=455&amp;subd=gahooa&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><b>DNS</b>&nbsp;stands for &#8220;Domain Name Service&#8221;. &nbsp;It is the mechanism in which the internet is able to map a name (eg www.sgasoftware.com) to an IP address (eg 12.34.56.78).</p>
<div>
</div>
<div>This writeup is not designed to be 100% technically accurate. &nbsp;Rather, it is designed to give a layman understanding of relevant parts of the DNS system.</div>
<div>
</div>
<div>Much more comprehensive information can be found here:&nbsp;<a href="http://en.wikipedia.org/wiki/Domain_Name_System">http://en.wikipedia.org/wiki/Domain_Name_System</a></div>
<div>
<div>
<h2>A bit on IP Addresses and Routing</h2>
<div>Packets of data to move to and fro across the internet based entirely on IP Address. &nbsp;At every &#8220;network meeting point&#8221; on the internet, there is a router which examines all&nbsp;traffic&nbsp;to find out where it is headed, and then sends it to the next step. &nbsp;This process is repeated at each &#8220;network meeting point&#8221; until the traffic arrives at the destination.</div>
<div>
</div>
<div>There is a popular utility called &#8220;Trace Route&#8221;, which will demonstrate all of the routers that a packet of data must go through to get from where you are to where it is headed. &nbsp;In the following example, I ran a traceroute to <b>www.google.com</b>.</div>
<div>
</div>
<div>Notice the first step was a DNS lookup, converting <code>www.google.com</code> to <code>72.14.204.99</code>.&nbsp;</div>
<div>
</div>
<div>
<div><code>c:\&gt;tracert www.google.com</code></div>
<div>
</div>
<div><code>Tracing route to www.l.google.com [72.14.204.99]</code></div>
<div><code>over a maximum of 30 hops:</code></div>
<div>
</div>
<div><code>&nbsp;&nbsp;1 &nbsp; &nbsp;&lt;1 ms &nbsp; &nbsp;&lt;1 ms &nbsp; &nbsp;&lt;1 ms &nbsp;192.168.0.1 &nbsp; <span style="background-color:rgb(255,255,0);">(our office router/gateway))</span></code></div>
<div><code>&nbsp;&nbsp;2 &nbsp; &nbsp; 1 ms &nbsp; &nbsp;&lt;1 ms &nbsp; &nbsp;&lt;1 ms &nbsp;10.1.10.1 &nbsp; &nbsp; <span style="background-color:rgb(255,255,0);">(our cable modem (another router/gateway)</span></code></div>
<div><code>&nbsp;&nbsp;3 &nbsp; &nbsp;15 ms &nbsp; &nbsp;13 ms &nbsp; &nbsp;12 ms &nbsp;96.179.208.1</code></div>
<div><code>&nbsp;&nbsp;4 &nbsp; &nbsp; 9 ms &nbsp; &nbsp; 9 ms &nbsp; &nbsp;10 ms &nbsp;ge-2-20-ur01.blairsville.pa.pitt.comcast.net [68.86.146.165]</code></div>
<div><code>&nbsp;&nbsp;5 &nbsp; &nbsp;14 ms &nbsp; &nbsp;10 ms &nbsp; &nbsp; 9 ms &nbsp;te-9-1-ur01.indiana.pa.pitt.comcast.net [68.86.100.178]</code></div>
<div><code>&nbsp;&nbsp;6 &nbsp; &nbsp;10 ms &nbsp; &nbsp;55 ms &nbsp; &nbsp;30 ms &nbsp;te-9-3-ur01.punxy.pa.pitt.comcast.net [68.87.173.81]</code></div>
<div><code>&nbsp;&nbsp;7 &nbsp; &nbsp;12 ms &nbsp; &nbsp;18 ms &nbsp; &nbsp;19 ms &nbsp;te-9-1-ur01.ruralvalley.pa.pitt.comcast.net [68.86.100.122]</code></div>
<div><code>&nbsp;&nbsp;8 &nbsp; &nbsp;21 ms &nbsp; &nbsp;63 ms &nbsp; &nbsp;53 ms &nbsp;te-6-3-ar01.pittsburgh.pa.pitt.comcast.net [68.87.173.73]</code></div>
<div><code>&nbsp;&nbsp;9 &nbsp; &nbsp;28 ms &nbsp; &nbsp;29 ms &nbsp; &nbsp;27 ms &nbsp;te-3-1-0-0-cr01.chicago.il.ibone.comcast.net [68.86.90.181]</code></div>
<div><code>&nbsp;10 &nbsp; &nbsp;25 ms &nbsp; &nbsp;28 ms &nbsp; &nbsp;25 ms &nbsp;pos-1-6-0-0-pe01.350ecermak.il.ibone.comcast.net [68.86.87.130]</code></div>
<div><code>&nbsp;11 &nbsp; &nbsp;43 ms &nbsp; &nbsp;44 ms &nbsp; &nbsp;44 ms &nbsp;as15169-1.350ecermak.il.ibone.comcast.net [75.149.230.198]</code></div>
<div><code>&nbsp;12 &nbsp; &nbsp;48 ms &nbsp; &nbsp;52 ms &nbsp; &nbsp;58 ms &nbsp;209.85.254.130</code></div>
<div><code>&nbsp;13 &nbsp; &nbsp;37 ms &nbsp; &nbsp;39 ms &nbsp; &nbsp;39 ms &nbsp;209.85.248.222</code></div>
<div><code>&nbsp;14 &nbsp; &nbsp;36 ms &nbsp; &nbsp;43 ms &nbsp; &nbsp;41 ms &nbsp;66.249.94.46</code></div>
<div><code>&nbsp;15 &nbsp; &nbsp;42 ms &nbsp; &nbsp;39 ms &nbsp; &nbsp;39 ms &nbsp;iad04s01-in-f99.<span style="background-color:rgb(255,255,0);">1e100</span>.net [72.14.204.99]</code></div>
<div>
</div>
<div><code>Trace complete.</code></div>
</div>
<div>
</div>
<div>In true geek fashion, after 15 hops, our packet reached 1e100.net. &nbsp;Google was derived from the word Googol, which is a number with 1 and 100 zeros. &nbsp;Henceforth, 1e100.net stands for something to that effect.</div>
<h4>Why does this matter?</h4>
<div>It is important to understand that computers are binary, and therefore require input to be ultimately converted to binary. &nbsp;An IPv4 address is simply 32 bits, but rather than presenting it as&nbsp;<span style="color:rgb(0,0,0);font-family:arial, sans-serif;line-height:15px;font-size:small;"><code>11000000.10101000.00000000.00000001</code>, humans find it more convenient to look at it like <code>192.168.0.1</code>. &nbsp;However, that is still a far cry from a human readable name like <code>mail.domain.com</code>.</span></div>
<div>
</div>
<div>This is where DNS comes into play. &nbsp;DNS is a system which allows people to use names, while still providing for computers to use the numbers. &nbsp;Of the many&nbsp;benefits&nbsp;of DNS, it allows you to move a domain to another IP address while keeping the domain name the same.&nbsp;</div>
<div>
</div>
<div>
<h2 style="font-family:Trebuchet MS, arial, sans-serif;font-size:1.5em;">Common Types of DNS Records</h2>
</div>
<div>DNS records come in several types:</div>
<div>
</div>
<div><b>A record</b></div>
<div>Points to a specific IP address. &nbsp;&#8221;A&#8221; stands for &#8220;Address&#8221;.</div>
<div><span style="color:rgb(0,96,0);font-family:monospace;"><br />
</span></div>
<div><span style="color:rgb(0,96,0);font-family:monospace;"><span style="color:rgb(50,50,41);font-family:Lucida Grande, Lucida Sans Unicode, sans-serif;">This means that&nbsp;appcove.com should resolve to&nbsp;74.205.111.168</span></span></div>
<div><span style="color:rgb(0,96,0);font-family:monospace;">appcove.com. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;70755 &nbsp; IN &nbsp; &nbsp; &nbsp;A &nbsp; &nbsp; &nbsp; 74.205.111.168</span></div>
<div>
</div>
<div><b>CNAME record</b></div>
<div>Points to another record. &nbsp;&#8221;CNAME&#8221; stands for &#8220;Canonical Name Record&#8221;</div>
<div>
</div>
<div>
<div>This means that www.appcove.com should resolve to&nbsp;appcove.com and in turn resolve to&nbsp;74.205.111.168</div>
<div><code>www.appcove.com. &nbsp; &nbsp; &nbsp; &nbsp;86400 &nbsp; IN &nbsp; &nbsp; &nbsp;CNAME &nbsp; appcove.com.</code></div>
</div>
<div>
</div>
<div><b>MX record</b></div>
<div>Specifies a domain which will handle incoming email for the domain.</div>
<div>
<div>
</div>
<div>
<div>
<div>This means that mail sent to @appcove.com will be handled by&nbsp;APPCOVE.COM.S9A1.PSMTP.com, and if that does not work, send it to&nbsp;APPCOVE.COM.S9A2.PSMTP.com and so on. &nbsp;The weight indicates which server should be tried first &#8212; the lower the weight, the better.</div>
</div>
<div><code>appcove.com. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;86400 &nbsp; IN &nbsp; &nbsp; &nbsp;MX &nbsp; &nbsp; &nbsp;40 APPCOVE.COM.S9B2.PSMTP.com.</code></div>
<div><code>appcove.com. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;86400 &nbsp; IN &nbsp; &nbsp; &nbsp;MX &nbsp; &nbsp; &nbsp;10 APPCOVE.COM.S9A1.PSMTP.com.</code></div>
<div><code>appcove.com. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;86400 &nbsp; IN &nbsp; &nbsp; &nbsp;MX &nbsp; &nbsp; &nbsp;20 APPCOVE.COM.S9A2.PSMTP.com.</code></div>
<div><code>appcove.com. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;86400 &nbsp; IN &nbsp; &nbsp; &nbsp;MX &nbsp; &nbsp; &nbsp;30 APPCOVE.COM.S9B1.PSMTP.com.</code></div>
</div>
</div>
<div>
</div>
<div>
</div>
<div><b>NS record</b></div>
<div>Delegates a&nbsp;<a href="http://en.wikipedia.org/wiki/DNS_zone" title="DNS zone">DNS zone</a>&nbsp;to use the given&nbsp;<a href="http://en.wikipedia.org/wiki/Authoritative_name_server" title="Authoritative name server">authoritative name servers</a>. &nbsp;&#8221;NS&#8221; stands for &#8220;Name Server&#8221;.</div>
<div>
</div>
<div>
<div>
<div>This means that DNS for&nbsp;appcove.com is to be handled by either ns.rackspace.com or ns2.rackspace.com.</div>
<div><code>appcove.com. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;57957 &nbsp; IN &nbsp; &nbsp; &nbsp;NS &nbsp; &nbsp; &nbsp;ns.rackspace.com.</code></div>
<div><code>appcove.com. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;57957 &nbsp; IN &nbsp; &nbsp; &nbsp;NS &nbsp; &nbsp; &nbsp;ns2.rackspace.com.</code></div>
</div>
</div>
<div>
</div>
<div><b>TXT record</b></div>
<div>Specifies arbitrary text associated with a name. &nbsp;&#8221;TXT&#8221; stands for &#8220;Text&#8221;</div>
<div>
</div>
<div>
<div>The provides a mechanism for the DNS system to be extended with different bits of text about a domain name. &nbsp;The following TXT record stores SPF information, used to specify what servers are allowed to send mail on behalf of appcove.com.</div>
<div><code>appcove.com. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;86400 &nbsp; IN &nbsp; &nbsp; &nbsp;TXT &nbsp; &nbsp; "v=spf1 include:fogcreek.com include:aspmx.googlemail.com ip4:207.126.144.0/20 ip4:64.18.0.0/20 ip4:74.125.148.0/22 &nbsp;~all"</code></div>
</div>
<div>
</div>
<h2 style="font-family:Trebuchet MS, arial, sans-serif;font-size:1.5em;">DNS Propagation</h2>
<div>DNS is a distributed system. &nbsp;This means that there are thousands of DNS servers scattered around the globe. &nbsp;Most internet providers will have their own DNS servers. &nbsp;Most hosting providers will have their own DNS servers. &nbsp;Etc&#8230;</div>
<div>
</div>
<div>How do they all stay in sync? &nbsp;They do and they don&#8217;t!</div>
<div>
</div>
<div>Every DNS entry has a&nbsp;corresponding&nbsp;TTL value associated with it. &nbsp;TTL means &#8220;time to live&#8221;. &nbsp;This value, expressed in seconds, states how long a given DNS entry is valid before it must be refreshed from the &#8220;authoritative&#8221; DNS server for the given domain. &nbsp;Typically, the TTL is set to 86,400 seconds, or 1 day.</div>
<div>
With a TTL of 1 day, any changes to authoritative DNS records may take up to a full day (or more) to propagate around the internet. &nbsp;This is worth keeping in mind before you engage in any&nbsp;important&nbsp;DNS changes.</div>
<div>
</div>
<div>The proper way to change DNS is to first, at least 48 hours prior to the transition period, change the TTL to a very low value (like 5 minutes). &nbsp;It will still take at least a day for this to fully propagate to all relevant DNS servers. &nbsp; However, once they are all aware that the TTL is 5 minutes, they will frequently check your authoritative server for updates every 5 minutes or each time a new request comes in for one of your DNS records, whichever is longer.</div>
<div>
</div>
<div>In other words, DNS servers only look up what they are asked to look up. &nbsp;Then they retain it for the TTL period, and finally discard it (only to repeat if needed).</div>
<div>
</div>
<div><span style="font-family:Trebuchet MS, arial, sans-serif;font-size:20px;font-weight:bold;">Authoritative DNS</span></div>
<div>
</div>
<div>Every domain must be registered with a registrar. &nbsp;Part of this registration information for <u>every domain</u>, is the DNS servers to use as &#8220;authoritative dns information&#8221; for that domain. &nbsp; These NS records are transmitted to the root nameserver system.&nbsp;</div>
<div>
</div>
<div>Every top level domain (com, net, edu, org, us, gb, br, uk, au, etc&#8230;) all have their own authoritative DNS servers. &nbsp;This information is kept in the world&#8217;s root name servers, which are currently:</div>
<div>
</div>
<div><code>a.root-servers.net. &nbsp; &nbsp; 117655 &nbsp;IN &nbsp; &nbsp; &nbsp;A &nbsp; &nbsp; &nbsp; 198.41.0.4</code></div>
</div>
<div>
<div><code>a.root-servers.net. &nbsp; &nbsp; 196594 &nbsp;IN &nbsp; &nbsp; &nbsp;AAAA &nbsp; &nbsp;2001:503:ba3e::2:30</code></div>
<div><code>b.root-servers.net. &nbsp; &nbsp; 113829 &nbsp;IN &nbsp; &nbsp; &nbsp;A &nbsp; &nbsp; &nbsp; 192.228.79.201</code></div>
<div><code>c.root-servers.net. &nbsp; &nbsp; 120655 &nbsp;IN &nbsp; &nbsp; &nbsp;A &nbsp; &nbsp; &nbsp; 192.33.4.12</code></div>
<div><code>d.root-servers.net. &nbsp; &nbsp; 113757 &nbsp;IN &nbsp; &nbsp; &nbsp;A &nbsp; &nbsp; &nbsp; 128.8.10.90</code></div>
<div><code>e.root-servers.net. &nbsp; &nbsp; 115554 &nbsp;IN &nbsp; &nbsp; &nbsp;A &nbsp; &nbsp; &nbsp; 192.203.230.10</code></div>
<div><code>f.root-servers.net. &nbsp; &nbsp; 121256 &nbsp;IN &nbsp; &nbsp; &nbsp;A &nbsp; &nbsp; &nbsp; 192.5.5.241</code></div>
<div><code>f.root-servers.net. &nbsp; &nbsp; 280321 &nbsp;IN &nbsp; &nbsp; &nbsp;AAAA &nbsp; &nbsp;2001:500:2f::f</code></div>
<div><code>g.root-servers.net. &nbsp; &nbsp; 113755 &nbsp;IN &nbsp; &nbsp; &nbsp;A &nbsp; &nbsp; &nbsp; 192.112.36.4</code></div>
<div><code>h.root-servers.net. &nbsp; &nbsp; 116456 &nbsp;IN &nbsp; &nbsp; &nbsp;A &nbsp; &nbsp; &nbsp; 128.63.2.53</code></div>
<div><code>h.root-servers.net. &nbsp; &nbsp; 206320 &nbsp;IN &nbsp; &nbsp; &nbsp;AAAA &nbsp; &nbsp;2001:500:1::803f:235</code></div>
<div><code>i.root-servers.net. &nbsp; &nbsp; 115856 &nbsp;IN &nbsp; &nbsp; &nbsp;A &nbsp; &nbsp; &nbsp; 192.36.148.17</code></div>
<div><code>i.root-servers.net. &nbsp; &nbsp; 337685 &nbsp;IN &nbsp; &nbsp; &nbsp;AAAA &nbsp; &nbsp;2001:7fe::53</code></div>
<div><code>j.root-servers.net. &nbsp; &nbsp; 119155 &nbsp;IN &nbsp; &nbsp; &nbsp;A &nbsp; &nbsp; &nbsp; 192.58.128.30</code></div>
<div>
</div>
<div>If you lookup the NS record for <b>com</b>&nbsp;at one of the above root servers, you will be told this:</div>
<div>
</div>
<div>
<div><code>d.gtld-servers.net. &nbsp; &nbsp; 16131 &nbsp; IN &nbsp; &nbsp; &nbsp;A &nbsp; &nbsp; &nbsp; 192.31.80.30</code></div>
<div><code>g.gtld-servers.net. &nbsp; &nbsp; 74653 &nbsp; IN &nbsp; &nbsp; &nbsp;A &nbsp; &nbsp; &nbsp; 192.42.93.30</code></div>
<div><code>f.gtld-servers.net. &nbsp; &nbsp; 111162 &nbsp;IN &nbsp; &nbsp; &nbsp;A &nbsp; &nbsp; &nbsp; 192.35.51.30</code></div>
<div><code>c.gtld-servers.net. &nbsp; &nbsp; 33590 &nbsp; IN &nbsp; &nbsp; &nbsp;A &nbsp; &nbsp; &nbsp; 192.26.92.30</code></div>
<div><code>j.gtld-servers.net. &nbsp; &nbsp; 171076 &nbsp;IN &nbsp; &nbsp; &nbsp;A &nbsp; &nbsp; &nbsp; 192.48.79.30</code></div>
<div><code>a.gtld-servers.net. &nbsp; &nbsp; 2665 &nbsp; &nbsp;IN &nbsp; &nbsp; &nbsp;A &nbsp; &nbsp; &nbsp; 192.5.6.30</code></div>
<div><code>a.gtld-servers.net. &nbsp; &nbsp; 8352 &nbsp; &nbsp;IN &nbsp; &nbsp; &nbsp;AAAA &nbsp; &nbsp;2001:503:a83e::2:30</code></div>
<div><code>i.gtld-servers.net. &nbsp; &nbsp; 78083 &nbsp; IN &nbsp; &nbsp; &nbsp;A &nbsp; &nbsp; &nbsp; 192.43.172.30</code></div>
<div><code>k.gtld-servers.net. &nbsp; &nbsp; 14957 &nbsp; IN &nbsp; &nbsp; &nbsp;A &nbsp; &nbsp; &nbsp; 192.52.178.30</code></div>
<div><code>b.gtld-servers.net. &nbsp; &nbsp; 127812 &nbsp;IN &nbsp; &nbsp; &nbsp;A &nbsp; &nbsp; &nbsp; 192.33.14.30</code></div>
<div><code>b.gtld-servers.net. &nbsp; &nbsp; 168301 &nbsp;IN &nbsp; &nbsp; &nbsp;AAAA &nbsp; &nbsp;2001:503:231d::2:30</code></div>
<div><code>e.gtld-servers.net. &nbsp; &nbsp; 29652 &nbsp; IN &nbsp; &nbsp; &nbsp;A &nbsp; &nbsp; &nbsp; 192.12.94.30</code></div>
<div><code>h.gtld-servers.net. &nbsp; &nbsp; 47519 &nbsp; IN &nbsp; &nbsp; &nbsp;A &nbsp; &nbsp; &nbsp; 192.54.112.30</code></div>
<div><code>l.gtld-servers.net. &nbsp; &nbsp; 41990 &nbsp; IN &nbsp; &nbsp; &nbsp;A &nbsp; &nbsp; &nbsp; 192.41.162.30</code></div>
<div><code>m.gtld-servers.net. &nbsp; &nbsp; 42456 &nbsp; IN &nbsp; &nbsp; &nbsp;A &nbsp; &nbsp; &nbsp; 192.55.83.30</code></div>
</div>
<div>
</div>
<div>If you lookup the NS record for <b>appcove.com</b>&nbsp;at one of the above &#8220;com&#8221; servers, you will be told this:</div>
<div>
</div>
</div>
<div>
<div><code>appcove.com. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;172800 &nbsp;IN &nbsp; &nbsp; &nbsp;NS &nbsp; &nbsp; &nbsp;ns2.rackspace.com.</code></div>
<div><code>appcove.com. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;172800 &nbsp;IN &nbsp; &nbsp; &nbsp;NS &nbsp; &nbsp; &nbsp;ns.rackspace.com.</code></div>
<div>
</div>
</div>
<div>Finally, we have the authoritative DNS servers for <b>appcove.com</b>. &nbsp;Now, if you lookup the record for <b>www.appcove.com</b>&nbsp;at ns.rackspace.com, you will be told this:
</div>
<div>
</div>
<div>
<div><code>www.appcove.com. &nbsp; &nbsp; &nbsp; &nbsp;86400 &nbsp; IN &nbsp; &nbsp; &nbsp;CNAME &nbsp; appcove.com.</code></div>
</div>
<div>
</div>
<div>Finally, if you lookup <b>appcove.com</b>&nbsp;at it&#8217;s authoritative server ns.rackspace.com, you will be told this:</div>
<div>
</div>
<div>
<div><code>appcove.com. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;86400 &nbsp; IN &nbsp; &nbsp; &nbsp;A &nbsp; &nbsp; &nbsp; 74.205.111.168</code></div>
<div>
</div>
</div>
<div>
</div>
<div>
</div>
</div>
<br /> Tagged: <a href='http://blog.gahooa.com/tag/distibuted-systems/'>Distibuted Systems</a>, <a href='http://blog.gahooa.com/tag/dns/'>DNS</a>, <a href='http://blog.gahooa.com/tag/internet/'>Internet</a>, <a href='http://blog.gahooa.com/tag/network/'>Network</a>, <a href='http://blog.gahooa.com/tag/perspective/'>Perspective</a>, <a href='http://blog.gahooa.com/tag/technology/'>Technology</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gahooa.wordpress.com/455/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gahooa.wordpress.com/455/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gahooa.wordpress.com/455/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gahooa.wordpress.com/455/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/gahooa.wordpress.com/455/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/gahooa.wordpress.com/455/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/gahooa.wordpress.com/455/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/gahooa.wordpress.com/455/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gahooa.wordpress.com/455/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gahooa.wordpress.com/455/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gahooa.wordpress.com/455/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gahooa.wordpress.com/455/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gahooa.wordpress.com/455/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gahooa.wordpress.com/455/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.gahooa.com&amp;blog=6218261&amp;post=455&amp;subd=gahooa&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.gahooa.com/2010/12/15/essentials-of-dns-understand-the-basics-well/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">gahooa</media:title>
		</media:content>
	</item>
		<item>
		<title>How to force-drop a postgresql database by killing off connection processes</title>
		<link>http://blog.gahooa.com/2010/11/03/how-to-force-drop-a-postgresql-database-by-killing-off-connection-processes/</link>
		<comments>http://blog.gahooa.com/2010/11/03/how-to-force-drop-a-postgresql-database-by-killing-off-connection-processes/#comments</comments>
		<pubDate>Wed, 03 Nov 2010 14:50:04 +0000</pubDate>
		<dc:creator>Jason Garber</dc:creator>
				<category><![CDATA[Engineering]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[Technique]]></category>
		<category><![CDATA[Drop Database]]></category>
		<category><![CDATA[Kill Process]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[Process]]></category>

		<guid isPermaLink="false">http://blog.gahooa.com/?p=379</guid>
		<description><![CDATA[Ever need to drop a postgresql database, but it would not let you because there are open connections to it (from a webapp or whatever)? Quite annoying.  If on a production server, and other databases are being used, restarting postgresql is a last resort, because it generates downtime for your site (even if small). I [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.gahooa.com&amp;blog=6218261&amp;post=379&amp;subd=gahooa&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Ever need to drop a postgresql database, but it would not let you because there are open connections to it (from a webapp or whatever)?</p>
<p>Quite annoying.  If on a production server, and other databases are being used, restarting postgresql is a last resort, because it generates downtime for your site (even if small).</p>
<p>I finally took the time to scratch around and find the answer.</p>
<p><strong>As a super user, to list all of the open connections to a given database:</strong></p>
<pre>select * from pg_stat_activity where datname='YourDatabase';</pre>
<p><strong>As a superuser, to drop all of the open connections to a given database:</strong></p>
<pre>select pg_terminate_backend(procpid) from pg_stat_activity where datname='YourDatabase';</pre>
<p>&#8211;</p>
<p>Here are some references to the functions:</p>
<p><a href="http://www.postgresql.org/docs/current/static/functions-admin.html#FUNCTIONS-ADMIN-SIGNAL-TABLE">http://www.postgresql.org/docs/current/static/functions-admin.html#FUNCTIONS-ADMIN-SIGNAL-TABLE</a></p>
<p><a href="http://www.postgresql.org/docs/8.4/static/monitoring-stats.html#MONITORING-STATS-VIEWS-TABLE">http://www.postgresql.org/docs/8.4/static/monitoring-stats.html#MONITORING-STATS-VIEWS-TABLE</a></p>
<p>&nbsp;</p>
<br /> Tagged: <a href='http://blog.gahooa.com/tag/drop-database/'>Drop Database</a>, <a href='http://blog.gahooa.com/tag/kill-process/'>Kill Process</a>, <a href='http://blog.gahooa.com/tag/postgresql/'>PostgreSQL</a>, <a href='http://blog.gahooa.com/tag/process/'>Process</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gahooa.wordpress.com/379/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gahooa.wordpress.com/379/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gahooa.wordpress.com/379/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gahooa.wordpress.com/379/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/gahooa.wordpress.com/379/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/gahooa.wordpress.com/379/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/gahooa.wordpress.com/379/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/gahooa.wordpress.com/379/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gahooa.wordpress.com/379/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gahooa.wordpress.com/379/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gahooa.wordpress.com/379/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gahooa.wordpress.com/379/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gahooa.wordpress.com/379/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gahooa.wordpress.com/379/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.gahooa.com&amp;blog=6218261&amp;post=379&amp;subd=gahooa&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.gahooa.com/2010/11/03/how-to-force-drop-a-postgresql-database-by-killing-off-connection-processes/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">gahooa</media:title>
		</media:content>
	</item>
		<item>
		<title>Ubuntu Post-Install tips&#8230;</title>
		<link>http://blog.gahooa.com/2010/06/14/ubuntu-post-install-tips/</link>
		<comments>http://blog.gahooa.com/2010/06/14/ubuntu-post-install-tips/#comments</comments>
		<pubDate>Mon, 14 Jun 2010 21:10:51 +0000</pubDate>
		<dc:creator>Jason Garber</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[Technique]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Ubuntu Partner Repositories]]></category>
		<category><![CDATA[Ubuntu Setup]]></category>

		<guid isPermaLink="false">http://blog.gahooa.com/?p=231</guid>
		<description><![CDATA[I received this from a friend, and thought I would post it here in case anyone would find it useful. After Installing Ubuntu, basically I do this: Go to: System -&#62; Administration -&#62; Software Sources -&#62; Other Sofware, and enable partner repository. After that, we can this on a Terminal: sudo apt-get update sudo apt-get dist-upgrade sudo [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.gahooa.com&amp;blog=6218261&amp;post=231&amp;subd=gahooa&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>I received this from a friend, and thought I would post it here in case anyone would find it useful.</strong></p>
<blockquote><p>After Installing Ubuntu, basically I do this:</p>
<p>Go to:<br />
System -&gt; Administration -&gt; Software Sources -&gt; Other Sofware, and enable partner repository.</p>
<p>After that, we can this on a Terminal:</p>
<p>sudo apt-get update<br />
sudo apt-get dist-upgrade<br />
sudo apt-get install ubuntu-restricted-extras<br />
sudo /usr/share/doc/libdvdread4/install-css.sh</p></blockquote>
<br /> Tagged: <a href='http://blog.gahooa.com/tag/ubuntu/'>Ubuntu</a>, <a href='http://blog.gahooa.com/tag/ubuntu-partner-repositories/'>Ubuntu Partner Repositories</a>, <a href='http://blog.gahooa.com/tag/ubuntu-setup/'>Ubuntu Setup</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gahooa.wordpress.com/231/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gahooa.wordpress.com/231/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gahooa.wordpress.com/231/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gahooa.wordpress.com/231/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/gahooa.wordpress.com/231/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/gahooa.wordpress.com/231/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/gahooa.wordpress.com/231/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/gahooa.wordpress.com/231/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gahooa.wordpress.com/231/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gahooa.wordpress.com/231/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gahooa.wordpress.com/231/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gahooa.wordpress.com/231/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gahooa.wordpress.com/231/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gahooa.wordpress.com/231/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.gahooa.com&amp;blog=6218261&amp;post=231&amp;subd=gahooa&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.gahooa.com/2010/06/14/ubuntu-post-install-tips/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">gahooa</media:title>
		</media:content>
	</item>
		<item>
		<title>PostgreSQL Dump and Restore Notes</title>
		<link>http://blog.gahooa.com/2010/05/16/postgresql-dump-and-restore-notes/</link>
		<comments>http://blog.gahooa.com/2010/05/16/postgresql-dump-and-restore-notes/#comments</comments>
		<pubDate>Mon, 17 May 2010 03:10:59 +0000</pubDate>
		<dc:creator>Jason Garber</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[Technique]]></category>
		<category><![CDATA[database backup]]></category>
		<category><![CDATA[pg_dump]]></category>
		<category><![CDATA[pg_restore]]></category>
		<category><![CDATA[PostgreSQL]]></category>

		<guid isPermaLink="false">http://blog.gahooa.com/?p=225</guid>
		<description><![CDATA[The pg_dump and pg_restore commands provide excellent flexibility in storing a compressed dump file, and selectively restoring any part of it. I&#8217;ve found that dropping and re-creating the target database is the cleanest way to restore a dumpfile &#8212; no stray relations left to cause trouble. Unless you own all of the objects being restored, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.gahooa.com&amp;blog=6218261&amp;post=225&amp;subd=gahooa&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://www.postgresql.org/docs/8.4/static/app-pgdump.html">pg_dump</a> and <a href="http://www.postgresql.org/docs/8.4/static/app-pgrestore.html">pg_restore</a> commands provide excellent flexibility in storing a compressed dump file, and selectively restoring any part of it.</p>
<p>I&#8217;ve found that dropping and re-creating the target database is the cleanest way to restore a dumpfile &#8212; no stray relations left to cause trouble.</p>
<p>Unless you own all of the objects being restored, you may need to be SUPERUSER in order to have a successful restore.</p>
<p>The custom dump format is quite useful.  Unlike the normal sequence of SQL statements you may be used to from mysqldump (and pg_dump as well), the &#8211;format=custom option will create a compressed archive file (internally a tar file) that can be selectivly read with pg_restore.  That flexibility could come in handy if you *just* need the schema from 1 table, or *just* the data from another table.</p>
<p><strong>Dump:</strong><br />
pg_dump &#8211;format=custom -U jason_super MyDatabase &gt; MyDatabase.pgdump</p>
<p><strong>Restore</strong><br />
pg_restore &#8211;exit-on-error &#8211;clean &#8211;dbname=MyDatabase MyDatabase.pgdump</p>
<p><strong>Get all of the SQL</strong><br />
pg_restore TMTManage_2.pgdump | more</p>
<p><strong>Get some of the SQL</strong><br />
pg_restore &#8211;schema=ACRM &#8211;table=Admin TMTManage_2.pgdump | more</p>
<br /> Tagged: <a href='http://blog.gahooa.com/tag/database-backup/'>database backup</a>, <a href='http://blog.gahooa.com/tag/pg_dump/'>pg_dump</a>, <a href='http://blog.gahooa.com/tag/pg_restore/'>pg_restore</a>, <a href='http://blog.gahooa.com/tag/postgresql/'>PostgreSQL</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gahooa.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gahooa.wordpress.com/225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gahooa.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gahooa.wordpress.com/225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/gahooa.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/gahooa.wordpress.com/225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/gahooa.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/gahooa.wordpress.com/225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gahooa.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gahooa.wordpress.com/225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gahooa.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gahooa.wordpress.com/225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gahooa.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gahooa.wordpress.com/225/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.gahooa.com&amp;blog=6218261&amp;post=225&amp;subd=gahooa&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.gahooa.com/2010/05/16/postgresql-dump-and-restore-notes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">gahooa</media:title>
		</media:content>
	</item>
		<item>
		<title>nginx restart error</title>
		<link>http://blog.gahooa.com/2010/02/24/nginx-restart-error/</link>
		<comments>http://blog.gahooa.com/2010/02/24/nginx-restart-error/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 03:32:10 +0000</pubDate>
		<dc:creator>Jason Garber</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[Technique]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[nginx configuration]]></category>
		<category><![CDATA[nginx error]]></category>

		<guid isPermaLink="false">http://blog.gahooa.com/?p=209</guid>
		<description><![CDATA[Was playing around with nginx on Centos 5 (EPEL package). Most of the time I ran: I would get this message in the /var/log/nginx/error.log file: After some hunting around, it appears to be a known bug in nginx (perhaps perl in nginx?)&#8230; Anyway, a simple workaround is to do this: Or, simply edit /etc/init.d/nginx, and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.gahooa.com&amp;blog=6218261&amp;post=209&amp;subd=gahooa&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Was playing around with nginx on Centos 5 (EPEL package).</p>
<p>Most of the time I ran:</p>
<p><pre class="brush: plain;">service nginx restart</pre></p>
<p>I would get this message in the /var/log/nginx/error.log file:</p>
<p><pre class="brush: plain;">panic: MUTEX_LOCK (22) [op.c:352].</pre></p>
<p>After some hunting around, it appears to be a known bug in nginx (perhaps perl in nginx?)&#8230; Anyway, a simple workaround is to do this:</p>
<p><pre class="brush: plain;">
service nginx stop
service nginx start
</pre></p>
<p>Or, simply edit <strong>/etc/init.d/nginx, and add the sleep 1 line:</strong></p>
<p><pre class="brush: plain;">
51 restart() {
52     configtest || return $?
53     stop
54     sleep 1
55     start
56 }
</pre></p>
<p>Nice workround!</p>
<br /> Tagged: <a href='http://blog.gahooa.com/tag/nginx/'>nginx</a>, <a href='http://blog.gahooa.com/tag/nginx-configuration/'>nginx configuration</a>, <a href='http://blog.gahooa.com/tag/nginx-error/'>nginx error</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gahooa.wordpress.com/209/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gahooa.wordpress.com/209/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gahooa.wordpress.com/209/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gahooa.wordpress.com/209/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/gahooa.wordpress.com/209/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/gahooa.wordpress.com/209/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/gahooa.wordpress.com/209/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/gahooa.wordpress.com/209/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gahooa.wordpress.com/209/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gahooa.wordpress.com/209/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gahooa.wordpress.com/209/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gahooa.wordpress.com/209/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gahooa.wordpress.com/209/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gahooa.wordpress.com/209/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.gahooa.com&amp;blog=6218261&amp;post=209&amp;subd=gahooa&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.gahooa.com/2010/02/24/nginx-restart-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">gahooa</media:title>
		</media:content>
	</item>
		<item>
		<title>Example Automated MySQL Backup Script</title>
		<link>http://blog.gahooa.com/2009/12/26/example-automated-mysql-backup-script/</link>
		<comments>http://blog.gahooa.com/2009/12/26/example-automated-mysql-backup-script/#comments</comments>
		<pubDate>Sat, 26 Dec 2009 18:23:21 +0000</pubDate>
		<dc:creator>Jason Garber</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[Technique]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[Backup Script]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://blog.gahooa.com/?p=190</guid>
		<description><![CDATA[Rather than use --all-databases, which will prevent you from being able to selectively restore any single database, consider the following: Ideally, you should have a daily backup, with some history. It should be bulletproof (--force), it should be logged (&#62;&#62; ...log), it should be compressed (&#124; gzip), it should keep separate copies of each database, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.gahooa.com&amp;blog=6218261&amp;post=190&amp;subd=gahooa&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Rather than use <code>--all-databases</code>, which will prevent you from being able to selectively restore any single database, consider the following:</p>
<p>Ideally, you should have a daily backup, with some history.  It should be bulletproof (<code>--force</code>), it should be logged (<code>&gt;&gt; ...log</code>), it should be compressed (<code>| gzip</code>), it should keep separate copies of each database, and it should automatically pick up any databases that are added.</p>
<p><strong>Consider, rather, a shell script like this:</strong></p>
<pre>
<pre class="brush: bash;">
#!/bin/bash

Host=server.domain.com
BDir=/home/backup/backup/mysql

Dump=&quot;/usr/bin/mysqldump --skip-extended-insert --force&quot;
MySQL=/usr/bin/mysql

Today=$(date &quot;+%a&quot;)

# Get a list of all databases
Databases=$(echo &quot;SHOW DATABASES&quot; | $MySQL -h $Host)

for db in $Databases; do
        date=`date`
        file=&quot;$BDir/$Host-$db-$Today.sql.gz&quot;
        echo &quot;Backing up '$db' from '$Host' on '$date' to: &quot;
        echo &quot;   $file&quot;
        $Dump -h $Host $db | gzip &gt; $file
done
</pre>
</pre>
<p>Which is assuming that you have a file <code>~/.my.cnf</code> (chmod 600), that has:</p>
<pre>
<pre class="brush: plain;">
[client]
user = &quot;BACKUP&quot;
password = &quot;SOMEPASS8342783492&quot;
</pre>
</pre>
<p>Make sure that whatever user you are using for <code>BACKUP</code> has this grant statement:</p>
<pre>
<pre class="brush: sql;">
GRANT
  SELECT, SHOW VIEW ON *.*
  TO BACKUP@localhost
  IDENTIFIED BY 'SOMEPASS8342783492';
</pre>
</pre>
<p>So simply add this to a nightly cronjob, and you have a daily backup that rotates each 7 days week.</p>
<pre>
<pre class="brush: plain;">
0 3 * * *   backup-mysql &gt;&gt; backup-mysql.log 2&gt;&gt; backup-mysql.log
</pre>
</pre>
<hr />
<p>The backup directory then contains:</p>
<pre>-rw-r--r-- 1 backup backup 2217482184 Sep  3 13:35 base.appcove.net-VOS4_0-20090903.sql.gz
-rw-rw-r-- 1 backup backup 2505876287 Dec 25 00:48 base.appcove.net-VOS4_0-Fri.sql.gz
-rw-r--r-- 1 backup backup 2500384029 Dec 21 00:48 base.appcove.net-VOS4_0-Mon.sql.gz
-rw-r--r-- 1 backup backup 2506849331 Dec 26 00:48 base.appcove.net-VOS4_0-Sat.sql.gz
-rw-r--r-- 1 backup backup 2499859469 Dec 20 00:48 base.appcove.net-VOS4_0-Sun.sql.gz
-rw-rw-r-- 1 backup backup 2505046147 Dec 24 00:48 base.appcove.net-VOS4_0-Thu.sql.gz
-rw-rw-r-- 1 backup backup 2502277743 Dec 22 00:48 base.appcove.net-VOS4_0-Tue.sql.gz
-rw-r--r-- 1 backup backup 2504169910 Dec 23 00:48 base.appcove.net-VOS4_0-Wed.sql.gz
-rw-r--r-- 1 backup backup   76983829 Dec 25 00:49 base.appcove.net-VOS4_Mail_0-Fri.sql.gz
-rw-r--r-- 1 backup backup   76983829 Dec 21 00:49 base.appcove.net-VOS4_Mail_0-Mon.sql.gz
-rw-r--r-- 1 backup backup   76983829 Dec 26 00:49 base.appcove.net-VOS4_Mail_0-Sat.sql.gz
-rw-r--r-- 1 backup backup   76983829 Dec 20 00:48 base.appcove.net-VOS4_Mail_0-Sun.sql.gz
-rw-rw-r-- 1 backup backup   76983829 Dec 24 00:49 base.appcove.net-VOS4_Mail_0-Thu.sql.gz
-rw-rw-r-- 1 backup backup   76983829 Dec 22 00:49 base.appcove.net-VOS4_Mail_0-Tue.sql.gz
-rw-r--r-- 1 backup backup   76983829 Dec 23 00:49 base.appcove.net-VOS4_Mail_0-Wed.sql.gz
-rw-r--r-- 1 backup backup  304803726 Dec 25 00:49 base.appcove.net-WeSell_0-Fri.sql.gz
-rw-r--r-- 1 backup backup  303480087 Dec 21 00:49 base.appcove.net-WeSell_0-Mon.sql.gz
-rw-r--r-- 1 backup backup  304710121 Dec 26 00:49 base.appcove.net-WeSell_0-Sat.sql.gz
-rw-r--r-- 1 backup backup  303791294 Dec 20 00:49 base.appcove.net-WeSell_0-Sun.sql.gz
-rw-rw-r-- 1 backup backup  305315415 Dec 24 00:49 base.appcove.net-WeSell_0-Thu.sql.gz
-rw-rw-r-- 1 backup backup  302516217 Dec 22 00:49 base.appcove.net-WeSell_0-Tue.sql.gz
-rw-r--r-- 1 backup backup  303314217 Dec 23 00:49 base.appcove.net-WeSell_0-Wed.sql.gz
-rw-r--r-- 1 backup backup     135301 Dec 25 00:30 dc40.appcove.net-mysql-Fri.sql.gz
-rw-r--r-- 1 backup backup     135301 Dec 21 00:30 dc40.appcove.net-mysql-Mon.sql.gz
-rw-r--r-- 1 backup backup     135301 Dec 26 00:30 dc40.appcove.net-mysql-Sat.sql.gz
-rw-r--r-- 1 backup backup     135301 Dec 20 00:30 dc40.appcove.net-mysql-Sun.sql.gz
-rw-rw-r-- 1 backup backup     135301 Dec 24 00:30 dc40.appcove.net-mysql-Thu.sql.gz
-rw-rw-r-- 1 backup backup     135301 Dec 22 00:30 dc40.appcove.net-mysql-Tue.sql.gz
-rw-r--r-- 1 backup backup     135301 Dec 23 00:30 dc40.appcove.net-mysql-Wed.sql.gz
</pre>
<br /> Tagged: backup, Backup Script, MySQL, System Administration <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gahooa.wordpress.com/190/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gahooa.wordpress.com/190/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gahooa.wordpress.com/190/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gahooa.wordpress.com/190/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/gahooa.wordpress.com/190/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/gahooa.wordpress.com/190/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/gahooa.wordpress.com/190/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/gahooa.wordpress.com/190/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gahooa.wordpress.com/190/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gahooa.wordpress.com/190/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gahooa.wordpress.com/190/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gahooa.wordpress.com/190/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gahooa.wordpress.com/190/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gahooa.wordpress.com/190/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.gahooa.com&amp;blog=6218261&amp;post=190&amp;subd=gahooa&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.gahooa.com/2009/12/26/example-automated-mysql-backup-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">gahooa</media:title>
		</media:content>
	</item>
		<item>
		<title>Freeky Bug</title>
		<link>http://blog.gahooa.com/2009/08/22/freeky-bug/</link>
		<comments>http://blog.gahooa.com/2009/08/22/freeky-bug/#comments</comments>
		<pubDate>Sun, 23 Aug 2009 03:38:52 +0000</pubDate>
		<dc:creator>Jason Garber</dc:creator>
				<category><![CDATA[AppCove]]></category>
		<category><![CDATA[Engineering]]></category>
		<category><![CDATA[Interesting]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[Fail Bug]]></category>
		<category><![CDATA[Load Balancing]]></category>

		<guid isPermaLink="false">http://blog.gahooa.com/?p=148</guid>
		<description><![CDATA[Ever have one of those bugs that customers complain about, but you just cannot reproduce it? Here is a good one&#8230; Customers were complaining about being logged out when clicking a download link. This particular setup is a Cisco CSS 11501 series load balancer with 2 Dell Poweredge web servers sitting behind it.  Each webserver [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.gahooa.com&amp;blog=6218261&amp;post=148&amp;subd=gahooa&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Ever have one of those bugs that customers complain about, but you <strong>just cannot reproduce it?</strong> Here is a good one&#8230;</p>
<p>Customers were complaining about being logged out when clicking a download link.</p>
<p>This particular setup is a Cisco CSS 11501 series load balancer with 2 Dell Poweredge web servers sitting behind it.  Each webserver is running apache, as well as an application server (python) which handles authentication and processing for THAT server.</p>
<p>For weeks, I <strong>c</strong><strong>ould not</strong> reproduce this bug.  So tonight when I finally got bit by it (at home), I was clueless for a while.  The code is so simple.  A simple key lookup in a simple dictionary, yet it just was not making sense.</p>
<h2>Here is the story:</h2>
<p><em>A while ago, we were having problems with Internet Explorer downloading content over SSL.  This turns out to be a common problem with IE, so to fix it, I caused the downloads to not use SSL, which is more efficient anyway.</p>
<p>We use a cisco hardware load balancer which balances incoming requests to different backend servers.  It has a feature called STICKY SOURCE IP, which means that any connections routed from the same IP to the same site will be delivered to the same backend server.  This is nice, because you are always visiting the same server.</p>
<p>So as it turns out, by turning the download SSL off, the load balancer was using another &#8220;site&#8221; definition to handle the DOWNLOAD request.  STICKY SOURCE IP was out the window, and the request was being passed back to a &#8220;random&#8221; webserver.</p>
<p>About 50% of the time, users (like me tonight) were tossed to the other server, which knew </em><strong><em>nothing</em></strong><em> about the user login. That is why it was complaining about the &#8220;</em><strong><em>WB4_App::$DSEG and/or WB4_App::$AuthToken must be set in order to contact the     applications server.&#8221;</em></strong><em> error message, which is not one that should normally be shown.</p>
<p>To make matters worse, our IP address at work was apparently always using the same server, so I could not reproduce the problem.  I&#8217;m lucky that it happened to me at home, or I would still be banging my head against the desk&#8230;</em></p>
<br /> Tagged: Fail Bug, Load Balancing <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gahooa.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gahooa.wordpress.com/148/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gahooa.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gahooa.wordpress.com/148/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/gahooa.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/gahooa.wordpress.com/148/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/gahooa.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/gahooa.wordpress.com/148/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gahooa.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gahooa.wordpress.com/148/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gahooa.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gahooa.wordpress.com/148/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gahooa.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gahooa.wordpress.com/148/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.gahooa.com&amp;blog=6218261&amp;post=148&amp;subd=gahooa&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.gahooa.com/2009/08/22/freeky-bug/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">gahooa</media:title>
		</media:content>
	</item>
		<item>
		<title>Interesting Thoughts on Cloud Server Performance</title>
		<link>http://blog.gahooa.com/2009/08/01/interesting-thoughts-on-cloud-server-performance/</link>
		<comments>http://blog.gahooa.com/2009/08/01/interesting-thoughts-on-cloud-server-performance/#comments</comments>
		<pubDate>Sat, 01 Aug 2009 21:47:29 +0000</pubDate>
		<dc:creator>Jason Garber</dc:creator>
				<category><![CDATA[Engineering]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[AB]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Benchmarking]]></category>
		<category><![CDATA[Cloud Server]]></category>
		<category><![CDATA[Performance]]></category>

		<guid isPermaLink="false">http://blog.gahooa.com/?p=145</guid>
		<description><![CDATA[Apache load testing on a Cloud Server &#8211; Jason &#8211; 7/31/2009 I recently created a cloud server for a wordpress blog, and configured it to the point that the blog was working OK.  Then I decided to check the performance aspects of the server, as it was a small 256 MB + 10GB machine. Using [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.gahooa.com&amp;blog=6218261&amp;post=145&amp;subd=gahooa&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong><span style="font-size:medium;">Apache load testing on a Cloud Server</span></strong><span style="font-weight:normal;"><strong><span style="font-size:medium;"><span style="font-size:medium;"> &#8211; Jason &#8211; 7/31/2009</span></span></strong></span></p>
<div></div>
<div>I recently created a cloud server for a wordpress blog, and configured it to the point that the blog was working OK.  Then I decided to check the performance aspects of the server, as it was a small <strong><span style="color:#0000ff;">256 MB + 10GB</span></strong> machine.</div>
<div>Using apachebench (ab), I ran some load tests on the blog home page.  <strong>The server choked to death.</strong> It was swapping so bad, that RackSpace Cloud sent me this email:</div>
<blockquote><p><span style="font-family:arial;"><em>This is an automatic notification to let you know that your Cloud Server, </em><a style="color:#2a5db0;" href="http://city.appcove.com/" target="_blank"><em>city.appcove.com</em></a><em>, is showing a considerable amount of consistent swapping activity. Quite often this is an indicator that your application or database are not as efficient as they could be. It also may indicate that you need to upgrade your Cloud Server for more RAM.</em></span></p></blockquote>
<div>That&#8217;s strange&#8230;</div>
<div>I found that the response rate was:</div>
<p style="padding-left:30px;"><strong>4 requests per second, 10 concurrent connections</strong></p>
<div>When the concurrency was raised to 50, the server died.  It took 10 minutes for it to calm down enough that I could LOG IN and KILL apache.</div>
<div>&#8211;</div>
<div>So upon further investingation, I found that the default httpd.conf configuration was <strong>WAY TOO LARGE</strong>:</div>
<div></div>
<div>We&#8217;re only working with 256 MB ram here, so if each apache process takes up any amount of memory at all, we have a low limit.</div>
<p style="padding-left:30px;"><span style="font-family:'Courier New';">&lt;IfModule prefork.c&gt;</span><br />
<span style="font-family:'Courier New';">StartServers       8</span><br />
<span style="font-family:'Courier New';">MinSpareServers    5</span><br />
<span style="font-family:'Courier New';">MaxSpareServers   20</span><br />
<span style="font-family:'Courier New';color:#0000ff;">ServerLimit      256</span><br />
<span style="font-family:'Courier New';color:#0000ff;">MaxClients       256</span><br />
<span style="font-family:'Courier New';">MaxRequestsPerChild  4000</span><br />
<span style="font-family:'Courier New';">&lt;/IfModule&gt;</span></p>
<div>
<div>Only after drastically reducing the configuration to the following, did we get reasonable performance:</div>
</div>
<p style="padding-left:30px;"><span style="font-family:'Courier New';">&lt;IfModule prefork.c&gt;</span><br />
<span style="font-family:'Courier New';"><span style="color:#0000ff;">StartServers       4</span></span><br />
<span style="font-family:'Courier New';"><span style="color:#0000ff;">MinSpareServers    2</span></span><br />
<span style="font-family:'Courier New';"><span style="color:#0000ff;">MaxSpareServers   4</span></span><br />
<span style="font-family:'Courier New';"><span style="color:#0000ff;">ServerLimit      4</span></span><br />
<span style="font-family:'Courier New';"><span style="color:#0000ff;">MaxClients       4</span></span><br />
<span style="font-family:'Courier New';">MaxRequestsPerChild  4000</span><br />
<span style="font-family:'Courier New';">&lt;/IfModule&gt;</span></p>
<div>
<div></div>
</div>
<div>
<div>As it turns out, the performance went up considerably:</div>
</div>
<p style="padding-left:30px;"><strong>16 requests per second, 50 concurrent connections</strong></p>
<div>
<div>
<div>Still, I thought that it could get better.  So I looked into installing some PHP opcode caching software.</div>
</div>
</div>
<blockquote><p><a id="n41." title="http://www.php.net/manual/en/intro.apc.php" href="http://www.php.net/manual/en/intro.apc.php"><em>http://www.php.net/manual/en/intro.apc.php</em></a></p>
<p><em>The Alternative PHP Cache (APC) is a free and open opcode cache for PHP. Its goal is to provide a free, open, and robust framework for caching and optimizing PHP intermediate code.</em></p></blockquote>
<div>
<div></div>
<div>As it turns out, it was easy to install.</div>
</div>
<p style="padding-left:30px;"><span style="font-family:'Courier New';"># yum install php-pecl-apc</span></p>
<div>
<div>And after restarting apache:</div>
</div>
<p style="padding-left:30px;"><strong>47 requests per second, 50 concurrent connections</strong></p>
<div>
<div>Even during this load test, the site was still responsive from a web browser.</div>
<div></div>
<div>Not bad for a cheap little Cloud Server, eh?</div>
</div>
<br /> Tagged: AB, Apache, Benchmarking, Cloud Server, Performance <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gahooa.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gahooa.wordpress.com/145/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gahooa.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gahooa.wordpress.com/145/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/gahooa.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/gahooa.wordpress.com/145/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/gahooa.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/gahooa.wordpress.com/145/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gahooa.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gahooa.wordpress.com/145/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gahooa.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gahooa.wordpress.com/145/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gahooa.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gahooa.wordpress.com/145/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.gahooa.com&amp;blog=6218261&amp;post=145&amp;subd=gahooa&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.gahooa.com/2009/08/01/interesting-thoughts-on-cloud-server-performance/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">gahooa</media:title>
		</media:content>
	</item>
		<item>
		<title>Updating a cert on the Cisco 11500 Series Content Services Switches (CSS)</title>
		<link>http://blog.gahooa.com/2009/04/06/updating-a-cert-on-the-cisco-11500-series-content-services-switches-css/</link>
		<comments>http://blog.gahooa.com/2009/04/06/updating-a-cert-on-the-cisco-11500-series-content-services-switches-css/#comments</comments>
		<pubDate>Tue, 07 Apr 2009 03:21:52 +0000</pubDate>
		<dc:creator>Jason Garber</dc:creator>
				<category><![CDATA[AppCove]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[Technique]]></category>
		<category><![CDATA[Cisco CSS]]></category>
		<category><![CDATA[SSL Certificates]]></category>

		<guid isPermaLink="false">http://blog.gahooa.com/?p=121</guid>
		<description><![CDATA[Upgrading a SSL certificate using the Cisco 11500 Series Content Services Switch (CSS) <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.gahooa.com&amp;blog=6218261&amp;post=121&amp;subd=gahooa&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Having recently moved some of our hosting infrastructure to the excellent <a href="http://www.rackspace.com/solutions/managed_hosting/colocation/index.php">Rackspace Platform group</a>, we inherited the management of the <a href="http://www.cisco.com/en/US/products/hw/contnetw/ps792/">Cisco 11500 Series Content Services Switches (CSS)</a>, which we use for general load balancing + ssl termination.</p>
<blockquote><p>As a side note, it&#8217;s really powerful, fast, and well, plain nice.  Not having to manage SSL certs on each apache instance is really nice, and all the LAN communication is done over plain old HTTP.</p></blockquote>
<p>This blog post is a regurgitation of some notes I took internally.  Perhaps someone who finds themselves managing this device will benefit&#8230;</p>
<hr />The task at hand was re-issuing and updating one of our primary wildcard certificates that powers a lot of subdomains.</p>
<h3>The first step is to generate the key, csr, and crt&#8230;</h3>
<p>All these files should be:</p>
<ul>
<li>Named the same as the domain that SSL is being generated for.</li>
<li>use WILD for a wildcard subdomain</li>
<li>Use this format &#8220;www.domain.com-0810.key&#8221;, where 08 is the from year and 10 is the to year</li>
<li>(the short version is because of name length limits on the CSS)</li>
</ul>
<p><span style="font-weight:bold;">Start by generating the key and csr</span></p>
<p>This should be done in the ciscoftp role under the ~/load directory</p>
<pre># openssl genrsa -out WILD.vosecure.com-0810.key 1024
# openssl req -new -key WILD.vosecure.com-0810.key -out WILD.vosecure.com-0810.csr</pre>
<p><span style="font-weight:bold;">Then get the certificate issued by (global sign)</span></p>
<p>Put the certificate into the the ~/load directory.  When done, it should look like:</p>
<pre>-rw-rw-r-- 1 ciscoftp ciscoftp  3139 Apr  6 15:59 WILD.vosecure.com-0810.crt
-rw-rw-r-- 1 ciscoftp ciscoftp   773 Apr  6 15:49 WILD.vosecure.com-0810.csr
-rw-rw-r-- 1 ciscoftp ciscoftp   883 Apr  6 15:47 WILD.vosecure.com-0810.key</pre>
<p><span style="font-weight:bold;">Put the crt and key onto the load balancer</span></p>
<p>To do this, use the &#8220;copy command&#8221; on the load balancer</p>
<pre>20132-201292# copy ssl ftp base import WILD.vosecure.com-0810.crt PEM "rack"
20132-201292# copy ssl ftp base import WILD.vosecure.com-0810.key PEM "rack"

Then make the associations...

20132-201292# config
20132-201292(config)# ssl associate cert WILD.vosecure.com-0810.crt WILD.vosecure.com-0810.crt
20132-201292(config)# ssl associate cert WILD.vosecure.com-0810.key WILD.vosecure.com-0810.key</pre>
<h3>Now, it&#8217;s time to install it.  <span style="color:#ff0000;">Requires SSL downtime!</span></h3>
<ol>
<li>Suspend the SSL content rule</li>
<li>Suspend the SSL service</li>
<li>Suspend the SSL proxy list</li>
<li>Run the updates</li>
<li>Activate the SSL proxy list</li>
<li>Activate the SSL service</li>
<li>Activate the SSL content rule</li>
</ol>
<p><span style="font-weight:bold;">Here are the exact commands:</span></p>
<pre>20132-201292# config
20132-201292(config)# owner vosecure.com
20132-201292(config-owner[vosecure.com])# content 74.205.111.161-ssl
20132-201292(config-owner-content[vosecure.com-74.205.111.161-ssl])# suspend

20132-201292# config
20132-201292(config)# service ssl-service
20132-201292(config-service[ssl-service])# suspend

20132-201292# config
20132-201292(config)# ssl-proxy-list ssl-proxy</pre>
<p style="color:#f00;">In the following commands, we remove the whole ssl-server so that it shows up at the bottom in one concise unit.  Otherwise, the startup-config and running-config become fragmented.</p>
<pre>20132-201292(config-ssl-proxy-list[ssl-proxy])# suspend
20132-201292(config-ssl-proxy-list[ssl-proxy])# no ssl-server 6
20132-201292(config-ssl-proxy-list[ssl-proxy])# ssl-server 6
20132-201292(config-ssl-proxy-list[ssl-proxy])# ssl-server 6 rsakey WILD.vosecure.com-0810.key
20132-201292(config-ssl-proxy-list[ssl-proxy])# ssl-server 6 rsacert WILD.vosecure.com-0810.crt
20132-201292(config-ssl-proxy-list[ssl-proxy])# ssl-server 6 vip address 192.168.1.161
20132-201292(config-ssl-proxy-list[ssl-proxy])# ssl-server 6 cipher rsa-with-rc4-128-sha 192.168.1.161 81
20132-201292(config-ssl-proxy-list[ssl-proxy])# active

20132-201292# config
20132-201292(config)# service ssl-service
20132-201292(config-service[ssl-service])# active

20132-201292# config
20132-201292(config)# owner vosecure.com
20132-201292(config-owner[vosecure.com])# content 74.205.111.161-ssl
20132-201292(config-owner-content[vosecure.com-74.205.111.161-ssl])# active

<span style="color:#f00;">Test test test.  Firefox, IE, Chrome...</span>

20132-201292# copy running-config ftp base running-config

<span style="color:#f00;">Review changes with git diff</span>

20132-201292# write memory

20132-201292# copy startup-config ftp base startup-config</pre>
<h3>And&#8230; Here is the git diff</h3>
<pre>diff --git a/load/startup-config b/load/startup-config
index 7042490..36fbbaa 100644
--- a/load/startup-config
+++ b/load/startup-config
@@ -1,4 +1,4 @@
-!Generated on 04/06/2009 16:05:48
+!Generated on 04/06/2009 21:51:02
!Active version: sg0810205

@@ -64,6 +64,8 @@ configure
<span style="color:#339966;">+  ssl associate rsakey WILD.vosecure.com-0810.key WILD.vosecure.com-0810.key
+  ssl associate cert WILD.vosecure.com-0810.crt WILD.vosecure.com-0810.crt

</span>!*********************** SSL PROXY LIST ***********************
ssl-proxy-list ssl-proxy
<span style="color:#ff6600;">-  ssl-server 6
-  ssl-server 6 rsakey vosecure.com(080421-04300)-key
-  ssl-server 6 rsacert vosecure.com(080421-04300)-cert
-  ssl-server 6 vip address 192.168.1.161
-  ssl-server 6 cipher rsa-with-rc4-128-sha 192.168.1.161 81</span>
@@ -146,6 +141,11 @@ ssl-proxy-list ssl-proxy
<span style="color:#339966;">+  ssl-server 6
+  ssl-server 6 rsakey WILD.vosecure.com-0810.key
+  ssl-server 6 rsacert WILD.vosecure.com-0810.crt
+  ssl-server 6 vip address 192.168.1.161
+  ssl-server 6 cipher rsa-with-rc4-128-sha 192.168.1.161 81</span>
active</pre>
<br /> Tagged: Cisco CSS, SSL Certificates, System Administration <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gahooa.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gahooa.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gahooa.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gahooa.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/gahooa.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/gahooa.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/gahooa.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/gahooa.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gahooa.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gahooa.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gahooa.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gahooa.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gahooa.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gahooa.wordpress.com/121/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.gahooa.com&amp;blog=6218261&amp;post=121&amp;subd=gahooa&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.gahooa.com/2009/04/06/updating-a-cert-on-the-cisco-11500-series-content-services-switches-css/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">gahooa</media:title>
		</media:content>
	</item>
		<item>
		<title>I highly recommend yum  + createrepo + rpmbuild</title>
		<link>http://blog.gahooa.com/2009/03/08/i-highly-recommend-yum-createrepo-rpmbuild/</link>
		<comments>http://blog.gahooa.com/2009/03/08/i-highly-recommend-yum-createrepo-rpmbuild/#comments</comments>
		<pubDate>Sun, 08 Mar 2009 05:30:00 +0000</pubDate>
		<dc:creator>Jason Garber</dc:creator>
				<category><![CDATA[AppCove]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[Technique]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[EPEL]]></category>
		<category><![CDATA[RHEL]]></category>
		<category><![CDATA[RPM]]></category>
		<category><![CDATA[YUM]]></category>

		<guid isPermaLink="false">http://blog.gahooa.com/?p=93</guid>
		<description><![CDATA[As I was discussing lightly before, I have recently been involved in building quite a few RPMs for our server clusters at AppCove. Where we have arrived: Our (new) primary production cluster consists of multiple RedHat Enterprise Linux 5 boxes in different capacities (webserver, appserver, database master, database slave, etc&#8230;). Each machine is registered with [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.gahooa.com&amp;blog=6218261&amp;post=93&amp;subd=gahooa&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>As I was discussing lightly <a href="http://blog.gahooa.com/2009/03/01/installing-source-rpms-to-your-home-directory/">before</a>, I have recently been involved in building quite a few RPMs for our server clusters at <a href="http://www.appcove.com">AppCove</a>.</p>
<hr />
<h2>Where we have arrived:</h2>
<p>Our (new) primary production cluster consists of multiple RedHat Enterprise Linux 5 boxes in different capacities (webserver, appserver, database master, database slave, etc&#8230;).</p>
<p>Each machine is registered with 3 yum repositories:</p>
<ol>
<li>RHEL (RedHat Enterprise Linux)</li>
<li>EPEL (Extra Packages for Enterprise Linux)</li>
<li>ACN (AppCove Network)</li>
</ol>
<p><strong>All</strong> of our custom software packages and custom builds of open source software are placed into individual RPMs, and entered into our ACN repository.</p>
<p>From there, it is a snap to update any given server with the correct version of the software that server needs.</p>
<p>We have a dedicated build area, versioned with <a href="http://git-scm.com/">git</a>, that is used to build and package all of the custom software that is needed.</p>
<p><em>(note, RPMs are not used for web application deployment &#8212; <a href="http://samba.anu.edu.au/rsync/">rsync</a> via <a href="http://en.wikipedia.org/wiki/Secure_Shell">ssh</a> is used for that)</em></p>
<hr />
<h2>Recommendation:</h2>
<p>Having worked through the process from start to finish, I must say that I would <strong>highly</strong> recommend the following tools to anyone who is responsible for <a href="http://www.redhat.com/rhel/">RedHat Enterprise</a>, <a href="http://www.centos.org/">Centos</a>, or <a href="http://fedoraproject.org/">Fedora</a> system administration.</p>
<ul>
<li><a href="http://git-scm.com/">git</a> &#8211; to keep your .spec files versioned</li>
<li><a href="http://www.rpm.org/max-rpm-snapshot/rpmbuild.8.html">rpmbuild</a> &#8211; to build the rpms</li>
<li><a href="http://createrepo.baseurl.org/">createrepo</a> &#8211; to create your very own yum repository</li>
<li><a href="http://www.apache.org/">apache</a> &#8211; to serve the yum repository</li>
<li><a href="http://yum.baseurl.org/">yum</a> &#8211; to obtain, install, and upgrade your rpms</li>
</ul>
<p>Additionally, if you are using RedHat Enterprise or Centos, I would highly recommend using <a href="http://fedoraproject.org/wiki/EPEL">Extra Packages for Enterprise Linux (EPEL)</a> to get a few of those &#8220;other&#8221; packages that don&#8217;t come with your OS (git, for example).</p>
<p>&#8211;<br />
Learning how to build RPMs was a fairly steep curve.  But it wasn&#8217;t long.  It is one of those things that if you know it you say &#8220;<em>that&#8217;s easy</em>&#8221; and if you don&#8217;t you say &#8220;<em>what the ???</em>&#8220;</p>
<p>yum+rpm was invented (I assume) to make life easier for countless system administrators and software publishers.  So it&#8217;s not the kind of thing that everyone is involved in.</p>
<p>I was a bit tough to figure out the caveats of how to <span style="text-decoration:underline;">correctly</span> build RPM&#8217;s <span style="text-decoration:underline;">that work</span>.  The documentation is a bit sparse.  A bit here and a bit there.</p>
<hr />
<h2>What are the benefits?</h2>
<p>Many.  Let me list a few.</p>
<p><strong>Your system stays really clean. </strong> With RPMs, you can uninstall <span style="text-decoration:underline;">everything you installed</span><strong> </strong>without leaving extra files laying around.</p>
<p><strong>Upgrades are a snap. </strong>Once you have registered your own yum repository on a system, you can upgrade a given package by running:</p>
<pre style="padding-left:30px;">yum upgrade your-package</pre>
<p><strong>All your systems can be on the same &#8220;page&#8221;.</strong> It is very easy, using yum, to ensure that all of your systems are using the <strong>exact</strong> same version of software.</p>
<p><strong>Custom builds are super easy to maintain.</strong> We custom-compile php, python, and various other software.  Once the .spec files are in place, <strong>all </strong>of your software can be re-packaged with a single command.</p>
<p>In our specific case, we wanted to have the <a href="http://www.danga.com/memcached/">memcached</a> client statically compiled into <a href="http://www.php.net/">PHP</a>.  With a few extra commands in the .spec file, it was a snap to pull in the source from <a href="http://pecl.php.net/">pecl</a>, and update `configure` to take it into account.</p>
<p><strong>All builds can take place in one place. </strong>With one set of documentation, one consistent set of development tools, etc&#8230;  We have a user called `build` on one of the hosts that is specifically used for building all of the RPMs.</p>
<hr />
<h2>Where to learn?</h2>
<p>The best way to learn, as usual, is to jump in and figure it out.   There is some really good documentation buried in the <a href="http://www.rpm.org">rpm.org</a> site.   It is a book called <strong>Maximum RPM</strong>, origninally published by redhat.  The current snapshot of the book is <a href="http://www.rpm.org/max-rpm-snapshot/">available online</a>.</p>
<p style="padding-left:30px;"><a href="http://www.rpm.org/max-rpm-snapshot/">http://www.rpm.org/max-rpm-snapshot/</a></p>
<p>Google is another good resource, depending on what it is you are looking for.</p>
<br /> Tagged: Apache, EPEL, Linux, RHEL, RPM, System Administration, YUM <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gahooa.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gahooa.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/gahooa.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/gahooa.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/gahooa.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/gahooa.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/gahooa.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/gahooa.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/gahooa.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/gahooa.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/gahooa.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/gahooa.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/gahooa.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/gahooa.wordpress.com/93/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.gahooa.com&amp;blog=6218261&amp;post=93&amp;subd=gahooa&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.gahooa.com/2009/03/08/i-highly-recommend-yum-createrepo-rpmbuild/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">gahooa</media:title>
		</media:content>
	</item>
	</channel>
</rss>
