Monday, April 4, 2011

Installing Windows Server 2008 EE with Ruby on Rails and LDAP (Part One)

Installing Windows Server 2008 EE with Ruby on Rails and LDAP (Part One)

One of my burning short term ambitions has been to build some key ruby on rails applications for my company.  My company is primarily a windows shop that uses ASP.NET and Windows Server 2008.  Like most companies, sometimes it's difficult to move away from standardization and into innovation.  I'm not saying that Ruby and Ruby on Rails is the most innovativelanguage and framework around.  No, I'm merely stating that sometimes it's difficult for people to move away from standard practices and think outside of the box.

So, to further my own ends, I’ve decided to build a Ruby on Rails application on Windows Server 2008 Enterprise Edition.  It appears difficult, it’s a nice challenge, and I want to showcase some nice RoR apps to the management team at my company.  But, I know I’m going to be stretching things a bit to get everything I want out of a pure windows shop.  The easiest thing I can do here is to focus on a few core ideas that I've been interested in, and go from there.

My company loves using ASP.NET with IIS and Active Directory.  I don’t want to use or have to rely on IIS for anything in my application.  I will definitely need to communicate with Active Directory so I need some type of LDAP communication in my app.  IIS and Fastcgi is too cumbersome imho, and I already have a few concepts in production on linux that I want to try and use on windows.  So, instead I’ll be using devise_ldap_authenticatable (  This gem will allow me LDAP functionality with Active Directory and I can skip using IIS and fastcgi, which sometimes becomes an alternative in this scenario.  I might make some folks angry in my work place for bypassing IIS, but that's to be expected.  You can't make everyone happy.

As far as web servers are concerned, I want to use Apache as my load balancer.  It can handle the amount of people that will access the applicatioin, and it will allow me to use a faster web server with my rails application.  I had originally thought about using Mongrel, but I've started to move away from Mongrel lately.  I'm opting for Thin instead. 

But, for now, let’s start with some initial setup and work on customization later. 

I will need to use Windows Server 2008 EE, and one nice item that Microsoft provides is a free evaluation copy of this OS for 60 days that can be re-armed 3 additional times.  Re-arming allows you to reset the 60-day evaluation by running a supported Microsoft script.  That gives me 240 days of free evaluation of Windows Server 2008 EE, which is more than enough time for me to develop and showcase my app to the management team.  I will also put it on VMWare so that it’s virtualized, which will allow me to make snapshots before implementing critical changes down the road.  So, let's start by grabbing a copy here: .  

Don’t worry if the download link doesn’t work or isn’t correct.  Just do a search for it and you’ll find the free version of the one you want to use most.  In my case, I’m going to use the amd64 version because I am coding on a 64-bit machine.  So, I’ll grab a copy of the ISO for amd64, store it on a secondary development drive, and I’m ready to begin setting it up.

Installation is going to be fairly simple here. I can launch VMware, click New Virtual Machine, and point the new installation to the ISO image I downloaded.  I chose Windows Server 2008 Enterprise and will use the simple install to finish up the installation.  When I was asked for the license key, I left it blank and hit next and chose NO so that the activation would not take place.  This will start the 60-day evaluation timer and I’m off and running.  In terms of what type of VMware hardware I’m going to run, I think I’m going to set the space to 60GB, and use2GB of RAM for the server.  That should be more than enough to start.

Once it’s fully installed, I see the following startup screen:

The first thing I think I’m going to do is install the VMware tools.  This can be done by clickingVM, clicking reinstall VMWare tools, and running the setup.exe program when the popup arrives.  You can then click next, followed by modify, and I’m going to make sure that all features of the tools are installed.  Once completed, I click next, and modify again, and the toolset is reinstalled with everything requested.  At this time, I think I’m going to restart my server and make sure everything looks fairly clean before I go any further.  (waiting.. waiting.. eating popcorn..)  Hey, it appears to be running fine!

Choosing what roles this server will perform is going to be a little different than I expect to see at my work place.  This is mainly because I need to test Active Directory and so I’m going to make this server have an ADDS role.  With ADDS, you can’t add Application or Web Server roles at the same time. 

Click Next and accept the defaults and choose install to begin the ADDS installation.  Once finished, I will need to run dcpromo.exe to make it a fully functional domain controller.  But, I don’t want to do this just yet.  I think I’m going to change my server name first.

I like ROR-DEVAPP01 as a good name (Ruby on Rails – Development Application 01).  Once I change the name, it’s going to ask me to restart and I can work on the domain controller promotion next.  When it’s restarted, I go to Start, type in dcpromo and hit enter and begin the installation.  I don’t want to use advanced installation features.

The first screen is a little daunting because I got a nasty big scary screen talking about older operating systems and algorithms, etc. – wooo.., ghosts in the machine.  Why does Microsoft always want to scare the hell out of you!

I skip the message, continue right along and check “Create a new domain in a new forest” and click Next.  How about that, another big scary looking message!:

This just states that the Local Administrator account either doesn’t have a password set, or it’s not a strong enough password.  Well, how about I change it to [administrator = !Ruby on Rails#] | [admin = !Ruby on Rails#].  This will fix this error.  You can accomplish this by going through Computer Management.
I’m going to name my FQDN after something fictitious – how about  After performing some verification, everything checks out.  I’m going to set the functional level of the forest to Windows Server 2008 and click next.  In addition, I’m going to leave the DNS server checked, and click next.

At this point the IP address will be dynamically assigned for now, so click Yes.  Normally, I would set this statically, but this is a test environment.  Since we’re working in a virtual environment, it’s pretty simple to keep this setting as dynamic for now.  Production servers would have static IP addresses assigned.

I accept the defaults and ignore any errors, and reboot upon completion.

So, it’s been a pretty good start for part one.  I have a Windows Server 2008 EE server setup with active directory and DNS, the forest has been named, and the sever has been renamed as well.   I’ve built some simple personalization and virtualization is complete.  I think I’ll stop for now and start again tomorrow.  Here’s what it looks like at the end of Part One:

We'll cover more in part two.  See you then!

No comments:

Post a Comment