Tuesday, April 12, 2011

Development Environment for Sharepoint & SQL Server

I would like to share some of my experience in preparing a proper devlopment environment, in this article. I had been a great desire to make my development environment to be same as the production environment, for few months. As developers most of you would agree with me, since you also like to work with the production environment itself. It is advantageous to have a your own development environment in your own pc's since it give you the ability to work in a production environment at home and it's more convinient to your testing and deployments.
There are two ways to achieve this on microsoft environment.
  1. Intall Windows server as your main operating system and use virtualisation to prepare other server machines and windows7 development environments.
  2. Intall Windows7 as your major operating system and prepare a dual booting system for windows server and use virtualization on windows server system to prepare other production servers.
There are several pros and corns in above two methods.

In the first method we choose windows server as our prefered operating system. It would be a really hard decission to you as you'll have to depend on a server for all small tasks such as preparing a word document or listen to music or small excel thing. In the next method we create our machine for dual booting, then we could choose the operating system at booting instance. Then it would be more user friendly as our requirement not always be a Sever OS. Terefore I really like for the second option and I hope to guide you to a nice dual booting system and essintial configurations for a production environment such as how to configure active directory domain services.

Creating a dual booting system

First of all your system have to be patitioned properly. Before creating patitions you should aware that which patitions require more disk space. I personally like to install all the operating systems to C:/ drive hense C drive should requre more space than other patitions. For example if you have 500GB hard disk you should alocate at least 300GB for C drive.

  • Install Windows7 or WindowsXp to your C drive without any hesitation. No any aditional thing to undergo here.
  • Next you are going to create a vhd file, which is used to install Windows Server 2008 R2. Therefore this is not a virtual PC, its directly install on to your hardware, but the difference is its installed to a file.
Here is a great article which describes how to create a win2k8r2.vhd file.
http://www.microsoftnow.com/2009/11/dual-booting-windows-server-2008-r2.html


I shall note down here some important points that you should follow up and difficulties I have recovered.

  • When you creating the .vhd file allocate more disk space to Server system as we need to create other servers on this server. According to the above example hence you allocated 300GB to C drive, give Maximum disk size as 200GB.  
  • Once you are created the .vhd file you'll have to reboot the machine for windows installation (I assume that you are intalling windows server using bootable DVD) then mounts are deleted and you have to reattached the .vhd file. Otherwise precreated partition will not be shown in the partition table.
  •  Press SHIFT+F10 to get command promt when you get the windows installation screen after the language selection window.
  • Sometimes your machines F10 key is allocated for some aditional tasks, In that instant you will not get the command promt even if you press SHIFT+F10. Please make sure that your F10 key is not assigned for any other tasks and use SHIFT+Fn+F10 or use another keyboard.
  • Then probably you would see the new patition that we have created in the partition selection table and intall windows server to the newly created partition.
After installing Windows7 and Windows Server to your system you would see boot selection menu at the booting instance.


Creating a Production environment on Windows Server

The main components of a production environment are listed below.
  1. Domain Controller
  2. Database Server
  3. Web Server or Sharepoint Server.
You need at least three servers to be installed on your pc to create real production environment. But I was bit greedy to spend on three servers, so I install Databse server and Sharepoint server on one server. Therefore in my care I use only two servers, but you can use three servers. But keep in mind that you really use this pc for development purposes, then you have to power on above three servers before any development task.

You can use allready installed server as Domain Controller. Which can be done by adding server rolls in windows server 2008 r2. Open the server manager snap in and add the new roll called Active Directory Domain Services. The following technet article shows you how to configure Active directory domain services on Windows server 2008 r2.

You can add DNS server roll as a part of adding Active Directory Domain Services server roll. So I have configured "dsp.com" as my Fully Qualified Domain Name (FQDN).

Now you have a Active Directory and a DNS server.

Our next step is adding Hyper-V server roll in to our server. Open server configuration manager and add Hyper-V server roll. Before proceed through the steps, you should aware that you are going to create a Virtual machine. That machine should needed at least 3GB of memory. In my case Iam going to install database server and sharepoint server on this virtual machine. If you use this VM as a databse server, then 2GB is enough, but if you plan to install sharepoint farm more than 3GB is preferable. The following technet article shows how to add hyper-v server role, set up a virtual machine and configure virtual networks.


Then add your virtual machine to your domain, in my seinario its dsp.com. (Write click on my computer go properties, Change settings on Computer domain then system properties dialog box will apear. Under computer name tab click on change and change the computer domain to your domain)

Once your VM is added to the domain you can logon to the system as a domain user. Then go to the domain controller again and add new active directory user and you can use that user as a default user when you log on to the VM. Before log on to the system using domain account its better to add the domain user to the Administrators group of the VM.

Generally Iam using my PC as a sharepoint server. But Iam developing SQL server based products as well, so I need to install database server which compatible with sharepoint installation. There are three minimum service accounts should require for a least previlage sharepoint server installation. Those accounts are listed below.
  1. sp_sql
  2. sp_admin
  3. sp_farm
For more details about user accouts and previlages use following technet article.

Then create above user accounts and service accounts in your domain controller. Then Intall SQL server using sp_sql service account.  Then you can Install sharepoint using least previlage service accounts. The following article shows how to install sharepoint using least previlage service accounts.

For prerequisits follow the follwing msdn article.

Now you have done your prodoction environment and hope it would work well.

No comments:

Post a Comment