Level: 100
 

Simple information site in Sitecore - Part 2: Installing Sitecore

WoodenBlock

This is the second part of the article series in 11 parts, describing how to build a simple information site in Sitecore.


In this article we describe how to install Sitecore and how to setup a simple single user development environment.

Written by: Jens Mikkelsen
Fri, Jul 3 2009

The articles


Part 1: The requirements
Part 2: Installing Sitecore and setting up a Visual Studio solution
Part 3: Architecture
Part 4: The basic layouts

Part 5: Identity and documents
Part 6: Navigation
Part 7: The homepage - content oriented spots
Part 8: The homepage - presentation oriented spots
Part 9: News
Part 10: Search
Part 11: Deploying the solution 

File installation

First of all you need to install all the files needed by Sitecore. You can download the latest version of Sitecore on SDN. You have to choose, which type of package you want to use. I normally use the package where all the files are just zipped. This gives me the control on how and where to install the files and it is fairly easy to use. The package is called “ZIP archive of Sitecore CMS site root”.

 

When you have downloaded the ZIP file you need to choose a folder, where your website should be. In my case this is going to be C:\projects\sitecore61. Unpack the ZIP file to this folder.

 

Install unpack

 

The package will create a folder, which it unpacks into. If you don’t want this folder, move all the files to the folder you initially created.

 


 

Installing the databases

There are several ways of installing the databases. In this article we’re just going to do it the most simple way by attaching the provided database files.

 

The database files are located in your installation directory under the folder /databases. Here you’ll see the some different files. We are going to use the .mdf and .ldf files, which are the data and log files for the databases. If you want these files on different server, drive or in a different folder, you can move them. The normal scenario is that you have a separate database server, but in this example we are just leaving them in the default folder.

 

You install the databases by following these steps:

 

1.

Open SQL Server Management Studio which is installed with your SQL server.

 

2.

Connect to the wanted database server. In this case we are connecting to my local SQL express server which has the following name ./SQLEXPRESS

 

3.

Right click on the database folder and select attach as shown in the following picture:

 

AttachDb1

 

4.

In the dialog showing click add and select the MDF file for each of the three databases (web, master and Core), which you earlier placed in a folder. In this example the database files are still placed in our project folder:

 

Selecting MDF

 

5.

You want to rename the Database to something more saying then the default name. So click the attach as field, and you can specify a name. In this example I changed the name to Sitecore61_Core/Web/Master. Then click OK.

 

Database name

 

6.

Now you need to set security on the databases. If you don’t already have a database user you want to use, create it and give it DBO access to the databases. In SQL management Studio go to the login folder in the security folder. Right click and select “New Login…”

 

7.

In the “General” page you need to specify the Login name – in this case SC61_User. You probably want to use SQL authentication, so check this radio button and enter a password. Further you don’t want your solution to go down, due to a SQL login expiring so disable the enforce password policy checkbox or at least the password expiration checkbox:

 

Database security

 

8.

Now you need to assign the proper database right to your user. Go to the User Mapping page and scroll down to your databases. For each database you need to check the “Map” checkbox and assign the db_owner role:

 

USer mapping

 

9. Click OK.

 

Now your databases are all set and ready. 

 

 

Configuring your installation

Now that you have all the files and databases in place, you can now go on to configure your solution.

 

First of all you need to setup the connection strings. This is done in the webroot/App_Config/ConnectionStrings.config. Here you need to adjust the connection strings to map to your database server and the user you just created. In this example the connection string would look like this:

 

  <add name="core" connectionString="user id=SC61_User;password=learnsitecore;Data Source=.\SQLEXPRESS;Database=Sitecore61_Core" />

 

Notice I have changed the user id, the password and database to the values entered in SQL server management studio. The Data Source points to my SQL server instance.

 

You now need to copy a valid license to the data folder. The data folder is by default placed here website/data. Normally you have files in the /data folder, which you don’t want under the web root because of security, so you should either move this folder out of the root or rename it to App_Data. The later lets .Net control security to it, so you should be safe with this solution. When you change the path to the data folder you need to update the following variable in web.config:

 

<sc.variable name="dataFolder" value="/App_Data" />
 
In this case I point it to /App_Data.

 


 

Final steps

You now need to set security on the files. The user to give access to the files various depending on your version of Windows and custom settings. To set security correctly follow this guide on the SDN.

 

Now you need to create a site on your IIS. The way this is done varies from Windows version and IIS version. In this example I presume that you know how to create your site in IIS. Make sure to point the path to the folder you just created.

 

You’re now done and can hit the frontend and backend through a browser. To log in to the Sitecore backend enter the following URL: http://(your_domain_name)/sitecore. The default administrator login is username: admin and password: b

 

 

Setting up a Visual Studio solution

When the installation of Sitecore is done, you want to create a Visual Studio solution to develop in. There are multiple ways to do this, but I find this the best and easiest way:

 

1.

Create an empty Visual Studio Solution in your project folder. In my case that would be c:\projects\sitecore61:

 

New solution

 

2.

Visual studio automatically creates a folder with your solution name. We want the solution to lie in the project folder, so we are going to move it. Close Visual Studio again go to the folder and copy the solution files from the auto created folder to the project folder. 

 

3.
Now that we got the solution in place, we want to create a project. Open the solution again. Add a new ASP.NET Web Application.

 

4.
The project is now added to the solution. You don’t want any of the default files, so go ahead and delete the web.config and the default.aspx from the project.

 

5.
Again Visual Studio auto creates and places the project in a folder called the same as the project name. In this case that would be c:\projects\sitecore61\projectname. We want the project to be placed in the root of your website, so we are going to move it. To do this in an easy way, start out by right clicking the project in Visual Studio and click “remove”. Then close Visual Studio.

 

6.
Go to your project folder and move all the files from c:\projects\sitecore61\projectname to c:\projects\sitecore61\Website, which is your web root folder.

 

7.
Open your solution file again and right click the solution. Then select Add > Existing Solution… You can now browse your way up to the project file and include it again.

 

8.
You are now able to include any Sitecore file you want in the project. If you for instance have created an XSL in the xsl folder. You can add this file to the solution and edit it in Visual Studio.

That’s it. You have now set up your first Sitecore solution and ready to develop.

 

Read the next article in the series, where we go through the architecture.

 

Please rate this article


24 rates / 4,46 avg.

  • About the author:

    Jens Mikkelsen

    Jens Mikkelsen is a partner at Inmento Solutions a Sitecore consulting firm. He works as a Sitecore specialist and consulting helping clients architect and build quality Sitecore solutions using the newest modules and tools. 

    Further he has been deeply envolved in various complex solutions and has built up a strong knowledge of Sitecore architecture and best practices. He has especially focused on and is specialized in debugging and analyzing Sitecore solutions.

     

    Jens is very interested in the technical mechanisms in the new marketing products such as Sitecore DMS and Sitecore ECM.

    My Sitecore Freelance CV

18 responses to "Simple information site in Sitecore - Part 2: Installing Sitecore"

NO link found to next article. Please fixed up soon.
Regards
Posted: Monday, August 03, 2009 6:07 AM
Hi,

I installed sitecore in my localmachine

It's path like this:

c:\inetpub\wwwroot\sitecore

Could anybody help to create a new sitecore project in visual studio 2008 with respect to that installed folder?

Mail your answers to sendrektome@gmail.com

Thanks&Regards,
John
Posted: Thursday, September 24, 2009 9:54 PM
Would love to see the rest of these articles!
Posted: Tuesday, September 29, 2009 8:46 PM
They are on the way, but we are working on a general article on architecture, and was hoping to finish it before we continue this series. However we might skip the general article, now that this series are so requested.
Posted: Tuesday, September 29, 2009 9:38 PM
Hi guys,

The next article in the line is now published. You can view it here: http://learnsitecore.cmsuniverse.net/en/Architects/Articles/2009/11/Sitecore-architecture-simple.aspx
Posted: Monday, November 23, 2009 10:46 PM
Hi Jens,

Do you think SQL Express is adaquate for a production implamentation?

Thanks!
Posted: Tuesday, January 19, 2010 6:43 PM
Hi John,

It kind of depends on how much activity you have on the site and how failsafe the server should be.

Take a look at this: http://stackoverflow.com/questions/180537/sql-express-for-production

Many people use it in production; the biggest lack being the lack of an agent to run scheduled jobs. So if you need that to automate backup, you are going to be missing that if you use SQL Express.

Besides that I don't see any problems in using SQL Express.
Posted: Tuesday, January 19, 2010 9:17 PM
need help on special characters
Posted: Thursday, February 04, 2010 12:39 AM
Very helpful, thanks! Here are some Sitecore FAQs that I found to be helpful as well: http://bit.ly/bZ2S8S
Posted: Wednesday, July 21, 2010 10:01 PM
Hi Guys

Please lemme know how shud I install sitecore cms..I am new to this CMS...I have VS 2008 in my laptop
Posted: Monday, October 11, 2010 10:26 PM
Hi Jean,

I don't have a computer and I'd like to do the lab at the library. Do you know a place where I can access sitecore starter kit.

For example...
http://www.akshaysura.com/

Posted: Thursday, January 13, 2011 4:33 PM
Thanks for an excellent article.

Regarding the section "Setting up a Visual Studio solution" I think 2-3 screen dumps would help a lot.

I think there maybe a typo:
"Open your solution file again and right click the solution. Then select Add > Existing Solution" >>> This should be saying web project, not solution.

Thanks for a very helpful article.
Posted: Tuesday, February 01, 2011 12:14 AM
Thanks for the series of toutorial on sample site.

I am interested in Part 9: News article, where will i get the details of this article.

Thank you very much
Posted: Wednesday, March 23, 2011 1:38 PM
hi Jens,

this document is very helpful . but i am unable to understand from 5th point . can you give in detail so that it helps me a lot . I am using visual studio 2010.

waiting for your response
Posted: Wednesday, June 20, 2012 7:28 AM
how to start site core
Posted: Tuesday, October 23, 2012 1:31 PM
where or when is the next installment to this tutorial?
Posted: Wednesday, January 22, 2014 3:25 PM
Hi Jens/Anyone,

How i can the sitecore application, when am trying to download its saying that need authorization. am unable to download...Can any one please help mein this.
Posted: Monday, December 15, 2014 11:09 AM
demo web site for testing purpose only.
Posted: Thursday, April 02, 2015 11:58 AM

Leave a reply


Notify me of follow-up comments via email.
 
 
#nbsp;