<?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>Discourse</title>
	<atom:link href="http://blog.discourse.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.discourse.org</link>
	<description></description>
	<lastBuildDate>Wed, 22 May 2013 19:51:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Your Online Clubhouse</title>
		<link>http://blog.discourse.org/2013/05/your-online-clubhouse/</link>
		<comments>http://blog.discourse.org/2013/05/your-online-clubhouse/#comments</comments>
		<pubDate>Mon, 20 May 2013 20:26:02 +0000</pubDate>
		<dc:creator>Jeff Atwood</dc:creator>
				<category><![CDATA[culture]]></category>

		<guid isPermaLink="false">http://blog.discourse.org/?p=940</guid>
		<description><![CDATA[I&#8217;ve gotten in the habit of explaining Discourse to people as a clubhouse. A place on the Internet that belongs exclusively to you and your friends &#8212; whether you have 10 friends or a few hundred thousand. There&#8217;s a big difference between a Facebook Group and having your own clubhouse. [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve gotten in the habit of explaining Discourse to people as a <b>clubhouse</b>. A place on the Internet that belongs exclusively to you and your friends &#8212; whether you have 10 friends or a few hundred thousand.</p>
<p>There&#8217;s a big difference between a Facebook Group and having your own clubhouse. <b>A Facebook Group is like the Teen Paranormal Romance section of Barnes &#038; Noble.</b> It&#8217;s just a specialty area within Facebook that ultimately belongs to Facebook.</p>
<p><img src="http://blog.discourse.org/wp-uploads/2013/05/teen-paranormal-romance.jpg" alt="" title="teen-paranormal-romance" width="700" height="465"  /></p>
<p>A Facebook Group doesn&#8217;t really belong <i>to you</i>. It belongs to the store it is a part of, and you can visit all you like during business hours as long as you don&#8217;t disturb the other customers, and maybe buy something every once in a while.</p>
<p>But when you build your own space with forum software, it truly <i>does</i> belong to you. You get your clubhouse, built exactly the way you and your friends wanted, with whatever rules and norms your community deems appropriate.</p>
<p><img src="http://blog.discourse.org/wp-uploads/2013/05/bongos-dream-house.png" alt="" title="bongos-dream-house" width="700" height="703" /></p>
<p>I was fascinated to read exactly this metaphor in <a href="http://mehan.info/">Mehan Jayasuriya&#8217;s</a> NYU master&#8217;s thesis <a href="http://blog.mehanjayasuriya.com/itp_thesis.pdf">Online, Underground: The Untold Story of the Original Social Media Revolution</a> (pdf).</p>
<blockquote><p>
I came  of  age in  Racine, Wisconsin,  a rust-belt town  of  roughly 70,000  people  that had once  been  a regional  manufacturing hub.  By  the time  I was a teenager, in  the late  1990s,  the town  had fallen  on  hard  times,  its downtown  filled  with  empty storefronts and boarded-up  windows.  Like  most  American  teenagers who grow  up  outside of  major urban areas,  my  friends and I spent our free  time  bored out of  our skulls, aimlessly wandering a landscape that  had little  to  offer us  in  the way of  culture.</p>
<p>That  all changed when  we  discovered  punk  rock, an  art form  that  seemed  to  give  voice to  our suburban  frustration,  angst and boredom.  It  helped  that  punk  culture was accessible  to  us  in  nearly  every way:  the music was easy  to  play, the CDs were  affordably  priced  (unlike the major-label releases  sold  at  the local mall),  the shows were inclusive and cheap to  attend. Soon, we  were  playing in  punk  bands,  buying  records via mail  order and sneaking  out to  attend  shows.  There was just  one problem:  in  order to  do  most  of  this, we  had to  drive to  Milwaukee,  the closest midsize city. Live  music,  to the extent  that  it  could be  said  to  exist in  Racine, was the  exclusive domain  of  adults, something that  happened  in  the back  rooms of  a handful of  dank  bars. Why couldn’t  we  have  an  all-ages  arts  space in  Racine, one that  could serve as  the locus of  our budding punk  community?</p>
<p>There were, of  course, a number  of  reasons why such  a thing didn’t  exist.  Luckily,  being teenagers,  none  of  us  had the good  sense to  assess  the practicality  of  our idea. Soon, a couple  of  enterprising  friends had pooled  together  a few hundred dollars and found a landlord  willing to  rent  a vacant  downtown  storefront  to  a group of  minors. The Tokyo-A-Go-Go was born.</p>
<p>I can still recall  the shared  sense of  excitement  we  felt  once  the bare-bones  space &#8212; essentially,  a concrete-walled room  outfitted with  a cheap PA  system &#8212; was up  and running.  Racine  bands finally had a place to  play  in  their own hometown  and local kids  finally had a place to  hang  out,  hand  out flyers  and political tracts  and discuss the unimportant matters of  the day.  Best  of  all,  it  was a space that  members of  our community had built without any outside help  and subsequently, one where we  all felt  a collective  sense of  ownership.  The venue’s coronation  came  when  some  touring bands from  out of  state scheduled a stop  in  Racine  to  play  at  the venue.  Surely, this  was a sign  that  we  had built something of  lasting value.</p>
<p>Of  course, we  hadn’t. As  you might already have  guessed,  the Tokyo-A-Go-Go didn’t  last  very  long. If  I remember  correctly,  it  was gone  in  a matter  of  weeks.  To  this  day,  there are conflicting reports about what  finally did in  the venue.  Some  say that  a building  inspector showed  up  and demanded  that  the place be  shut  down immediately.  Others  pinpoint  the night that  a kid accidentally  pushed  a friend  through the room’s  front window  as  the moment  the experiment  ended (despite  their initial fundraising success,  the kids  who ran the club  were, apparently, unable  to  raise enough  money to  repair  the window).  </p>
<p>Whatever  the reason  for its demise, the Tokyo-A-Go-Go taught  us  all a valuable  lesson. If  the cost  of  building  something is  low enough  and the benefits  of  building  it  are great enough, you can simply  build it  yourself. This  is, of  course, the equation  that  so  many  bored kids  who came  before  had arrived at, the “do it  yourself” or  “DIY” ethos on  which punk  culture was built.  It  doesn’t matter  how small or  how niche your  community is — if that  community wants its own space badly enough, it  will  find  a way build it. Of  course, this  is  easier  done  in  places  like  Racine, Wisconsin where the transaction costs of  setting up  shop  are low and the benefits, in  providing a home  to  a community that  lacks one,  are high.</p>
<p>I was reminded  of  this  lesson  a few years later when  I started spending  a lot of  time  on  online  messageboards.  This  was the early 2000s,  when  it  was becoming  increasingly  easy  to  find  vibrant online  communities dedicated to  seemingly any topic.  Such  messageboards provided  me  with  virtual spaces  not unlike  the Tokyo-AGo-Go, places where like-minded people  would congregate  to  discuss shared interests.  However,  unlike  the Tokyo-A-Go-Go,  messageboards allowed me  to  connect with  people  in  other small towns or  even  big cities, to  gauge what  was considered  cool  in  other parts of  the country or  world,  to  feel  as  if  I was a part  of  a much  larger  community.  It  was like  stepping  into  a stadium-sized version of  the Tokyo-A-Go-Go,  one that  was populated by  people  from  all around  the globe.
</p></blockquote>
<p>I honestly go in expecting the worst from a lot of dry, academic studies but this one is unusually genuine and heartfelt. If you liked the above excerpt, <a href="http://blog.mehanjayasuriya.com/itp_thesis.pdf">download the PDF</a> and give it a deeper read.</p>
<p>Mehan&#8217;s history of the online messageboard captures a lot of what I love about the Discourse project, and underscores our effort to ensure that these amazing communities have <b>great 100% free open source forum software to rely on</b> &#8212; now and forever.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.discourse.org/2013/05/your-online-clubhouse/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Discourse Servers</title>
		<link>http://blog.discourse.org/2013/04/the-discourse-servers/</link>
		<comments>http://blog.discourse.org/2013/04/the-discourse-servers/#comments</comments>
		<pubDate>Mon, 15 Apr 2013 18:55:33 +0000</pubDate>
		<dc:creator>Jeff Atwood</dc:creator>
				<category><![CDATA[hardware]]></category>

		<guid isPermaLink="false">http://blog.discourse.org/?p=868</guid>
		<description><![CDATA[When we moved to our new datacenter, I didn&#8217;t elaborate on exactly what sort of hardware we have in the rack. But now I will. There are six servers here, all variously numbered Tie Fighters &#8212; derived from our internal code name for the project while it was a secret [...]]]></description>
			<content:encoded><![CDATA[<p>When we <a href="http://blog.discourse.org/2013/03/discourse-outage-thursday-march-14th-2013/">moved to our new datacenter</a>, I didn&#8217;t elaborate on exactly what sort of hardware we have in the rack. But now I will.</p>
<p><img src="http://blog.discourse.org/wp-uploads/2013/04/discourse-server-hardware-racked1.jpg" alt="" title="discourse-server-hardware-racked" width="500" height="439" /></p>
<p>There are six servers here, all variously numbered Tie Fighters &#8212; derived from <a href="http://www.codinghorror.com/blog/2013/02/civilized-discourse-construction-kit.html">our internal code name for the project</a> while it was a secret throughout 2012. As you read below, bear in mind that most of the work in hosting <a href="http://www.discourse.org">www.discourse.org</a> is carried out by Tie Fighters 2, 3, 4 and 5.</p>
<h2>Tie Fighter 1</h2>
<p><img src="http://blog.discourse.org/wp-uploads/2013/04/discourse-tie-fighter-1.jpg" alt="" title="discourse-tie-fighter-1" width="648" height="405"  /></p>
<p>This is a <i>very</i> beefy server that we bought first with the idea that we&#8217;d do a lot of virtualization on one large, expensive, many-core server.  </p>
<ul>
<li>Intel Xeon E5-2680 2.7 GHz / <b>3.5 GHz 8-core</b> turbo</li>
<li><b>128 GB</b> DDR3 1333MHz ECC Reg (8 x 16GB)</li>
<li>2 &times; Intel <b>710 Series 100 GB SSD</b> in RAID 1</li>
<li>6 &times; Seagate Constellation 1 TB 2.5&#8243; HDD in RAID 10</li>
<li>LSI 3Ware 9750 8i SAS RAID Controller</li>
</ul>
<p>Specs:</p>
<ul>
<li>8 x 2.5&#8243; hot-swap drive bays</li>
<li>Dual gigabit ethernet</li>
<li>Integrated IPMI 2.0 ethernet</li>
<li>330W gold efficiency power supply</li>
<li>SuperMicro X9SRE-3F mobo</li>
<li>SuperMicro 1017R-MTF case</li>
</ul>
<p>We didn&#8217;t build this one, but purchased it from <a href="http://www.pogolinux.com/">PogoLinux</a> where it is known as the Iris 1168.</p>
<h2>Tie Fighter 2, 3, 4, 5</h2>
<p><img src="http://blog.discourse.org/wp-uploads/2013/04/discourse-tie-fighter-2-3-4-5.jpg" alt="" title="discourse-tie-fighter-2-3-4-5" width="600" height="408" /></p>
<p>Turns out that Ruby is &hellip; kind of hard to virtualize effectively, so we ended up abandoning that big iron strategy and going with lots of cheaper, smaller, faster boxes running on bare metal. Hence these:</p>
<ul>
<li>Intel Xeon E3-1280 V2 Ivy Bridge 3.6 Ghz / <b>4.0 Ghz quad-core</b> turbo</li>
<li><b>32 GB</b> DDR3 1600MHz ECC Reg (4 x 8 GB)</li>
<li>2 &times; <b>Samsung 830 512 GB SSD</b> in software mirror</li>
</ul>
<p>Specs:</p>
<ul>
<li>4 x 2.5&#8243; hot-swap drive bays</li>
<li>Dual gigabit ethernet</li>
<li>Integrated IPMI 2.0 ethernet</li>
<li>330W gold efficiency power supply</li>
<li>SuperMicro X9SCM-F-O mobo</li>
<li>SuperMicro CSE-111TQ-563CB case</li>
</ul>
<p>I built these four, which I documented in <a href="http://www.codinghorror.com/blog/2012/10/building-servers-for-fun-and-prof-ok-maybe-just-for-fun.html">Building Servers for Fun and Prof&#8230; OK, Maybe Just for Fun</a>. It&#8217;s not difficult, but it is a good idea to amortize the build effort across <i>several</i> servers so you get a decent return for your hours invested.</p>
<h2>Tie Fighter 10 and 11</h2>
<p><img src="http://blog.discourse.org/wp-uploads/2013/04/discourse-twin-routing-server.jpg" alt="" title="discourse-twin-routing-server" width="600" height="459"  /></p>
<p>Finally, we realized that we needed a special routing server to handle HAProxy routing duties. Redundancy is <i>essential</i> for a router, because if this thing goes down, nothing will be accessible. So we looked into a &#8220;twin&#8221; server that has two complete servers inside sharing one power supply. Each one has the following specs:</p>
<ul>
<li>Intel Xeon E5606 <b>2.13 GHz quad-core</b></li>
<li><b>6 GB</b> DDR3 1333 MHz ECC Reg (3 x 2 GB)</li>
<li>2 &times; <b>Intel 520 60 GB SSD</b> in software mirror</li>
</ul>
<p>Specs:</p>
<ul>
<li>2 x 3.5&#8243; hot-swap drive bays</li>
<li>Dual gigabit ethernet</li>
<li>Integrated IPMI 2.0 ethernet</li>
<li>1200W gold efficiency power supply (shared)</li>
<li>SuperMicro X8DTT motherboard</li>
<li>SuperMicro 808T-1200B twin case</li>
</ul>
<p>We didn&#8217;t build this one either, we also purchased it from <a href="http://www.pogolinux.com/">PogoLinux</a> where it is known as the Iris 1125.</p>
<h3>What about redundancy?</h3>
<p>We have good live redundancy with Tie 1 &#8211; 5; losing Tie 3 wouldn&#8217;t even be noticed from the outside. The most common failure points for servers are hard drives and PSUs, so just in case, we also keep the following &#8220;cold spare&#8221; parts on hand, sitting on a shelf at the bottom of the rack:</p>
<p><img src="http://blog.discourse.org/wp-uploads/2013/04/discourse-rack-cold-spare-parts.jpg" alt="" title="discourse-rack-cold-spare-parts" width="600" height="314" class="alignnone size-full wp-image-897" /></p>
<ul>
<li>Intel 710 100 GB SSD spare for Tie 1
<li>Seagate Constellation 1 TB 2.5&#8243; spare for Tie 1
<li>Samsung 830 512 GB SSD spare for Tie 2 &#8211; 5
<li>Intel 520 60 GB SSD spare for Tie 10 + 11
<li>SuperMicro 1200W spare PSU for Tie 10 + 11
<li>SuperMicro 330W spare PSU for Tie 1 &#8211; 5
</ul>
<p>It&#8217;s OK for the routing servers to be different, since they are almost fixed function devices, but if I could go back and do it over again, I&#8217;d spend the money we paid for Tie 1 on three more servers like Tie 2 &#8211; 5 instead. The performance would be better, and the greater consistency between servers would simplify things.</p>
<h3>Networking</h3>
<p>We use an <a href="http://www.amazon.com/dp/B00387G6R8/?tag=codihorr-20">Asus RT-N16</a> router (with WiFi disabled and antennas detached) flashed with TomatoUSB as an inexpensive, open source OpenVPN access box to all the IPMI KVM-over-Internet dedicated ethernet management ports on each server. <a href="http://www.servethehome.com/supermicro-ipmiview-review-remote-server-monitoring-management-ipmi-20-kvm-over-ip/">IPMI 2.0 really works!</a></p>
<p>The networking duties are handled by two rack mounted <a href="http://www.amazon.com/dp/B00358MP02/?tag=codihorr-20">NetGear GS724T-300 ProSafe 24-port gigabit ethernet smart switches</a>. One is simply standing by in the rack as a hot spare, because if the switch fails, we&#8217;d really be screwed.</p>
<h3>But&hellip; is it <i>webscale?</i></h3>
<p>During our launch peak loads, the servers were barely awake. <b>We are ridiculously overprovisioned at the moment</b>, and I do mean <i>ridiculously</i>. But that&#8217;s OK, because <a href="http://www.codinghorror.com/blog/2008/12/hardware-is-cheap-programmers-are-expensive.html">hardware is cheap, and programmers are expensive</a>. We have plenty of room to scale for our partners and the eventual <a href="http://www.discourse.org/buy/">hosting service we plan to offer</a>. If we do need to add more Tie Fighters, we still have a ton of space in the full rack, and ample power available at 15 amps. These servers are all Sandy and Ivy Bridge CPUs, so all quite efficient &#8212; the whole rack uses between 3 and 4 amps in typical daily work.</p>
<p>As for software, we&#8217;re still hashing out the exact configuration details, but I&#8217;ll be sure to post a future blog entry about that too. I can tell you that all our servers run <a href="http://releases.ubuntu.com/precise/">Ubuntu Server 12.04 LTS</a>, and it&#8217;s working great for us!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.discourse.org/2013/04/the-discourse-servers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Discourse as Your First Rails App</title>
		<link>http://blog.discourse.org/2013/04/discourse-as-your-first-rails-app/</link>
		<comments>http://blog.discourse.org/2013/04/discourse-as-your-first-rails-app/#comments</comments>
		<pubDate>Tue, 09 Apr 2013 23:07:53 +0000</pubDate>
		<dc:creator>Shawn Holmes</dc:creator>
				<category><![CDATA[coding]]></category>

		<guid isPermaLink="false">http://blog.discourse.org/?p=741</guid>
		<description><![CDATA[If you’re a developer, but have never touched Ruby on Rails, we understand how you feel. We were there once! Sometimes diving into a new language and codebase can make you feel like this: Discourse has a great, supportive community on GitHub and meta.discourse, and we’re here to help. This [...]]]></description>
			<content:encoded><![CDATA[<p>If you’re a developer, but have never touched Ruby on Rails, we understand how you feel. We were there once! Sometimes diving into a new language and codebase can make you feel like this:</p>
<p><img src="http://blog.discourse.org/wp-uploads/2013/04/cat-enters-bathtub.gif" alt="" width="322" height="281" /></p>
<p>Discourse has a great, supportive community <a href="http://github.com/discourse/discourse">on GitHub</a> and <a href="http://meta.discourse.org">meta.discourse</a>, and we’re here to help. This is our first guide to setting up a local Ruby on Rails environment, custom tailored to begin dabbling in Discourse.</p>
<h2>Step 1: VirtualBox</h2>
<p><img src="http://blog.discourse.org/wp-uploads/2013/04/virtualbox-discourse3.png" alt="" title="virtualbox-discourse" width="530" height="285"  /></p>
<p>For those who don’t do it on a regular basis, It can be intimidating to set up a *nix flavored environment. For us, the path of least resistance lies in the safety of a Virtual Machine, a doorway into an entirely different operating system. We recommend <a href="https://www.virtualbox.org/">VirtualBox</a>. It’s free, open source, and runs on Windows, Linux, Mac and Solaris. Download a copy from the VirtualBox site here:</p>
<p><a href="http://www.virtualbox.org/wiki/Downloads">www.virtualbox.org/wiki/Downloads</a></p>
<p>As of this writing, <strong>4.2.10</strong> is the latest and works for us. After you’ve downloaded and installed it, there are a couple of things to know which will help your VM’s performance.</p>
<ol>
<li>
<p><strong>Use a Solid State Drive (SSD)</strong>. A VM emulates an entire system. There’s a performance cost to this emulation, a little in CPU and memory, but mostly in disk I/O. You can get big improvements in VM speeds by moving from traditional disks to a solid state drive.</p>
</li>
<li>
<p><strong>Have two drives</strong>. If you install VirtualBox to run from your primary drive, and you run a VM that also resides on that primary drive, they&#8217;re going to fight for hard drive resources. The more your primary disk is tied up, contending between the management of resources necessary to run VirtualBox and the emulated resources inside the VM, the slower your performance is going to be. If you can, <span style="background-color: #fffbcc">try keeping your working directory (of Discourse and the VM) off of the primary disk</span>. In a perfect world, your secondary disk would also be a SSD!</p>
</li>
<li><strong>Increase the VM memory</strong>. The VM image we set up defaults to 1 GB of memory, which makes it friendly to run on 4 GB machines. But this is the practical <i>minimum</i> &#8212; performance will be a lot better if you can ramp the VM memory up to 2 GB or even 4 GB. To do so, change your system&#8217;s <code>DISCOURSE_VM_MEM</code> environment variable to the desired amount of memory.</li>
</ol>
<p>Also, we recommend a development machine with about <strong>8 GB</strong> of physical memory. VMs are hungry and eat ram like Hippos eat marbles.</p>
<h2>Step 2: Vagrant</h2>
<p>With VirtualBox installed, it’s now time to bring a VM to life. Discourse maintains all the information necessary to wire up a VM within the Discourse codebase itself!</p>
<p>It does this through the magic of <a href="http://www.vagrantup.com/">Vagrant</a>, another free open-source tool which is used to both package and initialize a VM with all the necessary configurations in place. Thanks to Vagrant, there’s no need to figure out if you have the correct version of Ruby, or if Rails is up-to-date, or even how to install nginx, thin, or any of the other bits and pieces that make up Discourse.</p>
<p>It’s all in Vagrant, stored within the Vagrantfile, and comes up with with the ease of a single command line. For the purposes of working with Discourse, you’ll need <strong>Vagrant 1.1.2 or higher</strong>. Download it from the Vagrant download page:</p>
<p><a href="http://downloads.vagrantup.com/">downloads.vagrantup.com</a></p>
<p>Install should be self-explanatory. Go ahead and do that now. We’ll wait.</p>
<h2>Step 3: Git</h2>
<p><img src="http://blog.discourse.org/wp-uploads/2013/04/discourse-github-for-windows.png" alt="" width="800" height="478" /></p>
<p>Source control is vital, not only as a means of tracking changes and protecting yourself from change, but also perhaps more importantly as a way to make collaboration and contribution easy.</p>
<p>First timers to Git can find it is a bit intimidating, even if you have previous experience with Subversion et al. If you want the easiest experience to start, we recommend the official GitHub clients:</p>
<ul>
<li><a href="http://windows.github.com/">GitHub for Windows</a></li>
<li><a href="http://mac.github.com/">GitHub for Mac</a></li>
</ul>
<p>Once installed, head to the <a href="https://github.com/discourse/discourse">Discourse repository on GitHub</a> and click the <strong>Clone in Windows / Mac</strong> button:</p>
<p><img src="http://blog.discourse.org/wp-uploads/2013/04/github-clone-button1.png" alt="" title="github-clone-button" width="601" height="370" /></p>
<p>This will pull a copy of the repo down to your machine, and your GitHub tool will load it into its local repositories. Clicking on the “repositories” section on the left, under “local” will take you to all your cloned repos. To peek inside the repo, click the blue arrow, just to the right of the thumbtack:</p>
<p><img src="http://blog.discourse.org/wp-uploads/2013/04/github-for-windows-project-arrow.png" alt="" title="github-for-windows-project-arrow" width="636" height="223" /></p>
<p>The complexities of Git will need an entirely new blog post, so we’ll leave that to the experts. For now, three tips:</p>
<ol>
<li>
<p>If possible, <span style="background-color: #fffbcc">set up your working folder on a disk other than where you installed VirtualBox</span>. Do this through the <strong>tools</strong> option along the top of the GitHub application (look for the gear icon in the screenshot above).</p>
</li>
<li>Hover over the repo to see the current working folder for the project:
<p><img src="http://blog.discourse.org/wp-uploads/2013/04/github-for-windows-project-path1.png" alt="" title="github-for-windows-project-path" width="393" height="159"  /><br/></p>
</li>
<li>To open a command shell in the project, right click the project and select <b>open a shell here</b>, or use the project tools (gear icon) menu again.
</li>
</ol>
<p>Keep those last two points in mind, because you’ll need them for the next section!</p>
<p>Now that you have cloned the Discourse project locally, you also have our official Vagrant configuration along with it. This will drive the VM in VirtualBox. Let’s put all the pieces of this puzzle together, shall we?</p>
<h2>Step 4: Running the VM and Connecting to It</h2>
<p>Using the GitHub for Windows or Mac tools (gear) menu for the project, select <strong>open a shell here</strong>.</p>
<p><img src="http://blog.discourse.org/wp-uploads/2013/04/github-for-windows-open-shell-here1.png" alt="" title="github-for-windows-open-shell-here" width="637" height="225" /></p>
<p>This will give you a command prompt at the current project folder. From there, type:</p>
<pre>vagrant up</pre>
<p>This will kick the VM into motion. Vagrant will connect to the official Discourse site, download the VM image we&#8217;ve prepared (note: this may take a while), extract it, and enable all the subsystems necessary to bring the environment to life. <strong>VirtualBox may prompt you a few times</strong>, so go ahead and accept its requests.</p>
<p>Once the VM is up, you’ll be back at the command prompt.</p>
<p><img src="http://blog.discourse.org/wp-uploads/2013/04/discourse-vagrant-up-results1.png" alt="" title="discourse-vagrant-up-results" width="660" height="420"  /></p>
<p>Now, it’s time to connect to the VM and start up the Rails server. From the shell you already have open in the project folder, type:</p>
<pre>vagrant ssh</pre>
<p><img src="http://blog.discourse.org/wp-uploads/2013/04/vagrant-ssh.png" alt="" title="vagrant-ssh" width="611" height="168" /></p>
<p>Once inside, a few more commands is all it will take. Change to the vagrant directory:</p>
<pre>cd /vagrant</pre>
<p>Now it’s time to interact with Ruby on Rails. Invoke the Rails installer, like so:</p>
<pre>bundle install</pre>
<p>Next, tell Ruby on Rails to migrate the development database schema into your local repo. We do this via rake, which is Ruby’s version of make, boasting Ant-like features.</p>
<pre>bundle exec rake db:migrate</pre>
<p>At long last, it’s time to bring up the Rails server, ready to accept HTTP requests.</p>
<pre>bundle exec rails s</pre>
<p>Our VM config causes this Rails server to begin listening for requests on port 4000. So once the server is up, open up a web browser on your local workstation and navigate to <strong>http://localhost:4000</strong></p>
<p><img src="http://blog.discourse.org/wp-uploads/2013/04/discourse-vagrant-running.png" alt="" title="discourse-vagrant-running" width="684" height="488" class="alignnone size-full wp-image-855" /></p>
<p>Voila! As you can see in the screenshot above, Discourse is indeed running locally off of port 4000, and in the background, you can see the guts of Discourse working away within the SSH client that you used to launch the server.</p>
<p>The initial request may take a while as Discourse begins to initialize its subsystems and start the caching processes; <span style="background-color: #fffbcc">first page loads of 5 to 10 seconds are not uncommon</span>. However, if you’re seeing page load times well beyond this, let us know what your PC configuration is. The Discourse community is actively looking for tweaks and improvements for better VM performance.</p>
<h2>Step 5: Shutting Down</h2>
<p>When you’re done for the day, <kbd>Ctrl</kbd>+<kbd>C</kbd> will kill the Rails server, exiting you back to the command prompt from within the VM.  To finish up, type:</p>
<pre>
exit
vagrant halt
</pre>
<p>This will exit your SSH session, then end the VM and free up its resources.</p>
<p>Congratulations! You now have a working copy of Discourse, ready for you to hack away at any time, and a complete Ruby on Rails environment to facilitate said hacking.</p>
<p>Now go forth and hack &#8212; and please <strong>consider contributing any cool stuff you build <a href="https://help.github.com/articles/using-pull-requests">back to the project as pull requests!</a></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.discourse.org/2013/04/discourse-as-your-first-rails-app/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
