Top Tips To Get An Existing Episerver Project Up And Running
I work frequently with numerous clients on different projects and the first big hurdle in being able to make any impactful changes is being able to get the existing site up and running on your development machine. In some instances, you might be working with an existing team and they can help you get everything you need, in some situations they have an amazing continuous integration process sorted and you can pull the source code from a repository, it magically works and off you go.. In other situations, you will be the only developer, the handover notes are next to nothing and it's up to you to figure it all out. If you find yourself in these shoes, then getting a site up and running can be stressful. You are likely just starting with a new company and you want to show you have mad coding skills, but you can't do a simple thing like get the site up and running. I've been in this situation far more times than I can remember (mainly as I've got a bad memory), so in today's guide I'm going to cover the rough process I follow when I'm trying to get an unknown website up and running,
Where To Start?Knowing where to start can be tricky. I'm assuming at this point that you've got a copy of the source code, a database, tried to compile the site and the beautiful site you were expecting to set your eyes on has been replaced by some form of error message. If the error message is a friendly error that's masking the real problem, the first thing to do is go to the web.config and disable custom errors. In the web.config there are two sections you should always check, first, the custom errors section:
<customErrors mode="Off"> <error statusCode="404" redirect="/page-not-found/" /> </customErrors>Note the mode, should be set to 'Off'. Second, you need to make sure the errorMode is set to DetailedLocalOnly. In most situations, this will be set to 'Custom' and will hide the IIS message.
<httpErrors existingResponse="Auto" errorMode="DetailedLocalOnly"> <remove statusCode="404" subStatusCode="-1" /> </httpErrors>In case you are confused as to why your web.config require two sections, the section for dealing with error pages on an application basis deals with errors thrown by IIS. Both of these can hamper your investigation skills.
Finding The Log FilesChecking your website's log files should always be one of your first go to moves, however, in some builds simply finding the logs can be painful. In modern versions of Episerver the logs, by default are in the 'App_data' folder. Under the hood, Episerver uses Log4Net as the log handling provider. As Log4Net is so flexible, changing the location of the logs is easy and usually for 'best practice' keeping the logs within the webroot isn't advisable, so it's only normal people change the log location. The problem with changing the location is that finding it can be hard. Instead, you will need to open up 'EPiServerLog.config' and find the 'fileLogAppender' file location property. This should point you in the right direction to find the log files.
Troubleshooting Your Episerver WebsiteIn the majority of situations the reason a site fails to load can be broken into the following categories:
Missing Epi ProductsIf the site is reliant on one of the other Episerver bolt-ons, like the CMO, then you will need to install it before your site works. One tip to spot if your site is using the CMO is that is you should see errors complaining about 'ComponentArt.Web.Visualization'. In your web.config you should see a reference to this handler:
ComponentArt.Web.Visualization.Charting.CachedImageServiceIf you need to install the CMO you can either use the old school deployment centre to install it, or you could use the trick below: