<?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>D90 Tools &#38; Techniques &#187; Linux</title>
	<atom:link href="http://www.d90.us/toolbox/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.d90.us/toolbox</link>
	<description>So I can remember how I did stuff in the future...</description>
	<lastBuildDate>Fri, 26 Nov 2010 20:08:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.3</generator>
		<item>
		<title>Custom 404 for Apache (using PHP!)</title>
		<link>http://www.d90.us/toolbox/2010/11/04/custom-404-for-apache-using-php/</link>
		<comments>http://www.d90.us/toolbox/2010/11/04/custom-404-for-apache-using-php/#comments</comments>
		<pubDate>Thu, 04 Nov 2010 23:03:44 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Sysadmin Tools]]></category>
		<category><![CDATA[Web Hosting Tools]]></category>

		<guid isPermaLink="false">http://www.d90.us/toolbox/?p=210</guid>
		<description><![CDATA[Images, css, js just get a simple 404 Not Found page. Everything not in the list of items we&#8217;re checking get redirected to the homepage. So a simple typo will get the redirect, but a missing PNG file that&#8217;s called by one of our pages won&#8217;t send a copy of the homepage to the client [...]]]></description>
			<content:encoded><![CDATA[<p>Images, css, js just get a simple 404 Not Found page.</p>
<p>Everything not in the list of items we&#8217;re checking get redirected to the homepage.  So a simple typo will get the redirect, but a missing PNG file that&#8217;s called by one of our pages won&#8217;t send a copy of the homepage to the client telling it it is an image file!</p>
<p><code><?php<br />
/*<br />
This is a custom 404 handler.</p>
<p>It does makes a decision -- if it's a small, auxiliary file like an image, code sheet, etc<br />
that is being requested and not found then we'll send a standard Apache 404 page.</p>
<p>However, anything that looks like a website request (i.e. everything NOT in the list)<br />
will be given a 301 redirect to our homepage.</p>
<p>Invoke by:<br />
ErrorDocument 404 /404.php</p>
<p>4 November 2010<br />
Matt Kivela<br />
*/</p>
<p>/* Currently set to filter:<br />
   aspx<br />
   asp<br />
   cgi<br />
   css<br />
   gif<br />
   ico<br />
   jpg<br />
   ogg<br />
   png<br />
*/</p>
<p>if (preg_match('/\.[Aa][Ss][Hh][Xx]|[Aa][Ss][Pp]|[Cc][Gg][Ii]|[Cc][Ss][Ss]|[Gg][Ii][Ff]|[Ii][Cc][Oo]|[Jj][Pp][Gg]|[Jj][Ss]|[Oo][Gg][Gg]|[Pp][Nn][Gg]$/', $_SERVER[REQUEST_URI], $foo))<br />
  {<br />
     echo Header("HTTP/1.1 404 Not Found");<br />
     echo Header("Status: 404 Not Found");<br />
     echo "<html><body>404 Error:</br>File: http://$_SERVER[SERVER_NAME]$_SERVER[REQUEST_URI] not found.</br>";<br />
     echo "If this is causing a problem, you may contact <a href=\"mailto:admin@yourdomain.org\">admin@yourdomain.org</a> or</br>";<br />
     echo "submit a ticket at <a href=\"http://bugzilla.yourdomain.org/\">http://bugzilla.yourdomain.org/</a></body></html>";<br />
   }<br />
else<br />
  {<br />
    $new_url = "http://$_SERVER[SERVER_NAME]/";<br />
    echo Header( "HTTP/1.1 301 Moved Permanently" );<br />
    echo Header( "Location: $new_url" );<br />
  }<br />
?></p>
<p>~<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.d90.us/toolbox/2010/11/04/custom-404-for-apache-using-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rootkit Hunters</title>
		<link>http://www.d90.us/toolbox/2010/02/10/rootkit-hunters/</link>
		<comments>http://www.d90.us/toolbox/2010/02/10/rootkit-hunters/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 18:53:23 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[General Security]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Sysadmin Tools]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.d90.us/toolbox/?p=182</guid>
		<description><![CDATA[A few resources for finding rootkits: Linux: Rootkit Hunter Chkrootkit Windows: RootkitRevealer]]></description>
			<content:encoded><![CDATA[<p>A few resources for finding rootkits:</p>
<p>Linux:<br />
<a href="www.rootkit.nl" target="_blank">Rootkit Hunter</a><br />
<a href="http://www.chkrootkit.org/" target="_self">Chkrootkit</a></p>
<p>Windows:<br />
<a href="http://technet.microsoft.com/en-us/sysinternals/bb897445.aspx" target="_blank">RootkitRevealer</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.d90.us/toolbox/2010/02/10/rootkit-hunters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cool one-line report&#8230;</title>
		<link>http://www.d90.us/toolbox/2009/07/13/cool-one-line-report/</link>
		<comments>http://www.d90.us/toolbox/2009/07/13/cool-one-line-report/#comments</comments>
		<pubDate>Tue, 14 Jul 2009 01:46:23 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.d90.us/toolbox/?p=111</guid>
		<description><![CDATA[sudo grep &#8220;GET https://www.miroguide.com/ HTTP/1.1&#8243; /var/log/squid/access.log  &#124; grep &#8220;\&#8221;Miro/&#8221; &#124; sed &#8216;s/^.*&#8221;-&#8221; &#8220;//g&#8217; &#124; sed &#8216;s/ .*$//g&#8217; &#124; grep Miro &#124; sort &#124; uniq -c The sort &#124; uniq -c being the good part.  It parsed 625,000 entries in the log to make this useful (to the person who asked for it) report:       2 Miro/0.9.8 [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>sudo grep &#8220;GET <a href="https://www.miroguide.com/">https://www.miroguide.com/</a> HTTP/1.1&#8243; /var/log/squid/access.log  | grep &#8220;\&#8221;Miro/&#8221; | sed &#8216;s/^.*&#8221;-&#8221; &#8220;//g&#8217; | sed &#8216;s/ .*$//g&#8217; | grep Miro | sort | uniq -c</p></blockquote>
<p>The sort | uniq -c being the good part.  It parsed 625,000 entries in the log to make this useful (to the person who asked for it) report:</p>
<blockquote><p>      2 Miro/0.9.8<br />
      7 Miro/0.9.8.1<br />
      8 Miro/0.9.9<br />
     86 Miro/0.9.9.1<br />
     42 Miro/0.9.9.1a<br />
     12 Miro/0.9.9.9<br />
     18 Miro/0.9.9.9.1<br />
    383 Miro/1.0<br />
     10 Miro/1.0-svn<br />
    362 Miro/1.1<br />
      1 Miro/1.1.1<br />
    255 Miro/1.1.2<br />
     56 Miro/1.2<br />
     92 Miro/1.2.1<br />
    119 Miro/1.2.2<br />
    600 Miro/1.2.3<br />
    415 Miro/1.2.4<br />
      4 Miro/1.2.5<br />
    217 Miro/1.2.6<br />
    825 Miro/1.2.7<br />
   1784 Miro/1.2.8<br />
     66 Miro/1.2-svn<br />
    237 Miro/2.0<br />
   1119 Miro/2.0.1<br />
    292 Miro/2.0.2<br />
   3772 Miro/2.0.3<br />
   7171 Miro/2.0.4<br />
  32008 Miro/2.0.5<br />
     33 Miro/2.0-svn<br />
    119 Miro/2.5-rc1<br />
    125 Miro/2.5-svn</p></blockquote>
<p>The somewhat frightening part is that line took all of 90 seconds for me to whip out&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.d90.us/toolbox/2009/07/13/cool-one-line-report/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Squid handling http &#8211;&gt; https redirects</title>
		<link>http://www.d90.us/toolbox/2009/05/29/squid-handling-http-https-redirects/</link>
		<comments>http://www.d90.us/toolbox/2009/05/29/squid-handling-http-https-redirects/#comments</comments>
		<pubDate>Sat, 30 May 2009 01:35:48 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Squid]]></category>
		<category><![CDATA[Sysadmin Tools]]></category>

		<guid isPermaLink="false">http://www.d90.us/toolbox/?p=95</guid>
		<description><![CDATA[In configuring Squid to handle both our port 80 and 443 traffic, we have the issue that we can use redirects at the webserver level to redirect certain pages to https:// . So this is handled in Squid. First, make a simple script.  There&#8217;s a possibility another redirector like Squirm might do a better job, [...]]]></description>
			<content:encoded><![CDATA[<p>In configuring Squid to handle both our port 80 and 443 traffic, we have the issue that we can use redirects at the webserver level to redirect certain pages to https:// .</p>
<p>So this is handled in Squid.</p>
<p>First, make a simple script.  There&#8217;s a possibility another redirector like Squirm might do a better job, but I haven&#8217;t played with them.</p>
<blockquote><p>!/usr/bin/perl<br />
$|=1;<br />
while (&lt;&gt;) {<br />
s@http://www7.getmiro.(com|net|org)/adopt(.*)$@301:https://www7.getmiro.com/adopt$2@;<br />
print;<br />
}</p></blockquote>
<p>Saved at /etc/squid3/squid_redirector.pl and chown/chmod so the user &#8220;proxy&#8221; that squid runs under can run it.  Your path, of course, may vary.</p>
<p>The key part for what we need is that we pre-pend &#8220;301&#8243; before https:  in the rewrite.  When this is returned to the user&#8217;s browser it redirects them to the secure page.  This script also takes anything at com, net, or org and forces them to a tld of .com as well.</p>
<p>It&#8217;s easy to test this perl script.  Simply type ./squid_redirector.pl which launches it interactively.</p>
<blockquote><p><span style="color: #000000;"># ./squid_redirector.pl<br />
</span><span style="color: #ff0000;"><span style="color: #000000;">http://www7.getmiro.com/foo</span></p>
<p>http://www7.getmiro.com/foo</p>
<p><span style="color: #000000;">http://www7.getmiro.com/adopt/test</span><br />
301:https://www7.getmiro.com/adopt/test<br />
<span style="color: #000000;">http://www7.getmiro.<strong>net</strong>/adopt/matt/is/an/evil/genius </span><br />
301:https://www7.getmiro.<strong>com</strong>/adopt/matt/is/an/evil/genius</span></p></blockquote>
<p>Next, tell Squid to use it.  We need to enable these lines in the squid.conf file:</p>
<p style="padding-left: 30px;">url_rewrite_program /etc/squid3/squid_redirector.pl<br />
url_rewrite_children 10<br />
url_rewrite_host_header off<br />
url_rewrite_bypass on</p>
<p>The first line tells Squid what to use to rewrite URLs, the second tells it to spawn 10 instances on startup.  I&#8217;m not sure, in the end, if host_header needs to be off.  url_rewrite_bypass on allows Squid to skip the re-writing step if all the redirectors are busy.  That&#8217;s a decision knowing our security risks, users, and needs &#8212; and I&#8217;m going with more reliability over absolute security.  We&#8217;ll should see skips showing up in the logs and adjust settings from there if necessary.</p>
<p>Restart Squid, give it a test.  Famous last words &#8212; it should work now.</p>
<p>References:</p>
<p>http://wiki.squid-cache.org/Features/Redirectors</p>
<p>http://brainextender.blogspot.com/2009/01/simple-squid-redirector-perl-script.html</p>
]]></content:encoded>
			<wfw:commentRss>http://www.d90.us/toolbox/2009/05/29/squid-handling-http-https-redirects/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lighttpd, virtual hosts, alternative ports</title>
		<link>http://www.d90.us/toolbox/2009/05/29/lighttpd-virtual-hosts-alternative-ports/</link>
		<comments>http://www.d90.us/toolbox/2009/05/29/lighttpd-virtual-hosts-alternative-ports/#comments</comments>
		<pubDate>Fri, 29 May 2009 20:25:50 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Lighttpd]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Sysadmin Tools]]></category>

		<guid isPermaLink="false">http://www.d90.us/toolbox/?p=92</guid>
		<description><![CDATA[In the configuration of our new server, all ports 80 and 443 traffic is handled by Squid as a reverse proxy.  8080 is the &#8220;backdoor&#8221; that bypasses Squid and hits Lighttpd directly. But the standard format of a Lighttpd virtual host entry doesn&#8217;t recognize alternate ports appended after the tld.  Not a big deal, this [...]]]></description>
			<content:encoded><![CDATA[<p>In the configuration of our new server, all ports 80 and 443 traffic is handled by Squid as a reverse proxy.  8080 is the &#8220;backdoor&#8221; that bypasses Squid and hits Lighttpd directly.</p>
<p>But the standard format of a Lighttpd virtual host entry doesn&#8217;t recognize alternate ports appended after the tld.  Not a big deal, this does the trick:</p>
<blockquote><p>$HTTP["host"] =~ &#8220;(^|\.)getmiro\.(com|net|org)($|:8080$)&#8221; {</p></blockquote>
<p>Translated:<br />
<em>(^|\.)</em> Any hostname<br />
<em>getmiro\</em> Going to the gemtiro domain<br />
<em>.(com|net|org)</em> with a top level domain of com, net, or org<br />
<em>($|:8080$){</em> and ending with the tld or :8080 will be processed by the rules that follow.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.d90.us/toolbox/2009/05/29/lighttpd-virtual-hosts-alternative-ports/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Lighttpd, virtual hosts, and wildcard domains</title>
		<link>http://www.d90.us/toolbox/2009/05/29/lighttpd-virtual-hosts-and-wildcard-domains/</link>
		<comments>http://www.d90.us/toolbox/2009/05/29/lighttpd-virtual-hosts-and-wildcard-domains/#comments</comments>
		<pubDate>Fri, 29 May 2009 20:01:53 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Sysadmin Tools]]></category>
		<category><![CDATA[Web Hosting Tools]]></category>

		<guid isPermaLink="false">http://www.d90.us/toolbox/?p=86</guid>
		<description><![CDATA[So we&#8217;re setting up mirocommunity.com, and I don&#8217;t want to be hassled continously to create new hostnames in DNS. To avoid that, it&#8217;s a simple wildcard entry like this in the appropriate named database: *.mirocommunity.com.    IN      CNAME   mirocommunity.com. Which directs everything to our server. Now our server hosts multiple sites via host entries, so we [...]]]></description>
			<content:encoded><![CDATA[<p>So we&#8217;re setting up mirocommunity.com, and I don&#8217;t want to be hassled continously to create new hostnames in DNS.</p>
<p>To avoid that, it&#8217;s a simple wildcard entry like this in the appropriate named database:</p>
<blockquote><p>*.mirocommunity.com.    IN      CNAME   mirocommunity.com.</p></blockquote>
<p>Which directs everything to our server.</p>
<p>Now our server hosts multiple sites via host entries, so we can&#8217;t use a simple negation like this:</p>
<blockquote><p>$HTTP["host"] !~ &#8220;^(www|medfield)\.mirocommunity\.(com|net|org)($|:8080$)&#8221; {<br />
url.redirect = (<br />
&#8220;^(.*)$&#8221; =&gt; &#8220;http://www.mirocommunity.com$1&#8243;,<br />
)<br />
}</p></blockquote>
<p>Note the negation by using !~ instead of =~.  That would work if all we had was mirocommunity sites to host, but when hitting another site on the server like www7.getmiro.com it would read it as not being www or medfield dot mirocommunity, and thus drop you to www.mirocommunity.com.  For the curious, the 8080 part of the url parsing is a bypass of the Squid proxies on ports 80 and 443.</p>
<p>Anything that doesn&#8217;t match a virtual host or alias on our server gets dropped by default to /var/www.</p>
<p>There lies the simple solution &#8212; put an index.php file there that does the redirect work:</p>
<blockquote><p>&lt;?php<br />
// Hostnames that aren&#8217;t matched in Lighttpd get dropped here<br />
// by default.<br />
// This script removes the hostname(s) and drops them to<br />
// www.[domain].[tld]<br />
// 29 May 2009 MRK<br />
$split_host = split(&#8220;\.&#8221;, $_SERVER[HTTP_HOST]);<br />
$domain = count($split_host) &#8211; 2;<br />
$tld = count($split_host) &#8211; 1;<br />
$new_host = &#8220;http://www.$split_host[$domain].$split_host[$tld]&#8220;;<br />
// echo &#8220;$new_host&#8221;;<br />
header(&#8220;Location: $new_host&#8221;);<br />
exit;<br />
?&gt;</p></blockquote>
<p>The <em>split</em> command splits the $_SERVER[HTTP_HOST] variable at each period, and put it&#8217;s contents less the periods into an array called $split_host.</p>
<p>The <em>count($split_host)</em> determines how many members we have in the $split_host array.  We know we always want the last (the top level domain &#8212; .com, etc) and second to last (the domain &#8212; mirocommunity, etc).  Since arrays start at 0, we simply count -1 for the tld and -2 for the domain.</p>
<p>By adding the <em>count</em> logic, we can handle domains like brooklyn.newyork.mirocommunity.com which have more then one hostname before the domain and tld.</p>
<p>$new_host then forms the URL we want to catch wildcard hostnames that haven&#8217;t been configured yet.  It&#8217;s simply the www.domain.tld form.  That&#8217;s fed to a http<em> header</em> which causes the user&#8217;s browser to redirect to the default website we want.</p>
<p>So as of today, while newyork.mirocommunity.com and brooklyn.newyork.mirocommunity.com have no virtual hosts, you do arrive successfully at www.mirocommunity.com.</p>
<p>Our developers can activate those hostnames simply by adding an entry in the appropriate lighttpd conf file and reload lighttpd &#8212; no need to contact the sysadmin to go make an entry in our DNS system for each new city added.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.d90.us/toolbox/2009/05/29/lighttpd-virtual-hosts-and-wildcard-domains/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Squid to handle both 80 and 443</title>
		<link>http://www.d90.us/toolbox/2009/05/26/installing-squid-to-handle-both-80-and-443/</link>
		<comments>http://www.d90.us/toolbox/2009/05/26/installing-squid-to-handle-both-80-and-443/#comments</comments>
		<pubDate>Tue, 26 May 2009 20:54:41 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Web Hosting Tools]]></category>

		<guid isPermaLink="false">http://www.d90.us/toolbox/?p=70</guid>
		<description><![CDATA[This outlines configuring Squid, running two instances, to handle both port 80 and 443 traffic on an Amazon EC2 instance running Ubuntu Jaunty.  We can bypass Squid by going directly to Lighttpd on port 8080. To answer a couple questions off the top, you should also read my post on how to configure http &#8211;&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>This outlines configuring Squid, running two instances, to handle both port 80 and 443 traffic on an Amazon EC2 instance running Ubuntu Jaunty.  We can bypass Squid by going directly to Lighttpd on port 8080.</p>
<p>To answer a couple questions off the top, you should also read <a href="http://www.d90.us/toolbox/2009/05/29/squid-handling-http-https-redirects/" target="_blank">my post on how to configure http &#8211;&gt; https</a> redirects at the Squid level since the web server won&#8217;t be able to handle that in this configuration, and this <a href="http://www.d90.us/toolbox/2009/05/29/lighttpd-virtual-hosts-alternative-ports/" target="_blank">post</a> documents a little bit of magic that needs to be done to support 8080 with virtual hosts.</p>
<p>In configuring our new servers, the choice of Squid was pretty easy &#8212; it can handle SSL traffic, Varnish <a href="http://varnish.projects.linpro.no/wiki/FAQ#IsthereanywaytodoHTTPSwithVarnish" target="_blank">can&#8217;t</a> by itself.  We already use Squid to do ssl traffic on some of our physical servers being replaced, so I&#8217;d like to continue using that feature.  In a future post, we&#8217;ll talk about configuring Squid to use a Universal Certificate that can handle multiple domains on one IP (it looks doable in theory, but I haven&#8217;t purchased that yet).</p>
<p>Normally installation is a simple</p>
<p>apt-get install squid</p>
<p>to install Squid.  However, Ubuntu doesn&#8217;t package OpenSSL with Squid and for license reasons has no intention of doing so.  So you&#8217;re better off following <a href="http://www.d90.us/toolbox/2009/05/26/adding-ssl-support-to-squid-package-on-ubuntu/" target="_blank">these directions</a> and modifying a package to include ssl support, then installing that.</p>
<p>Modify /etc/squid/squid.conf</p>
<p>This is the port 80 traffic.  Note &#8212; we actually had a large number of &#8220;acl valid_dst dstdomain,&#8221; which block attempts to use Squid as a pass-thru proxy at the proxy level instead of having the webserver reject the traffic.</p>
<blockquote><p>http_port 80 accel vhost</p>
<p>cache_peer 127.0.0.1 parent 8080 0 no-query originserver login=PASS</p>
<p>logformat combined %&gt;a %ui %un [%{%d/%b/%Y:%H:%M:%S +0500}tl] &#8220;%rm %ru HTTP/%rv&#8221; %Hs %h&#8221; &#8220;%{User-Agent}&gt;h&#8221; %Ss:%Shaccess_log /var/log/squid/access.log combined</p>
<p>acl SSL_ports port 8080</p>
<p>acl Safe_ports port 8080</p>
<p>acl valid_dst dstdomain .somedomain.com</p>
<p>http_access allow valid_dst</p></blockquote>
<p>Copy squid.conf to squid_ssl.conf, comment out http_port and make the following changes:</p>
<blockquote><p>https_port 443 accel vhost cert=/(cert location) key=/(key location)<br />
cache_log /var/log/squid3/cache_ssl.log<br />
cache_store_log /var/log/squid3/store_ssl.log</p></blockquote>
<p>We have seperate cache and store logs for troubleshooting, but both configurations use access.log to record traffic.  This simplifies using AWStats to analyze the logs; if we run into performance problems in the future we may need a tool like logmerge.pl to consolidate seperate access logs.  While I can think of a few things that could go wrong, I don&#8217;t know they will go wrong till we try, so let&#8217;s see if the simple way works first.</p>
<p>Now, let&#8217;s configure and initialize a seperate spool for ssl traffic:</p>
<blockquote><p>mkdir /var/spool/squid3_ssl<br />
chown -R proxy:proxy /var/spool/squid3_ssl/<br />
squid3 -z -f /etc/squid3/squid_ssl.conf</p></blockquote>
<p>Copy /etc/init.d/squid3 to /etc/init.d/squid3_ssl and make the following changes:</p>
<blockquote><p>NAME=squid3_ssl<br />
SQUID_ARGS=&#8221;-D -YC -f /etc/squid3/squid_ssl.conf&#8221;<br />
CONFIG=/etc/squid3/squid_ssl.conf<br />
$DAEMON -z -f $CONFIG</p></blockquote>
<p>And do a ln -s /etc/init.d/squid3_ssl /etc/rc2.d/S30squid3_ssl to make it start automatically.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.d90.us/toolbox/2009/05/26/installing-squid-to-handle-both-80-and-443/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Optimizing Website integration with Amazon&#8217;s S3 Service</title>
		<link>http://www.d90.us/toolbox/2009/02/28/optimizing-website-integration-with-amazons-s3-service/</link>
		<comments>http://www.d90.us/toolbox/2009/02/28/optimizing-website-integration-with-amazons-s3-service/#comments</comments>
		<pubDate>Sat, 28 Feb 2009 06:15:26 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Sysadmin Tools]]></category>
		<category><![CDATA[Web Hosting Tools]]></category>

		<guid isPermaLink="false">http://www.d90.us/toolbox/?p=48</guid>
		<description><![CDATA[At Participatory Culture Foundation we use Amazon&#8217;s S3 Service to host our static content &#8212; css, js, and images. This accomplishes two things &#8212; it improves the performance for our visitors since Amazon has faster performance and reliability then we can afford on our own servers, and it does so at a lower cost. In [...]]]></description>
			<content:encoded><![CDATA[<p>At Participatory Culture Foundation we use Amazon&#8217;s S3 Service to host our static content &#8212; css, js, and images.</p>
<p>This accomplishes two things &#8212; it improves the performance for our visitors since Amazon has faster performance and reliability then we can afford on our own servers, and it does so at a lower cost.</p>
<p>In this post we&#8217;ll look at how much bandwidth and files/redirect we use without S3, then with various combination of local and redirected files, up to code as optimized as I have been able to make it &#8212; fully optimized we our servers only transfer 6.7% of the bytes that the &#8220;unoptimized&#8221; site would.  Optimizing this single popular page to use S3 efficiently saves PCF about $1,000 a year in hosting costs.</p>
<h4>1)<br />
Let&#8217;s look at a redacted Squid log after the February, 2009 redesign of www.getmiro.com when not using S3 at all:</h4>
<pre><em>"GET http://www.getmiro.com/ HTTP/1.1" 200 21781 "-" "Mozilla/5.0
 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.6) Gecko/2009011913 Firefox/3.0.6"
"GET http://www.getmiro.com//css/nav.css HTTP/1.1" 200 5004 "http://www.getmiro.com/" "Mozilla/5.0
"GET http://www.getmiro.com//css/styles.css HTTP/1.1" 200 21515 "http://www.getmiro.com/" "Mozilla/5.0
"GET http://www.getmiro.com/css/index.css HTTP/1.1" 200 7709 "http://www.getmiro.com/" "Mozilla/5.0
"GET http://www.getmiro.com//i/blue_bg.png HTTP/1.1" 200 1198 "http://www.getmiro.com//css/styles.css" "Mozilla/5.0
"GET http://www.getmiro.com//i/nav_back.gif HTTP/1.1" 200 530 "http://www.getmiro.com//css/nav.css" "Mozilla/5.0
[blah blah blah...]</em></pre>
<p>That&#8217;s 37 files, for a total of 338,359 Bytes.</p>
<h4>2)<br />
Now let&#8217;s look if we load CSS from our server, but use Apache to re-write images and js to the S3 service:</h4>
<pre><em>"GET http://www.getmiro.com/ HTTP/1.1" 200 21781 "http://www.getmiro.com/" "Mozilla/5.0
 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.6) Gecko/2009011913 Firefox/3.0.6"
"GET http://www.getmiro.com//css/nav.css HTTP/1.1" 200 5004 "http://www.getmiro.com/" "Mozilla/5.0
"GET http://www.getmiro.com//css/styles.css HTTP/1.1" 200 21515 "http://www.getmiro.com/" "Mozilla/5.0
"GET http://www.getmiro.com/css/index.css HTTP/1.1" 200 7709 "http://www.getmiro.com/" "Mozilla/5.0
"GET http://www.getmiro.com//i/blue_bg.png HTTP/1.1" 302 688 "http://www.getmiro.com//css/styles.css" "Mozilla/5.0
"GET http://www.getmiro.com//i/nav_back.gif HTTP/1.1" 302 690 "http://www.getmiro.com//css/nav.css" "Mozilla/5.0
[blah blah blah...]</em></pre>
<p>Now it&#8217;s four files, plus 33 redirects &#8212; and only 78,705 bytes.</p>
<h4>3)<br />
Now let&#8217;s use Apache to redirect the CSS to be pulled from Amazon S3.</h4>
<pre><em>"GET http://www.getmiro.com/ HTTP/1.1" 200 21781 "-" "Mozilla/4.0
 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)"
"GET http://www.getmiro.com//css/nav.css HTTP/1.1" 302 684 "http://www.getmiro.com/" "Mozilla/4.0
"GET http://www.getmiro.com//css/styles.css HTTP/1.1" 302 690 "http://www.getmiro.com/" "Mozilla/4.0
"GET http://www.getmiro.com/css/index.css HTTP/1.1" 302 688 "http://www.getmiro.com/" "Mozilla/4.0
"GET http://www.getmiro.com//i/blue_bg.png HTTP/1.1" 302 687 "http://www.getmiro.com/" "Mozilla/4.0
"GET http://www.getmiro.com//i/nav_back.gif HTTP/1.1" 302 689 "http://www.getmiro.com/" "Mozilla/4.0
[blah blah blah...]</em></pre>
<p>Still four files and 33 redirects, but down to 46,506 bytes.</p>
<p>So far it&#8217;s all been pretty standard stuff in Apache using mod_rewrite redirects.  Apache sees a CSS sheet being called, it redirects it to S3.</p>
<pre><em>RewriteRule ^/css/(.*) http://s3.getmiro.3.0.com.s3.amazonaws.com/css/$1</em></pre>
<p>And then a css sheet may have a line like this:</p>
<p><em>background: url(../i/screen_dropshadow.png) -20px -36px no-repeat;</em></p>
<p>Now an observant user may note in the logs above that I switched from using Firefox to IE.  Why?  The browsers interpret the CSS differently.</p>
<p>Firefox interprets &#8220;../i/&#8221; relative to where the CSS style sheet is LOADED from &#8212; in our case  http://s3.getmiro.3.0.com.s3.amazonaws.com/css/.<br />
Internet Explorer interprets &#8220;../i/&#8221; relative to where the CSS style sheet is CALLED from &#8212; in our case http://www.getmiro.com/css/.</p>
<p>Those familiar with unix notation know that &#8220;../i/&#8221; from &#8220;getmiro.com/css/&#8221; gets you to &#8220;getmiro.com/i/&#8221;.</p>
<h4>4)<br />
Now we get fancy.</h4>
<p>In implementing S3, we have a bash script which handles the synchronization between our servers and S3.  So in that script, let&#8217;s intercept the CSS sheets, do a simple SED, and upload the modified files to a special location:</p>
<pre><em># getmiro css
# This substitutes ../i with http://s3.getmiro.3.0.com.s3.amazonaws.com/ in the getmiro css code
# and uploads them to a special directory in amazon.  This is in turn re-written by Apache to point there.
# Having the full url hard coded saves tens of thousands of redirects and gigs of bandwidth.
# It's also more efficient then "php-ifying" css to do the url substitution.

  # First, copy they css to a working directory:
    cp /data/getmiro/css/*.css /scripts/getmiro_css

  # It's safer to just modify files we know about, rather then automate finding and modifying without foreknowledge:
    sed -i 's/\.\.\/i/http:\/\/s3.getmiro.3.0.com.s3.amazonaws.com\/i/g' /scripts/getmiro_css/download-features.css
    sed -i 's/\.\.\/i/http:\/\/s3.getmiro.3.0.com.s3.amazonaws.com\/i/g' /scripts/getmiro_css/index.css
    sed -i 's/\.\.\/i/http:\/\/s3.getmiro.3.0.com.s3.amazonaws.com\/i/g' /scripts/getmiro_css/nav.css
    sed -i 's/\.\.\/i/http:\/\/s3.getmiro.3.0.com.s3.amazonaws.com\/i/g' /scripts/getmiro_css/styles.css

  # And let's upload them:
    /usr/local/s3sync/s3sync.rb -r -p -v /scripts/getmiro_css/ s3.getmiro.3.0.com:css/s3_coded/</em></pre>
<p>In the background so the web developers don&#8217;t have to worry about modifying the CSS sheets to include the hard link, transforming lines like:</p>
<pre><em>background: url(../i/screen_dropshadow.png) -20px -36px no-repeat;
</em></pre>
<p>into</p>
<pre><em>background: url(</em><em><em>s3.getmiro.3.0.com.s3.amazonaws.com</em>/i/screen_dropshadow.png) -20px -36px no-repeat;</em></pre>
<p>It&#8217;s necessary to use the pattern \.\./i/ in sed in case a developer does hard code the amazon link.  The \. means literally a period; regexes like this otherwise use a . as a wildcard to match one character, and just ../i/ would match any two characters before /i/.</p>
<p>In Apache, we change the redirect to this:</p>
<pre><em>RewriteRule ^/css/(.*) http://s3.getmiro.3.0.com.s3.amazonaws.com/css/S3_coded/$1</em></pre>
<p>With this change implemented:</p>
<pre><em>"GET http://www.getmiro.com/ HTTP/1.1" 200 21781 "-" "Mozilla/4.0
 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)"
"GET http://www.getmiro.com//css/styles.css HTTP/1.1" 302 708 "http://www.getmiro.com/" "Mozilla/4.0
"GET http://www.getmiro.com//css/nav.css HTTP/1.1" 302 702 "http://www.getmiro.com/" "Mozilla/4.0
"GET http://www.getmiro.com/css/index.css HTTP/1.1" 302 706 "http://www.getmiro.com/" "Mozilla/4.0</em></pre>
<p>Much better!  One file, three redirects for 23,897 bytes.  That one change represents nearly a 50% reduction in bandwidth usage on our physical servers from just the example above, and only about 1/3rd the bandwidth if we used CSS sheets being served locally even if they had the hard links to S3 on them.</p>
<h4>5)<br />
Finally one more tweak.</h4>
<p>The default Apache redirect includes HTML code saying where a file has moved.  But this isn&#8217;t necessary &#8212; a web browser just needs the correct headers to tell it where to go.</p>
<p>So replacing the redirect to S3 we used before, we use this:</p>
<pre><em>RewriteRule ^/css/(.*) /custom_messages/css_rewrite.php</em></pre>
<p>This is css_rewrite.php:</p>
<pre><em>&lt;?php
/*
This rewrites css just using headers.  This saves about 300bytes per
redirect -- which saves a heck of a lot of bandwidth over time when we're doing 3
css rewrites for every page view...works out to 30+ MB / day!</em></pre>
<pre><em>Invoke by:
RewriteRule ^/css/(.*) /custom_messages/css_rewrite.php
*/</em></pre>
<pre><em>$new_server = "http://s3.getmiro.3.0.com.s3.amazonaws.com/css/s3_coded/";
$new_url = preg_replace('/^.*\//', $new_server, $_SERVER[REQUEST_URI]);</em></pre>
<pre><em>echo Header( "HTTP/1.1 301 Moved Permanently" );
echo Header( "Location: $new_url" );
?&gt;</em></pre>
<p>This produces a very minimal redirect &#8212; under 400 bytes rather then over 700 bytes.</p>
<p>I haven&#8217;t done a complete analysis to know if this significantly slower then a native Apache redirect; initial review shows it is not slower for any given page load.  This step would need a very, very busy site however to make a meaningful performance or cost impact.  It&#8217;s something I&#8217;m noting though, because there could be other situations this type of optimization could be useful.  Most importantly the variables Apache (or IIS) can pass to other programs like PHP.  See this <a href="http://koivi.com/apache-iis-php-server-array.php" target="_blank">link</a> for a list of them.</p>
<pre><em>"GET http://www.getmiro.com/ HTTP/1.1" 200 21781 "-" "Mozilla/4.0
 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)"
"GET http://www.getmiro.com//css/styles.css HTTP/1.1" 301 397 "http://www.getmiro.com/" "Mozilla/4.0
"GET http://www.getmiro.com//css/nav.css HTTP/1.1" 301 394 "http://www.getmiro.com/" "Mozilla/4.0
"GET http://www.getmiro.com/css/index.css HTTP/1.1" 301 396 "http://www.getmiro.com/" "Mozilla/4.0</em></pre>
<p>Now just one file, three redirects and 22,968.</p>
<h4>Bottom line?</h4>
<p>Let&#8217;s take a typical day when the getmiro.com homepage is called 20,000 times.</p>
<pre>Scenario    Size     Total Daily      Estimated
                       Bandwidth     Daily Cost**
1           338,359        6.5GB          $4.73
2            78,705        1.5GB           1.09
3            46,506        887MB*           .65
4            23,897        455MB            .33
5            22,968        438MB            .32
* Unadjusted for Firefox's interpretation of CSS paths
** This estimate is based on purchasing enough fixed bandwidth (Mbps)
to cover our peak daily usage.  Our communication costs for our
physical servers is approximately times as much as Amazon S3 based on
actual transfers.</pre>
<p>So without S3 or any optimization, we&#8217;d be looking at a monthly cost around $142.00.</p>
<p>With S3 and with all our optimization, we&#8217;re looking at a monthly cost around $54.00.</p>
<p>For a small non-profit, that&#8217;s a nice savings over time.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.d90.us/toolbox/2009/02/28/optimizing-website-integration-with-amazons-s3-service/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Passwords and Data Mining</title>
		<link>http://www.d90.us/toolbox/2009/02/27/passwords-and-data-mining/</link>
		<comments>http://www.d90.us/toolbox/2009/02/27/passwords-and-data-mining/#comments</comments>
		<pubDate>Sat, 28 Feb 2009 03:43:04 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[General Security]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.d90.us/toolbox/?p=41</guid>
		<description><![CDATA[I believe the working assumption must be we&#8217;re under a persistent, long term attack by organized groups. This is not just organized crime, but I suspect organized criminal groups that are tolerated by states like Russia and China if not outright state sponsored.  It&#8217;s not just those old &#8220;boogey men&#8221; either &#8212; there are many [...]]]></description>
			<content:encoded><![CDATA[<p>I believe the working assumption must be we&#8217;re under a persistent, long term attack by organized groups.</p>
<p>This is not just organized crime, but I suspect organized criminal groups that are tolerated by states like Russia and China if not outright state sponsored.  It&#8217;s not just those old &#8220;boogey men&#8221; either &#8212; there are many nations from Poland to South Korea to Israel that have long histories of industrial espionage, and we must assume at the very least Western European and the descendents of the British Empire (U.S.A. included) at the very least collect and preserve usernames and passwords found passing the internet unencrypted.</p>
<p>When you read in the news about security breach after security breach, you have to assume organizations out there are selling, buying, collecting, and storing in data warehouses usernames and passwords.  If people sell credit card information and known good email addresses, this data has value too.</p>
<p>Passwords don&#8217;t even have to be in cleartext to have value in such a market.  As computing power comes down the ability to attack them through methods such as rainbow tables become more and more viable &#8212; by my calculations, you could build a highly efficient rainbow table of all possible Windows passwords on Amazon&#8217;s Elastic Computing Cloud for about $60,000/month.  While that takes funding and organization, we&#8217;re not exactly talking about needing the resources of SPECTRE to pull it off.  How many other databases out there store passwords also without salts, like Windows, making them very susceptible to rainbow tables?  Or how many databases, if breached, are likely to have the salt also revealed?</p>
<p>Most people use variations on the same password.  So once you start to data mine 15+ years of data collected in security breaches you start to have a big collection associating usernames, email addresses, and passwords.  This now gives you a fairly small number of passwords to try in focused attacks.</p>
<p>For an example, let&#8217;s consider this data set:</p>
<pre style="padding-left: 30px;">Jdoe    &lt;unknown email&gt;   password
Jdoe    &lt;unknown email&gt;   passw0rd
Jdoe    &lt;unknown email&gt;   password1
Jdoe    Jdoe@aol.com      passw0rd4
JohnDoe Jdoe@aol.com      &lt;unknown password&gt;</pre>
<p>Either using data mining or simply people as &#8220;mechanical turks&#8221; we can make a good guess is we see the username and email &#8220;JohnDoe Jdoe@aol.com&#8221; that his password will be something like password, passw0rd, password3.  So given just the username and email, we can try setup a low intensity attack &#8212; have a botnet try each one password a day so it doesn&#8217;t raise alarm bells for bad login attempts.  The &#8220;holy grail&#8221; for  hacker would be to get into Jdoe@aol.com itself and now can get account resets sent to themselves&#8230;and given that set of data it&#8217;s a darn good chance he&#8217;s using some sort of &#8220;password&#8221; variant for it.</p>
<p>We know single factor authentication is fundamentally insecure.  There is no doubt today it&#8217;s wholely inadequate for logging into systems you expect to trust.  So what do we do until there is universal two factor authentication schemes in place?</p>
<p>First, divide your accounts into ones you care about and ones you don&#8217;t.</p>
<p>For sites like newspaper comments or your favorite web forum use a simple password because you don&#8217;t care who knows it.  This is analagous to a simple padlock &#8212; while it doesn&#8217;t stop a determined attacker, it stops the casual attacks and that is good enough.</p>
<p>For finances, work computers, and the like&#8230;use a highly secure password.</p>
<p>How do you generate them in a way that is highly resistant to data mining efforts?</p>
<p>My criteria is you can re-create them at will from something you know (in your mind), and can even leave them sitting in plainview and still not be compromised.</p>
<p>How?</p>
<p>Let&#8217;s first think up a pattern.  That can be a standard word or phrase you use in conjunction with how you identify each resource you need to access.  Then run that compound phrase (base phrase + resource) through a hash generator</p>
<p>So in Linux, we can issue a series of commands like this:</p>
<pre style="padding-left: 30px;">$ echo mybasicpassword@www.yahoo.com |  sha256sum
9a7c3ff19da0207cae4c4c7f820d38397f672a47500795c4f56d6b45fe578603
$ echo mybasicpassword@www.d90.us | sha256sum
f4d0ccb1eb6b8e40472132cd44efc5b6b9bc976a4f951205e9e1bb96a12a1fda
$ echo mybasicpassword@bankofamerica | sha256sum
857a0d7ed6b510f7b7ab615072446552291429ba3c7ca40fe91553520b2f56a3
$ unset HISTFILE</pre>
<p>The unset HISTFILE removes the history of the commands you just typed so they&#8217;re not stored after you log off, revealing to a hacker your secret &#8220;mybasicpassword&#8221; as well as the secret way you identify the resources. What you pipe into the hash generator can change &#8212; maybe you have to reset a password quarterly and make it a habit of adding the month and year when you generated it.  The only place that pattern should be is in your head, plus maybe a note that helps you remember when you last generated it.</p>
<p>Now simply write them down&#8230;</p>
<pre style="padding-left: 30px;">yahoo         9a7c 3ff1 9da0 207c ae4c 4c7f 820d 3839 7f67 2a47 5007 95c4 f56d 6b45 fe57 8603
d90           f4d0 ccb1 eb6b 8e40 4721 32cd 44ef c5b6 b9bc 976a 4f95 1205 e9e1 bb96 a12a 1fda
bankofamerica 857a 0d7e d6b5 10f7 b7ab 6150 7244 6552 2914 29ba 3c7c a40f e915 5352 0b2f 56a3</pre>
<p>Now also pick a pattern of what part of the hash to use.  Maybe it&#8217;s the 64th, 62nd, 60th, 1st, 3rd, and 7th characters in that order, so for &#8220;bankofamerica&#8221; you&#8217;d use 36f877.</p>
<p>The nice part being is anywhere you are you can re-create the password at will, yet it&#8217;s secure from other people unless they&#8217;re intercepting unencrypted signals or torture it out of you.</p>
<p>Depending on how you make them, you may need to write a note to yourself &#8212; like the date you made the password.</p>
<p>Let&#8217;s take a slight variation on this theme for another example:</p>
<pre style="padding-left: 30px;">$ echo mybasicpassword@mybank_022709 | sha256sum
15218a3a5bed25963213e9b558f62d36dffc916dcc874ff307a37b26e62b6257</pre>
<p>So in a secure place, like a TrueCrypt encrypted volume you write a note like:</p>
<pre style="padding-left: 30px;">mybank 022709</pre>
<p>That really doesn&#8217;t reveal much at all, since you still now the algorithm (in this case &#8216;base password&#8217;@'resource&#8217;_'date&#8217;) in your head.</p>
<p>Now maybe the bank requires special letters and characters.  So on your cheat sheet you write:</p>
<pre style="padding-left: 30px;">mybank     1521 8a3a 5bed 2596 3213 e9b5 58f6 2d36 dffc 916d cc87 4ff3 07a3 7b26 e62b 6257 +A-</pre>
<p>Using the same choice in characters I stated above, you look at that and realize you&#8217;ve set your password to be 72b123A- .</p>
<p>If you&#8217;re using a system you trust you can use a tool like <a title="Password Safe" href="http://passwordsafe.sourceforge.net/" target="_blank">Password Safe</a> to keep your website passwords without having to type each one in each time.</p>
<p>Of course you *should* be using two factor authentication whenever you can.   For the times you can&#8217;t, I believe the system I laid out here is almost as strong &#8212; and most importantly prevents the breach of one or any combination of resources from exposing many other resources where you have an account.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.d90.us/toolbox/2009/02/27/passwords-and-data-mining/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NTP Configuration</title>
		<link>http://www.d90.us/toolbox/2008/01/24/ntp-configuration/</link>
		<comments>http://www.d90.us/toolbox/2008/01/24/ntp-configuration/#comments</comments>
		<pubDate>Thu, 24 Jan 2008 19:10:46 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Sysadmin Tools]]></category>

		<guid isPermaLink="false">http://www.d90.us/toolbox/2008/01/24/ntp-configuration/</guid>
		<description><![CDATA[1) Install ntpd if not already there.  Link it to your default startup directory. ln -s /etc/init.d/ntpd /etc/rc3.d/S99ntpd 2) /etc/ntp/step-tickers:  time.nist.gov  pool.ntp.org 3) In /etc/sysconfig/iptables open up the port: # NTP is only accessible via the Gig Backbone: -A RH-Firewall-1-INPUT -m state &#8211;state NEW -m udp -p udp &#8211;dport 123 -s 192.168.1.0/0 -j ACCEPT 4) [...]]]></description>
			<content:encoded><![CDATA[<p>1) Install ntpd if not already there.  Link it to your default startup directory.</p>
<blockquote><p>ln -s /etc/init.d/ntpd /etc/rc3.d/S99ntpd</p></blockquote>
<p>2) /etc/ntp/step-tickers: </p>
<blockquote><p>time.nist.gov <br />
pool.ntp.org</p></blockquote>
<p>3) In /etc/sysconfig/iptables open up the port:</p>
<blockquote><p># NTP is only accessible via the Gig Backbone:<br />
-A RH-Firewall-1-INPUT -m state &#8211;state NEW -m udp -p udp &#8211;dport 123 -s 192.168.1.0/0 -j ACCEPT</p></blockquote>
<p>4) Now (re)start iptables &amp; ntpd</p>
<p>5) On internal-only servers, install ntpd. </p>
<p>6) Set step-ticker to point to internal server.  If using hostname, verify /etc/hosts and/or  the /etc/resolv.conf is set properly to allow the hostname to resolve.</p>
<p>7) Link it to your default startup directory.</p>
<p> <img src='http://www.d90.us/toolbox/wp-includes/images/smilies/icon_cool.gif' alt='8)' class='wp-smiley' /> Start it</p>
]]></content:encoded>
			<wfw:commentRss>http://www.d90.us/toolbox/2008/01/24/ntp-configuration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

