<?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>Gittr &#187; System Admin</title>
	<atom:link href="http://www.gittr.com/index.php/archive/category/system-admin/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gittr.com</link>
	<description>eval("eval(\"eval(\\\"puts 'a ruby weblog'\\\")\")")</description>
	<lastBuildDate>Thu, 22 Oct 2009 12:54:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Deploying Sinatra via Thin and Lighttpd</title>
		<link>http://www.gittr.com/index.php/archive/deploying-sinatra-via-thin-and-lighttpd/</link>
		<comments>http://www.gittr.com/index.php/archive/deploying-sinatra-via-thin-and-lighttpd/#comments</comments>
		<pubDate>Wed, 18 Jun 2008 03:00:02 +0000</pubDate>
		<dc:creator>cschneid</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Sinatra]]></category>
		<category><![CDATA[System Admin]]></category>

		<guid isPermaLink="false">http://www.gittr.com/?p=34</guid>
		<description><![CDATA[I&#8217;ve previously written about deploying Sinatra to Dreamhost, both with FastCGI, and also Passenger (mod_rails). This howto will cover how to deploy Sinatra to a load-balanced reverse-proxy setup using Lighttpd and&#160;Thin. 1) Install Lighttpd and&#160;Thin # Figure out lighttpd yourself, it should be handled by your # linux distro's package manager &#160; # For thin: [...]]]></description>
			<content:encoded><![CDATA[<p>
I&#8217;ve previously written about deploying Sinatra to Dreamhost, both with <a href="http://www.gittr.com/index.php/archive/deploying-a-simple-sinatra-application-on-dreamhost-via-fastcgi/">FastCGI</a>, and also <a href="http://www.gittr.com/index.php/archive/deploying-rack-apps-on-dreamhost-via-passenger-including-sinatra/">Passenge</a>r (mod_rails).  This howto will cover how to deploy Sinatra to a load-balanced reverse-proxy setup using Lighttpd and&nbsp;Thin.
</p>
<p>
<strong>1) Install Lighttpd and&nbsp;Thin</strong></p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;"># Figure out lighttpd yourself, it should be handled by your </span>
<span style="color:#008000; font-style:italic;"># linux distro's package manager</span>
&nbsp;
<span style="color:#008000; font-style:italic;"># For thin:</span>
gem install thin</pre></div></div>

</p>
<p>
<strong>2) Create your rackup file</strong> - the &#8220;require &#8216;app&#8217;&#8221; line should require the actual sinatra app you have&nbsp;written.</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'sinatra'</span>
&nbsp;
<span style="color:#6666ff; font-weight:bold;">Sinatra::Application</span>.<span style="color:#9900CC;">default_options</span>.<span style="color:#9900CC;">merge</span>!<span style="color:#006600; font-weight:bold;">&#40;</span>
  <span style="color:#ff3333; font-weight:bold;">:run</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">false</span>,
  <span style="color:#ff3333; font-weight:bold;">:env</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#ff3333; font-weight:bold;">:production</span>
<span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'app'</span>
run Sinatra.<span style="color:#9900CC;">application</span></pre></div></div>

</p>
<p>
<strong>3) Setup a config.yml</strong> - change the /path/to/my/app path to reflect&nbsp;reality.</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#006600; font-weight:bold;">---</span>
    environment: production
    chdir: <span style="color:#006600; font-weight:bold;">/</span>path<span style="color:#006600; font-weight:bold;">/</span>to<span style="color:#006600; font-weight:bold;">/</span>my<span style="color:#006600; font-weight:bold;">/</span>app
    address: 127.0.0.1
    user: root
    group: root
    port: <span style="color:#006666;">4567</span>
    pid: <span style="color:#006600; font-weight:bold;">/</span>path<span style="color:#006600; font-weight:bold;">/</span>to<span style="color:#006600; font-weight:bold;">/</span>my<span style="color:#006600; font-weight:bold;">/</span>app<span style="color:#006600; font-weight:bold;">/</span>thin.<span style="color:#9900CC;">pid</span>
    rackup: <span style="color:#006600; font-weight:bold;">/</span>path<span style="color:#006600; font-weight:bold;">/</span>to<span style="color:#006600; font-weight:bold;">/</span>my<span style="color:#006600; font-weight:bold;">/</span>app<span style="color:#006600; font-weight:bold;">/</span>config.<span style="color:#9900CC;">ru</span>
    log: <span style="color:#006600; font-weight:bold;">/</span>path<span style="color:#006600; font-weight:bold;">/</span>to<span style="color:#006600; font-weight:bold;">/</span>my<span style="color:#006600; font-weight:bold;">/</span>app<span style="color:#006600; font-weight:bold;">/</span>thin.<span style="color:#9900CC;">log</span>
    max_conns: <span style="color:#006666;">1024</span>
    timeout: <span style="color:#006666;">30</span>
    max_persistent_conns: <span style="color:#006666;">512</span>
    daemonize: <span style="color:#0000FF; font-weight:bold;">true</span></pre></div></div>

</p>
<p>
<strong>4) Setup lighttpd.conf</strong> - change mydomain to reflect reality.  Also make sure the first port here matches up with the port setting in&nbsp;config.yml.</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#ff6633; font-weight:bold;">$<span class="caps">HTTP</span></span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;host&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span> =~ <span style="color:#996600;">&quot;(www<span style="color:#000099;">\.</span>)?mydomain<span style="color:#000099;">\.</span>com&quot;</span>  <span style="color:#006600; font-weight:bold;">&#123;</span>
        proxy.<span style="color:#9900CC;">balance</span> = <span style="color:#996600;">&quot;fair&quot;</span>
        proxy.<span style="color:#9900CC;">server</span> =  <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;/&quot;</span> <span style="color:#006600; font-weight:bold;">=&gt;</span>
                                <span style="color:#006600; font-weight:bold;">&#40;</span>
                                        <span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#996600;">&quot;host&quot;</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;127.0.0.1&quot;</span>, <span style="color:#996600;">&quot;port&quot;</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006666;">4567</span> <span style="color:#006600; font-weight:bold;">&#41;</span>,
                                        <span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#996600;">&quot;host&quot;</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;127.0.0.1&quot;</span>, <span style="color:#996600;">&quot;port&quot;</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006666;">4568</span> <span style="color:#006600; font-weight:bold;">&#41;</span>
                                <span style="color:#006600; font-weight:bold;">&#41;</span>
                        <span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#006600; font-weight:bold;">&#125;</span></pre></div></div>

</p>
<p>
<strong>5) Start thin and your application </strong>. I have a rake script so I can just call &#8220;rake start&#8221; rather than typing this in.  It&#8217;s just a few lines to do&nbsp;that.</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">thin <span style="color:#006600; font-weight:bold;">-</span>s <span style="color:#006666;">2</span> <span style="color:#006600; font-weight:bold;">-</span>C config.<span style="color:#9900CC;">yml</span> <span style="color:#006600; font-weight:bold;">-</span>R config.<span style="color:#9900CC;">ru</span> start</pre></div></div>

</p>
<p><strong>Go to mydomain.com/ and see the result!</strong> Everything should be setup now, check it out at the domain you setup in your lighttpd.conf&nbsp;file.</p>
<p>
<strong>Variations - nginx</strong> - I haven&#8217;t looked into the config file syntax, but there isn&#8217;t any reason that this exact same approach wouldn&#8217;t work with nginx.  Thin and the rackup file stay the same, while the nginx layer has to be configured to reverse proxy to the thin&nbsp;install.</p>
<p>
<strong>Variations - More Thin instances</strong> - To add more thin instances, change the -s 2 parameter on the thin start command to be how ever many servers you want.  Then be sure lighttpd proxies to all of them by adding more lines to the proxy statements.  Then restart lighttpd and you&#8217;re&nbsp;done.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gittr.com/index.php/archive/deploying-sinatra-via-thin-and-lighttpd/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Deploying Rack Apps on Dreamhost via Passenger (including Sinatra)</title>
		<link>http://www.gittr.com/index.php/archive/deploying-rack-apps-on-dreamhost-via-passenger-including-sinatra/</link>
		<comments>http://www.gittr.com/index.php/archive/deploying-rack-apps-on-dreamhost-via-passenger-including-sinatra/#comments</comments>
		<pubDate>Sun, 08 Jun 2008 20:13:25 +0000</pubDate>
		<dc:creator>cschneid</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Sinatra]]></category>
		<category><![CDATA[System Admin]]></category>

		<guid isPermaLink="false">http://www.gittr.com/?p=29</guid>
		<description><![CDATA[I don&#8217;t like deployment via FastCGI that much. It&#8217;s just too unstable, and random for my tastes. So when I saw that Passenger was going to support Rack, I knew I had to get that working on&#160;Dreamhost. Once I started going at it, it only took me a few minutes to make everything work. You [...]]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t like <a href="http://www.gittr.com/index.php/archive/deploying-a-simple-sinatra-application-on-dreamhost-via-fastcgi/">deployment via FastCGI</a> that much.  It&#8217;s just too unstable, and random for my tastes.  So when I saw that Passenger was going to <a href="http://www.gittr.com/index.php/archive/passenger-mod_rails-supports-rack-now/">support Rack</a>, I knew I had to get that working on&nbsp;Dreamhost.</p>
<p>Once I started going at it, it only took me a few minutes to make everything work.  You can find <a href="http://github.com/FooBarWidget/passenger/tree/master/doc/Users%20guide.txt">documentation</a> at the Passenger Github&nbsp;repository.</p>
<p><strong>Steps:</strong></p>
<ol>
<li>Setup your account to support&nbsp;mod_rails</li>
<li>Create the directory&nbsp;structure</li>
<li>Make a rackup file&nbsp;(config.ru)</li>
<li>Create a very simple Sinatra&nbsp;application</li>
</ol>
<p><strong>1) Setting up the&nbsp;account</strong></p>
<ul>
<li>Domains -> Manage Domains -> Edit (web hosting&nbsp;column)</li>
<li>Enable &#8220;Ruby on Rails Passenger&nbsp;(mod_rails)&#8221;</li>
<li>Add the public directory to the web directory box.  So if you were using &#8220;gittr.com&#8221;, it would change to&nbsp;&#8220;gittr.com/public&#8221;</li>
<li>Save your&nbsp;changes</li>
</ul>
<p><strong>2) Creating the directory&nbsp;structure</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">domain.com<span style="color: #000000; font-weight: bold;">/</span>
domain.com<span style="color: #000000; font-weight: bold;">/</span>tmp
domain.com<span style="color: #000000; font-weight: bold;">/</span>public
<span style="color: #666666; font-style: italic;"># a vendored version of sinatra - not necessary if you use the gem</span>
domain.com<span style="color: #000000; font-weight: bold;">/</span>sinatra</pre></div></div>

<p><strong>3) Creating a rackup&nbsp;file</strong></p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;"># This file goes in domain.com/config.ru</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'sinatra/lib/sinatra.rb'</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'rubygems'</span>
&nbsp;
<span style="color:#6666ff; font-weight:bold;">Sinatra::Application</span>.<span style="color:#9900CC;">default_options</span>.<span style="color:#9900CC;">merge</span>!<span style="color:#006600; font-weight:bold;">&#40;</span>
  <span style="color:#ff3333; font-weight:bold;">:run</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">false</span>,
  <span style="color:#ff3333; font-weight:bold;">:env</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#ff3333; font-weight:bold;">:production</span>
<span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'test.rb'</span>
run Sinatra.<span style="color:#9900CC;">application</span></pre></div></div>

<p><strong>4) A very simple Sinatra&nbsp;application</strong></p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;"># this is test.rb referred to above</span>
get <span style="color:#996600;">'/'</span> <span style="color:#9966CC; font-weight:bold;">do</span>
        <span style="color:#996600;">&quot;Worked on dreamhost&quot;</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
get <span style="color:#996600;">'/foo/:bar'</span> <span style="color:#9966CC; font-weight:bold;">do</span>
        <span style="color:#996600;">&quot;You asked for foo/#{params[:bar]}&quot;</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p><strong>And that&#8217;s all there is to it!</strong>  Once it&#8217;s all setup, point your browser at your domain, and you should see a &#8220;Worked on Dreamhost&#8221; page.  To restart the application after making changes, you need to run &#8220;touch&nbsp;tmp/restart.txt&#8221;.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gittr.com/index.php/archive/deploying-rack-apps-on-dreamhost-via-passenger-including-sinatra/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Alternative Consoles for Vista 64</title>
		<link>http://www.gittr.com/index.php/archive/alternative-consoles-for-vista-64/</link>
		<comments>http://www.gittr.com/index.php/archive/alternative-consoles-for-vista-64/#comments</comments>
		<pubDate>Sat, 03 May 2008 19:47:13 +0000</pubDate>
		<dc:creator>cschneid</dc:creator>
				<category><![CDATA[System Admin]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.gittr.com/?p=8</guid>
		<description><![CDATA[I hate cmd.exe. Not the shell itself, it&#8217;s not that horrible (although nowhere near what bash is), but the tiny un-resizeable window is horrible. The rectangular copy&#8230;&#160;wtf. So there seem to be a few options for alternative consoles, but of course, Vista 64 sucks hard enough in the compatability area that there isn&#8217;t a single [...]]]></description>
			<content:encoded><![CDATA[<p>I hate cmd.exe.  Not the shell itself, it&#8217;s not that horrible (although nowhere near what bash is), but the tiny un-resizeable window is horrible.  The rectangular copy&#8230;&nbsp;wtf.</p>
<p>So there seem to be a few options for alternative consoles, but of course, Vista 64 sucks hard enough in the compatability area that there isn&#8217;t a single good&nbsp;solution.</p>
<p><a href="http://sourceforge.net/projects/console/"><strong>Console2</strong></a> -The error case on this one is weird.  It starts the internal shell up just fine, but due to a Vista drawing issue, it doesn&#8217;t actually draw text to the screen.  The bug (feature?) is limited to 64 bit versions of windows, and looks like it hits <span class="caps">XP64</span> as well.  Either way, if you can&#8217;t see what you&#8217;re typing, or the response, the terminal isn&#8217;t very&nbsp;useful.</p>
<p><a href="http://code.google.com/p/puttycyg/"><strong>PuttyCyg</strong> </a>- again, doesn&#8217;t work on Vista 64.  I went into it a while back, and it just couldn&#8217;t hook up to the cygwin install I had (default everything&#8230;).  Never did get much more in depth than&nbsp;that.</p>
<p><a href="http://en.poderosa.org/"><strong>Ponderosa</strong> </a>- Hey, something that works!  Nice tabbed interface, and runs the cygwin shell just fine.  Downsides: doesn&#8217;t run the cmd.exe shell by default (you can run cygwin&#8217;s bash shell, then type &#8220;cmd.exe&#8221; and it&#8217;ll run&nbsp;it).</p>
<p>So now I have a working shell window in Windows that doesn&#8217;t suck.&nbsp;Woot.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gittr.com/index.php/archive/alternative-consoles-for-vista-64/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up PECL-APC on Lighttpd and Gentoo</title>
		<link>http://www.gittr.com/index.php/archive/setting-up-pecl-apc-on-lighttpd-and-gentoo/</link>
		<comments>http://www.gittr.com/index.php/archive/setting-up-pecl-apc-on-lighttpd-and-gentoo/#comments</comments>
		<pubDate>Wed, 30 Apr 2008 01:59:44 +0000</pubDate>
		<dc:creator>cschneid</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[System Admin]]></category>

		<guid isPermaLink="false">http://www.gittr.com/?p=7</guid>
		<description><![CDATA[Since I&#8217;m using Slicehost for my VPS hosting, and I&#8217;m cheap, I only have 256 megs of ram to work with. I run lighttpd, which then forces me to use php-cgi (via fastcgi) as the php executable. All of this is then running on&#160;Gentoo. Anyway, what I&#8217;m getting to is how to setup PECL-APC (php [...]]]></description>
			<content:encoded><![CDATA[<p>Since I&#8217;m using <a href="http://www.slicehost.com" target="_self">Slicehost</a> for my <span class="caps">VPS</span> hosting, and I&#8217;m cheap, I only have 256 megs of ram to work with.  I run lighttpd, which then forces me to use php-cgi (via fastcgi) as the php executable.  All of this is then running on&nbsp;Gentoo.</p>
<p>Anyway, what I&#8217;m getting to is how to setup <span class="caps">PECL</span>-<span class="caps">APC</span> (php accelerator / bytecode cache) on this&nbsp;platform.</p>
<p>Turns out all the scary messages in FAQs saying <span class="caps">APC</span> doesn&#8217;t work with <span class="caps">CGI</span> interfaces don&#8217;t apply to the fast-cgi implementation that Lighttpd uses.<br />
<code lang="sh"><br />
emerge -uDv php5/pecl-apc<br />
</code></p>
<p>And then you&#8217;re&nbsp;done.</p>
<p>Hopefully my rambling was enough to get you going.  To tweak, go check out&nbsp;/etc/php/php5-cgi/ext/apc.ini</p>
<p>Also, to verify this whole thing, you need a phpinfo() page&#8230;&nbsp;like:</p>
<p><code lang="php"><br />
&lt;?php phpinfo(); ?&gt;<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gittr.com/index.php/archive/setting-up-pecl-apc-on-lighttpd-and-gentoo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

