Wednesday, February 10, 2016

Setting up web server and continuous integration

Apart from creating website & app-pool in IIS, there are several steps which need to be performed when setting a new website on server.

Setup Web Server

There are few activities which you have to perform on Web Server:
1. Install Web Deploy [Download]
2. Install URL Rewrite [Download]
3. Make Sure .Net Framework feature is ON in Windows features


4. Create a standard user which could be used to deploy files to web server after successful build
5. Open "services.msc" and check that 'Web Deployment Agent Service' is running with the standard user credentials created in Step 4.


6. Run App pool and website with same standard user which is created in Step 4
7. Reset IIS Server


Continuous Integration

There are several tools which are being used for continuous integration but they perform same functions when we discuss about build and deployment. In this example, we are referring Jenkins [Download].



If msdeploy or any relevant command is being used to deploy files on web server, same standard user credentials should be used to copy the content else it will throw unauthorized exception.

Common Exceptions

An item with the same key has already been added.
Solution: It can be resolved by checking Mime types. There is a probability that same Mime type is being added by web.config which is there in IIS already. In IIS 8, there is not need to add Mime types manually.

Website is appearing but css/font is not loading.
Solution: Open dev tools(if its chrome browser, press F12 key) and check if in console you are getting errors like 404, 500 etc. Check if css/font files are present in the right folder. If gulp or grunt is being used, make sure it is compiling the files without exception.

If any CMS is being used then there might be CMS related errors.

Sitecore has no necessary permissions for reading/creating counters. OR 
Sitecore publishing screen is showing 'Initializing' but not publishing anything.
Solution: Application pool user should be member of 'Performance Monitor User' group. Add user to this group and restart IIS. Even after this, if it does not work sitecore counter can be disabled by setting counter value to false. For example: <setting name"counters.enabled" value-"false"/>

Let me know if you still get any exception. Have a nice day!!