A developer’s first EPiServer CMS project at Sogeti, part 1

In EPiServer

These two posts are the base for an introductory EPiServer lab evening I’ll be hosting at Sogeti (or have hosted depending on when you’re reading this). Instead of a PowerPoint-presentation I thought I’d share the EPiServer love here. I appreciate all the feedback I can get!

You’ll learn how to set up an EPiServer CMS project for the first time. The posts detail each installation and configuration step until you have your site up and running with a very simple start page.

They’re not as comprehensive as Frederik Vig’s awesome series Create an EPiServer site from scratch and won’t take you into the depths of design. But instead they go into more detail with the first installation and configuration steps and potential pitfalls you might face.

I’m using the Visual Studio project structure for EPiServer CMS as defined by Ted Nyberg in his post How to set up an EPiServer website which is heavily referenced throughout this post.

OK! Let’s get started!

Prerequisites

This post assumes that you’ve installed the following:

  • Visual Studio 2008 / 2010 (I’m using Visual Studio 2010 Ultimate Beta 2)
  • SQL Server Express 2008
  • SQL Server Express 2008 Management Tools
  • EPiServer CMS 6 RC1

Installing EPiServer CMS

Open the EPiServer Deployment Center. This is the tool from which we’re installing the website and creating the database. Select “Install site and SQL Server database”.

EPiDeploymentCreateSite

Next we’ll configure the site. I’ll be using the name of “MyFirstEPiSite”.

EPiDeploymentConfigureSite

Note that the URL that I’ve defined is “local.myfirstepisite” and port “80”. You’ll be unable to reach this URL until we’ve modified the hosts file in Windows. But more on that later!

The next step is to configure the database. I’ll be leaving it as is. Just give the user account that will be accessing the database a password (e.g. Secret123!).

Leave the Optional Modules checkboxes empty. We don’t require any public templates in our site.

We won’t be adding a license file. You can, however, retrieve one from the EPiServer License center.

The installation will now commence and at the end it’ll open a browser session and try to navigate to local.myfirstepisite. Your browser won’t recognize this URL and will return with a “404 Not Found” http error. This is OK.

 EPiDeploymentCannotDisplayPage

Modifying the hosts-file

We need to edit our “hosts”-file which will enable us to resolve the URL “local.myfirstepisite” to the IP-adress 127.0.0.1 which is our local computer. You’ll find the hosts file in the folder “c:windowssystem32driversetc”. Open it with notepad (or your favorite text editor of choice).

HostsFile

ConfiguringHostsFile

Now we’ll be able to navigate to the website. But you might hit a snag with this problem.

LoginFailedFordbUserMyFirstEpiSite

Enable SQL Server to support mixed mode authentication

Breathe easy. Nothing is wrong with your account (probably! :)). Instead your SQL Server Express installation does not support mixed mode authentication. Let’s get this sorted out.

Open “SQL Management Studio”. Login with your windows account. Right click the root (computer name) in the tree structure and select Properties. Now select the Security page and enable “SQL Server and Windows Authentication mode”. Restart the SQL Server for the changes to take effect.

SQLMixedMode

Refresh your browser and you should see this.

GoodToGo

Awesome! 🙂 And it’s true; behind every great… yeah, you get it.

Creating the Visual Studio project

Time to create a new project in visual studio. Choose ASP.NET Web Application as the project template.

NewWebsiteProject

Your project will look something like this.

ProjectBefore

The highlighted areas are files and content that should be deleted. We’ll be copying the source files and configuration files from the EPiServer website installation we performed earlier.

Create the folder structures for “[configuration]”, “[assemblies]” and “Templates” as shown in the image below.

PRojectFolderStructure

Done? Good! Let’s continue.

Copy the EPiServer CMS files

Navigate to the folder where your EPiServer website was installed by the deployment center. This should be “C:EPiServerSitesMyFirstEPiSite”. We’re interested in the EPiServer CMS binaries. So head into the “bin”-folder and copy all the DLLs to the [assemblies]-folder in our Visual Studio project.

CopyAssemblies

Now add these assemblies you just copied as references in your Visual Studio project.

AddAssembliesAsReferences

These files must be copied to the bin folders when you compile the website. So highlight all the EPiServer assemblies you’ve just added as references and set “Copy local” to true.

SetCopyLocalToTrue

Copy the configuration files into the three configuration folders: debug, staging and release.

CopyConfigFiles

Copy the folders “App_Browsers” and “lang” into your project. Finally the file “global.asax” should be copied as well.

CopyProjectFiles 

Now your project folder should look something like this.

FinalizingProjectFolderStructure

Add build events to the project

Add the following pre-build event to the project: copy “$(ProjectDir)[Configuration]$(ConfigurationName)*.config” “$(ProjectDir)” /y

image 

Configure the IIS to point to your folder

The IIS is still configured to use the “c:EPiServersitesMyFirstEPiSite” folder. Let’s change this so that the home directory of the website is our project folder. Open the IIS Manager and change this.

IISAdvancedSettings

Right click “MyFirstEPiSite”, select “Manage Website” and then select “Advanced Settings”. Change the “Physical Path”-property to your development folder.

IISPhysicalPath

Build the website and navigate to it

Now build the website and navigate to the URL “local.myfirstepisite”. You should just see a blank page. That’s OK. Navigate to “local.myfirstepisite/MyfirstUI/CMS/admin”. You should be confronted with a login screen. That’s OK. We’re going to enable the site to use the SQL Server providers.

On to part 2!

daniel
daniel
Developer
Recent Posts
  • Cecilia Magnusson

    Excellent post Daniel!
    A problem I came across was that my IIS-user was unable to access my project folder. The site showed a "Server Application Unavailable" message and in the event log I found the following message: "Failed to execute request because the App-Domain could not be created. Error: 0x80070005 Access is denied." I solved the problem by adding sufficient right to my IIS-account (in my case IIS_WPG) for my project folder. Hopefully this will be help for other EPiServer newbies!!

  • Right you are, Cecilia. 🙂 If you haven’t enabled impersonation (which you shouldn’t for an EPiServer-website!) then the executing account will be the one you have defined in your application pool. This is the user context the website will run under.

    On a .NET-level the worker process will try to create an application domain running under the account defined. 🙂

    Good catch! Cheers! 🙂

  • Kumar Jalli

    Hi Daniel,

    thank you for your post.

    i followed ur steps for installing and its working but

    when i am installing the epi server 7 cms

    in installation step 4 i.e after configuring the SQL Server database

    i checked the option Install alloy sample site

    and continuing the installation

    but i am getting the error

    Error – The modules finder couldn’t find a directory at ‘/PractiseUI/56a8c015c8a844928e588f7998156d00/’

    Parameter name: moduleResourcePath

    and PractiseUI is the path given in episerver user interface relative path textbox

    please help….

  • pankaj

    Hi Daniel,

    thank for post.

    i Modifying the hosts-file but still facing could not find local.myepiserversite..

Contact Us

We're not around right now. But you can send us an email and we'll get back to you, asap.

Not readable? Change text. captcha txt

Start typing and press Enter to search