<?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>Ramblings &#187; Configuration</title>
	<atom:link href="http://ramblings.gibberishcode.net/archives/category/setups/configuration/feed" rel="self" type="application/rss+xml" />
	<link>http://ramblings.gibberishcode.net</link>
	<description>about fetching, interpreting, and executing.</description>
	<lastBuildDate>Sat, 01 May 2010 19:19:27 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Getting Ruby to talk to MSDE</title>
		<link>http://ramblings.gibberishcode.net/archives/getting-ruby-to-talk-to-msde/22</link>
		<comments>http://ramblings.gibberishcode.net/archives/getting-ruby-to-talk-to-msde/22#comments</comments>
		<pubDate>Fri, 09 Apr 2010 01:07:45 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Configuration]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Ruby Language]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Setups]]></category>

		<guid isPermaLink="false">http://ramblings.gibberishcode.net/?p=22</guid>
		<description><![CDATA[Getting Ruby to talk to Microsoft SQL Server 2005 is one thing.  Getting Ruby to talk to Microsoft SQL Server Developer Edition 2000, has one twist that threw me off for hours.  Here, I&#8217;ll show you how to do and hopefully save you lots of frustration and brain damage from banging your head [...]]]></description>
			<content:encoded><![CDATA[<p>Getting Ruby to talk to Microsoft SQL Server 2005 is one thing.  Getting Ruby to talk to Microsoft SQL Server Developer Edition 2000, has one twist that threw me off for hours.  Here, I&#8217;ll show you how to do and hopefully save you lots of frustration and brain damage from banging your head against the wall.
</p>
<p>I won&#8217;t cover a complete Ruby and Rails/Ramaze/Sinatra installation.  This post assumes you have that much down pat, so we&#8217;ll pick up the ball with installing FreeTDS, unixODBC, Ruby ODBC
</p>
<p>If you&#8217;re using Ubuntu 8.10, you can get away with installing everything from packages with the following:
</p>
<pre class="twilight">
apt-get install  unixodbc freetds-common tdsodbc \
             libodbc-ruby1.8 \
             libdbi-ruby1.8 libdbd-odbc-ruby \
             autoconf make
</pre>
<p><b>NOTE:  I wrote this article and right before publishing, attempted to replicate these results on both mac OS X and CentOS 5.  Both failed to work with the technique I thought I had all nice and worked out.  I spent several hours over many months trying to find out exactly what&#8217;s different between the packages, but never got very far with my investigations.  For a long time, it looked to me like both the ODBC packages and the FreeTDS packages need to be tweaked to properly handle [SERVER]\[DB_INSTANCE] construct that MSDE uses vs. just [SERVER] that the full-fledged SQL Server uses.</b>  This, after all, is the convention of the Windows ODBC driver and DSN definitions.  However, there&#8217;s a really simple solution that I hit upon on Actual Technologies&#8217; website that led me to a true universal solution and that&#8217;s to learn the port the INSTANCE runs on and set up the DSN specifically to that port!
</p>
<p>But beware, the above doesn&#8217;t get you all of the freetds tools, most importantly the tsql command which can help you with debugging issues before getting into the ODBC game (that is, direct TDS connections to your SQL Server).  So, to cover the most distros possible, I&#8217;ll document the &#8220;from source&#8221; approach for *nix systems and macports for Macs so you&#8217;ll find two sets of installation instructions for every step.</p>
<h2>Preparing your Environment</h2>
<p>I prefer to pull down all source packages into my local user directory under a &#8220;~/src&#8221; folder.  The instructions that follow assume you&#8217;re in this folder.  If you&#8217;re not, then please make the appropriate substitutions as you follow along.  Additionally, I configure and compile most things as a regular user then use sudo to install system-wide as a &#8220;super user.&#8221;
</p>
<h2>Install unixODBC</h2>
<p>unixODBC provides the ODBC connectivity for the TDS driver.</p>
<pre class="twilight">
wget http://www.unixodbc.org/unixODBC-2.2.14.tar.gz
tar zxfv unixODBC-2.2.14.tar.gz
cd unixODBC-2.2.14
./configure  --enable-gui=no
make
sudo make install
</pre>
<h3>On Macs</h3>
<pre class="twilight">
sudo port install unixODBC
</pre>
<h3>On CentOS</h3>
<pre class="twilight">
sudo yum install unixODBC unixODBC-devel
</pre>
<h2>Install FreeTDS</h2>
<p>FreeTDS provides the open source implementation of the protocol implemented by both Sybase and Microsoft SQL Server.
</p>
<pre class="twilight">
wget ftp://ftp.ibiblio.org/pub/Linux/ALPHA/freetds/stable/freetds-stable.tgz
tar zvxf freetds-stable.tgz
cd freetds-0.82/
sudo ./configure  --with-unixodbc=/usr/local
sudo make
sudo make install
</pre>
<h3>On Macs</h3>
<pre class="twilight">
sudo port install freetds
</pre>
<h3>On CentOS</h3>
<pre class="twilight">
sudo yum install freetds
</pre>
<h2>Install ruby-odbc</h2>
<p>The ruby-odbc package provides the ruby bindings for ODBC connectivity.
</p>
<pre class="twilight">
wget http://www.ch-werner.de/rubyodbc/ruby-odbc-0.9995.tar.gz
tar zvxf ruby-odbc-0.9995.tar.gz
cd ruby-odbc-0.9995/
ruby extconf.rb
make
sudo make install
</pre>
<h3>On Macs</h3>
<pre class="twilight">
sudo port install rb-odbc
</pre>
<h2>Install ruby DBI</h2>
<pre class="twilight">
wget http://rubyforge.org/frs/download.php/655/ruby-dbi-all-0.0.23.tar.gz
tar zvxf ruby-dbi-all-0.0.23.tar.gz
cd ruby-dbi-all
ruby setup.rb config --with=dbi,dbd_odbc
ruby setup.rb setup
sudo ruby setup.rb install
</pre>
<h2>Configure FreeTDS and ODBC</h2>
<p>If you&#8217;re connecting to either SQL Server 2000 or SQL Server 2005 Standard, Enterprise, etc., then the typical approach is to add an entry for the server to /etc/freetds/freetds.conf and then reference that entry in the /etc/odbc.ini.  Sometimes, these files get installed in /usr/local/etc.  If so, then I will usually symlink the files into /etc for convenience, so that&#8217;s what&#8217;s referenced below.
</p>
<p>My server is called &#8220;apvdbs01&#8243; (the WINS name) with an IP Address of 10.0.2.2 and the database I&#8217;m connecting to is called &#8220;test_development&#8221; while &#8220;username&#8221; and &#8220;passwd&#8221; should be substituted with an valid user account and credentials for successfully connection to the database server.
</p>
<p>
Add a server entry for your server (which I typically give same name as Windows Server) to /etc/freetds.conf, so that host points to the SQL Server address:
</p>
<pre class="twilight">
[apvdbs01]
host = 10.0.2.2
port = 1433
tds version = 7.0
</pre>
<p>TDS version 7.0 is for SQL Server 2000.  If you have SQL Server 2005, then tds version is 8.0.</p>
<pre class="twilight">
tsql –S apvdbs01 –U username –P passwd
</pre>
<p>Once you can connect directly with the TDS drivers, move on to adding the ODBC driver entries.</p>
<p>Add the FreeTDS ODBC driver by editing “/etc/odbcinst.ini” (make sure “/usr/local/lib/libtdsodbc.so” exists first):
</p>
<pre class="twilight">
[FreeTDS]
Description     = TDS driver (Sybase/MS SQL)
Driver          = /usr/lib/odbc/libtdsodbc.so
Setup           = /usr/lib/odbc/libtdsS.so
</pre>
<p>Add a new DSN to “/etc/odbc.ini”:</p>
<pre class="twilight">
[test_development]
Driver          = FreeTDS
Description     = ODBC connection via FreeTDS
Trace           = No
ServerName      = apvdbs01
Database        = test_development
</pre>
<p>So, &#8220;FreeTDS&#8221; is the driver that we gave for the lib TDS ODBC connector in the odbcinst.ini file (this allows you to install and maintain multiple versions of the libtdsodbc.so file).  We reference this driver in the odbc.ini file with the &#8220;Driver&#8221; entry and we reference the actual server data in the freetds.conf file via the &#8220;ServerName&#8221; entry.
</p>
<p>Now that you have ODBC configured for FreeTDS, test it with:</p>
<pre class="twilight">
	isql test_development username passwd
</pre>
<h2>But that doesn&#8217;t work for MSDE!</h2>
<p>The above will get you connected to a standard or enterprise SQL Server 2000/2005 installation, but does not work for an Embedded SQL Server 2000/2005 installation.  After trying many permutations, I finally came up with a configuration that actually works.  One of the key things to know about MSDE is that the MSDE server instance is in the form of &#8220;servername\instance&#8221; rather than straight up &#8220;servername&#8221; as with standard/enterprise installations.  This is known as a &#8220;named instance.&#8221;  The trick to connecting?  Find out the port the named instance is listening on and connect to that port rather than the 1433 port!</p>
<p>You can determine the port used by the instance by using the Server Network Utility in the Microsoft SQL Server program group on the Windows server where your database resides. Select the instance name from the drop down list and select TCP/IP from the list of enabled protocols. This will show you the port number for that instance.</p>
<pre class="twilight">
[test_msde2000]
Driver         = FreeTDS
Description    = ODBC connection via FreeTDS
Server         = 10.0.2.2
Database       = my_test_db
Port           = 1348
TDS_Version    = 7.0
</pre>
<p>I could then connect to the MSDE instance like so:</p>
<pre class="twilight">
isql test_msde2000 username passwd
</pre>
<h2>Test ODBC connectivity from Ruby</h2>
<p>If both tsql and isql commands work, then you&#8217;re well on your way to connecting to SQL Server via Ruby.  To test Ruby with the above ODBC configurations:</p>
<pre class="twilight">
irb
require "dbi"
dbh = DBI.connect("dbi:ODBC:test_development", "username", "passwd")
</pre>
<h2>Connecting with Sequel</h2>
<p>One of my favorite tools for connecting to SQL DBMS&#8217; is Sequel, which is maintained by Jeremy Evans.  To connect using Sequel, install the gem:
</p>
<pre class="twilight">
sudo gem install sequel
</pre>
<p>And then give this a shot:</p>
<pre class="twilight">
irb
require 'rubygems'
require 'sequel'

DB = Sequel.odbc('test_development', :db_type => 'mssql', :user => 'username', :password => 'passwd')
</pre>
<h2>References</h2>
<p>http://www.freetds.org/userguide/confirminstall.htm</p>
<p>http://www.unixodbc.org/odbcinst.html</p>
<p>http://www.actualtech.com</p>
]]></content:encoded>
			<wfw:commentRss>http://ramblings.gibberishcode.net/archives/getting-ruby-to-talk-to-msde/22/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Apache 2.2 and Active Directory and Group restrictions</title>
		<link>http://ramblings.gibberishcode.net/archives/apache-22-and-active-directory-and-group-restrictions/36</link>
		<comments>http://ramblings.gibberishcode.net/archives/apache-22-and-active-directory-and-group-restrictions/36#comments</comments>
		<pubDate>Wed, 22 Jul 2009 16:44:44 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Configuration]]></category>
		<category><![CDATA[Servers]]></category>
		<category><![CDATA[Setups]]></category>
		<category><![CDATA[Systems]]></category>
		<category><![CDATA[active directory]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[authnz ldap module]]></category>
		<category><![CDATA[mod_authnz_ldap]]></category>

		<guid isPermaLink="false">http://ramblings.gibberishcode.net/?p=36</guid>
		<description><![CDATA[I was really struggling with getting Apache and Active Directory talking and restricting access (authorizing) only a sub-set of users that belonged to a particular group.  Here, I show you how I solved the problem.

The Stage
I am setting up a Ubuntu server with Apache 2.2 and authenticating users against a Windows 2003 Server&#8217;s Active [...]]]></description>
			<content:encoded><![CDATA[<p>I was really struggling with getting Apache and Active Directory talking and restricting access (authorizing) only a sub-set of users that belonged to a particular group.  Here, I show you how I solved the problem.
</p>
<h2>The Stage</h2>
<p>I am setting up a Ubuntu server with Apache 2.2 and authenticating users against a Windows 2003 Server&#8217;s Active Directory.  This is standard fare when all you need is a require valid-user directive.  But when it came to getting require ldap-group directive going, I really stumbled.  And on multiple fronts, too.  I am not a Windows guru by any measure, nor am I an LDAP guru, so there was a huge cultural and vocabulary barrier for me to cross on both the LDAP vernacular and the somewhat different parlance surrounding Microsoft&#8217;s documentation on Active Directory.  Its like a Southern Redneck talking to a Scottish Highlander about home-brewing beer.
</p>
<p>So here&#8217;s what we&#8217;re going to do:</p>
<ul>
<li>Apache 2.2</li>
<li>Microsoft Active Directory (Windows 2003 Server)</li>
<li>authnz_ldap module</li>
</ul>
<p>For this effort, I am authenticating users that reside in the MyBusiness -> Users folders and I&#8217;m restricting access to the Auditors Security Group, also residing under MyBusiness.  The domain I use is &#8220;sample.local&#8221; herein.  See the screen shot of the Active Directory structure and details of the Auditors group below:
</p>
<p><img src="http://www.cybrains.net/images/ad_screenshot.png" alt='Active Directory Screenshot' /></p>
<p>There are <a href="http://httpd.apache.org/docs/trunk/mod/mod_authnz_ldap.html">plenty of resources out there</a> about getting the authnz_ldap module working with Apache, so I won&#8217;t be covering this part of the setup.  Instead, I will focus on the gestalt of the actual configuration.
</p>
<h2>Will the Real AuthLdapUrl Please Stand Up?</h2>
<p>There seems to be no real standard way to set the AuthLdapURL configuration string.  I think I visited ten or fifteen web sites on the topic and each one was a little bit different!  And none really explained fully the chosen syntax and LDAP selectors being used.  Fortunately, I came across a <a href="http://www.computerperformance.co.uk/Logon/Logon_CSVDE.htm">site dedicated to explaining CSVDE</a>, which turned out to be a bit of a rosetta stone for me.
</p>
<p>CSVDE is a tool I had never heard of, but yet is apparently installed on every Windows 2003 Server.  After about five minutes of reading and 20 minutes of perusing the CSV export I generated, I knew exactly how to construct the AuthLdapURL configuration string.  Well, with one caveat, that is.  I still am not sure what &#8220;(objectClass=*)&#8221; does for me, but several examples had it and I kept it.
</p>
<h2>Know your Users</h2>
<p>All of my users are maintained under group policies and they reside under the domain&#8217;s root node in &#8220;MyBusiness&#8221; and &#8220;Users&#8221; under that.  Standard Windows accounts, especially system administrator accounts reside in a &#8220;Users&#8221; folder directly off the domain&#8217;s root node.  This was one of the first points of contention that I had to understand when looking at the vast majority of other people&#8217;s solution.  Simply put, know which &#8220;Users&#8221; you wish to work with in Apache.
</p>
<p>Knowing I wanted to authenticate users under the MyBusiness node, my AuthLdapUrl becomes:
</p>
<pre class="twilight">
AuthLDAPURL ldap://ad.sample.local:389/OU=MyBusiness,DC=sample,DC=local?sAMAccountName?sub?(objectClass=*)
</pre>
<h2>Bind a User so Apache can Query</h2>
<p>You do have to bind to Active Directory so that Apache can actually query.  To do this, I created a User under the standard &#8220;Users&#8221; folder (where administrator, and other such accounts traditionally reside).  I don&#8217;t know if I applied correct rights or not, but the account is no more than a &#8220;Domain User&#8221; member.  I called the user &#8220;AD_VIEWER&#8221; with description &#8220;Account to bind Apache to Active Directory for authentication.&#8221;  This leads to the following Apache directives:
</p>
<pre class="twilight">
AuthLDAPBindDN "AD_VIEWER@sample.local"
AuthLDAPBindPassword bottom_secret_password
</pre>
<p>I tested the above getting the usual &#8220;require valid-user&#8221; directive working with Apache.  Once I was sure I could do this much, it was time to turn my attention to restricting access to users that are members of a specific group.
</p>
<h2>Where&#8217;s my Group?</h2>
<p>I struggled for quite a while with the groups before I finally got wise and set the debug level to get more details into the apache log files.  The debug logging level can be set with:
</p>
<pre class="twilight">
LogLevel debug
</pre>
<p>And this leads to quite detailed information about what&#8217;s going on with Apache and Authentication.  For example, before I got my ldap-group configuration correct, I was seeing this:
</p>
<pre class="twilight">
[debug] mod_authnz_ldap.c(721): [2934] auth_ldap authorise: require group: testing for uniquemember: CN=Code Connoisseur,OU=MyBusiness,OU=Users,DC=sample,DC=local (CN=Auditors,OU=MyBusiness,DC=sample,DC=local)
[debug] mod_authnz_ldap.c(737): [2934] auth_ldap authorise: require group "CN=Auditors,OU=MyBusiness,DC=sample,DC=local": authorisation failed [Comparison complete][No such object]
[debug] mod_authnz_ldap.c(852): [2934] auth_ldap authorise: authorisation denied
</pre>
<p>Note the &#8220;No such object&#8221; as this was telling me the group itself was not found.  I tried many permutations without success until I found the CSVDE program and was able to dump the Active Directory to Excel for further inspection.  I realized with the CSVDE output that I was doing both the<br />
AuthLDAPURL (the above AuthLDAPURL is correct as I have spared you from my mistakes).  The correct ldap-group config string for accessing a Security Group defined under MyBusiness is:</p>
<pre class="twilight">
require ldap-group CN=Auditors,OU=Security Groups,OU=MyBusiness,DC=sample,DC=local
</pre>
<p>In short, you have to exactly declare the selector for your Active Directory Group or Apache will fail to find it.  After getting the group setting right, I now see &#8220;attribute member&#8221; and &#8220;Comparison true&#8221; in the logs, which indicates that the group was found and that my user is a member of that group.
</p>
<pre class="twilight">
[debug] mod_authnz_ldap.c(377): [3134] auth_ldap authenticate: using URL ldap://10.0.1.5:389/OU=MyBusiness,DC=sample,DC=local?sAMAccountName?sub?(objectClass=*)
[debug] mod_authnz_ldap.c(474): [3134] auth_ldap authenticate: accepting mwlang
[debug] mod_authnz_ldap.c(715): [3134] auth_ldap authorise: require group: testing for group membership in "CN=Auditors,OU=Security Groups,OU=MyBusiness,DC=sample,DC=local"
[debug] mod_authnz_ldap.c(721): [3134] auth_ldap authorise: require group: testing for member: CN=Michael Lang,OU=Employees,OU=Users,OU=Users,OU=MyBusiness,DC=sample,DC=local (CN=Auditors,OU=Security Groups,OU=MyBusiness,DC=sample,DC=local)
[debug] mod_authnz_ldap.c(730): [3134] auth_ldap authorise: require group: authorisation successful (attribute member) [Comparison true (adding to cache)][Compare True]
</pre>
<h2>The complete Apache Config</h2>
<p>Bringing all of the items discussed above together, we arrive at this Apache configuration.  I am using Virtual Hosts to uniquely identify the service.  Also of note, I am using Ramaze to provide the functionality of the actual site, so please do take this into account if you&#8217;re copying and pasting.  This config is a complete virtual host entry:
</p>
<pre class="twilight"><span class="Keyword">&lt;</span>VirtualHost *:<span class="Keyword">80&gt;</span>
    ServerName audit.sample.local
    RackBaseURI /
    RackAutoDetect on
    DocumentRoot /var/www/balancer/public

    LogLevel debug
    <span class="Keyword">&lt;</span>Location <span class="String"><span class="String">&quot;</span>/data_entry<span class="String">&quot;</span></span><span class="Keyword">&gt;</span>
        AuthBasicProvider ldap
        AuthType Basic
        AuthName <span class="String"><span class="String">&quot;</span>Sample Realm<span class="String">&quot;</span></span>
        AuthLDAPURL ldap://10.0.1.5:389/OU=MyBusiness,DC=sample,DC=local?sAMAccountName?sub?(objectClass=*)
        AuthzLDAPAuthoritative on

        AuthLDAPBindDN <span class="String"><span class="String">&quot;</span>AD_VIEWER@sample.local<span class="String">&quot;</span></span>
        AuthLDAPBindPassword bottom_secret_password

        AuthLDAPGroupAttributeIsDN on
        require ldap-group CN=Auditors,OU=Security Groups,OU=MyBusiness,DC=sample,DC=local
    <span class="Keyword">&lt;</span>/Location<span class="Keyword">&gt;</span>
<span class="Keyword">&lt;</span>/VirtualHost<span class="Keyword">&gt;</span>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://ramblings.gibberishcode.net/archives/apache-22-and-active-directory-and-group-restrictions/36/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Install Passenger on Ubuntu Intrepid 8.10</title>
		<link>http://ramblings.gibberishcode.net/archives/install-passenger-on-ubuntu-intrepid-810/30</link>
		<comments>http://ramblings.gibberishcode.net/archives/install-passenger-on-ubuntu-intrepid-810/30#comments</comments>
		<pubDate>Sat, 14 Feb 2009 15:03:16 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Configuration]]></category>
		<category><![CDATA[Setups]]></category>
		<category><![CDATA[Bootsrap]]></category>
		<category><![CDATA[enterprise ruby]]></category>
		<category><![CDATA[passenger]]></category>

		<guid isPermaLink="false">http://ramblings.gibberishcode.net/?p=30</guid>
		<description><![CDATA[Phusion Passenger is one of the easiest Rails and Rack environments to set up and configure with Apache2.  With my bootstrapping scripts, the ability to establish a Virtual machine image and have a working Rails application on it in minutes is a reality.  Here is how I do it.
Bootstrap Passenger
Begin by Bootstrapping Ubuntu. [...]]]></description>
			<content:encoded><![CDATA[<p>Phusion Passenger is one of the easiest Rails and Rack environments to set up and configure with Apache2.  With my bootstrapping scripts, the ability to establish a Virtual machine image and have a working Rails application on it in minutes is a reality.  Here is how I do it.</p>
<h2>Bootstrap Passenger</h2>
<p>Begin by <a href="http://ramblings.gibberishcode.net/archives/bootstrap-ubuntu-server-810-intrepid-64-bit/29">Bootstrapping Ubuntu</a>.  </p>
<p>The next step is to run the script for installing Passenger.  The standard passenger install against the standard Ruby 1.8.7 package managed libraries are installed with the following:</p>
<p>(assuming you&#8217;ve downloaded the bootstrap scripts and are in the ~/bootstrap-scripts/ubuntu/intrepid folder already, execute the following script:</p>
<pre class="twilight">
./bootstrap-passenger-std.sh
</pre>
<p>Passenger&#8217;s install prompts you two or three times.  Simply press <ENTER> and ignore the additional configuration instructions (the bootstrap script carries out these instructions for you).</p>
<h2>Set up a demo Rails project</h2>
<pre class="twilight">
cd /var/www
sudo mkdir rails
cd rails
sudo rails demo
cd ..
chown -R www-data:www-data rails
</pre>
<h2>Set up a Virtual Host Entry</h2>
<p>Apache2 on Ubuntu makes it fairly straightforward to set up a provider for the Rails application, simply create the following in /etc/apache2/sites-available/demo:</p>
<pre class="twilight">
<span class="MetaTagAll"><span class="MetaTagAll">&lt;</span><span class="MetaTagInline">VirtualHost</span> <span class="MetaTagAll">*:80</span><span class="MetaTagAll">&gt;</span></span>
  <span class="SupportConstant">ServerName</span> localhost
  <span class="SupportConstant">DocumentRoot</span> /var/www/rails/demo/public
<span class="MetaTagAll"><span class="MetaTagAll">&lt;/</span><span class="MetaTagInline">VirtualHost</span><span class="MetaTagAll">&gt;</span></span>
</pre>
<p>And then enable the site:</p>
<pre class="twilight">
sudo a2ensite demo
sudo /etc/init.d/apache2 reload
</pre>
<h2>End Result</h2>
<p>If all goes well, you should then be able to browse to http://localhost and see the rails greet page.  Your system will look something like this:</p>
<pre class="twilight"><span class="String"><span class="MetaTagInline">OS<span class="MetaTagInline">:</span></span> <span class="String">2.6.27-7-server x86_64 GNU/Linux</span></span>
<span class="String"><span class="MetaTagInline">Apache<span class="MetaTagInline">:</span></span> <span class="String">Server version: Apache/2.2.9 (Ubuntu)</span></span>
<span class="String"><span class="MetaTagInline">Passenger<span class="MetaTagInline">:</span></span> <span class="String">2.0.6</span></span>
<span class="String"><span class="MetaTagInline">Ruby<span class="MetaTagInline">:</span></span> <span class="String">ruby 1.8.7 (2008-08-11 patchlevel 72) [x86_64-linux]</span></span>
<span class="String"><span class="MetaTagInline">Rubygems<span class="MetaTagInline">:</span></span> <span class="String">1.3.1</span></span>
<span class="MetaTagAll"><span class="MetaTagInline">gems</span><span class="MetaTagAll">:</span></span>
 <span class="String"><span class="String">-</span> <span class="String">actionmailer (2.2.2)</span></span>
 <span class="String"><span class="String">-</span> <span class="String">actionpack (2.2.2)</span></span>
 <span class="String"><span class="String">-</span> <span class="String">activerecord (2.2.2)</span></span>
 <span class="String"><span class="String">-</span> <span class="String">activeresource (2.2.2)</span></span>
 <span class="String"><span class="String">-</span> <span class="String">activesupport (2.2.2)</span></span>
 <span class="String"><span class="String">-</span> <span class="String">fastthread (1.0.1)</span></span>
 <span class="String"><span class="String">-</span> <span class="String">passenger (2.0.6)</span></span>
 <span class="String"><span class="String">-</span> <span class="String">plist (3.0.0)</span></span>
 <span class="String"><span class="String">-</span> <span class="String">rack (0.9.1)</span></span>
 <span class="String"><span class="String">-</span> <span class="String">rails (2.2.2)</span></span>
 <span class="String"><span class="String">-</span> <span class="String">rake (0.8.3)</span></span>
</pre>
<h2>Where to go from here?</h2>
<p>After you have Passenger working, you may be interested in trying it with the so-called <a href="http://www.rubyenterpriseedition.com/">Enterprise version of Ruby</a> which claims 33% memory footprint reduction overall for a typical Rails application.  If so, you can flip over to the Enterprise version by running the following bootstrap script:</p>
<pre class="twilight">
./bootstrap-passenger-ent.sh
</pre>
<p>This script will download and compile Enterprise Ruby and install Passenger against this version of Ruby, disabling the standard passenger modules in Apache (if they&#8217;re installed as per above) in the process.  Does it make any real difference?  We shall see!  I am benchmarking performance of both standard and enterprise and will be reporting on my findings soon. </p>
]]></content:encoded>
			<wfw:commentRss>http://ramblings.gibberishcode.net/archives/install-passenger-on-ubuntu-intrepid-810/30/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
