Showing posts with label installation. Show all posts
Showing posts with label installation. Show all posts

Monday, December 19, 2011

Installing Sitecore with PowerShell


I have more than 30 Sitecore instances on my laptop, and I often need to have a clean of a specific version/revision of the product done quick.

With all the love PowerShell is having around Sitecore community, I have dreamed up a quick install script that performs the following actions:

Wednesday, October 27, 2010

Securing Sitecore Admin


Greetings,

One of the frequent questions I am hearing besides development related stuff is configuration related. In Sitecore world, there is always plenty of options available for you in terms of configuring your production environment. Not to get carried away, but this is really a critical aspect, especial for large enterprises. When your product cannot be flexible enough to be decoupled in components, this may represent quite a challenge. Systems forcing large footprint are more difficult to maintain, backup, secure, etc.
With Sitecore, you can pretty much create a lightweight Content Delivery instance by cutting down the configuration and files to mere 50 Mb quite with a little bit of effort. This will create a more manageable and secure environment, but what if you don’t want to go through this exercise?

A quick and proven way to handle this it rely on native IIS securing features. With IIS7 you can do that even easier. What you can do is simply deny access to /sitecore folder based on IP restrictions.

1. Make sure you have “IP Security” feature installed for IIS:

image

2. Locate your site in IIS, select /sitecore folder:

image

3. On the Features view, select “IP Address and Domain Restrictions”:

image

4. Configure any allow/deny rules you want:

image

Isn’t it easy?

Sunday, December 13, 2009

WFFM 2.0 module: Form Reports Viewer throws exception


If you are like me who enjoys stripping down Sitecore solution as much as possible, you may stumble across this as well.

On Sitecore 6.1/6.2 install with awesome Web Forms for Marketers module 2.0, you may get the following exception if your bin folder is missing SQLite assemblies (Sitecore.SQLite.dll and System.Data.SQLite.DLL). Even if you are not using SQLite, apparently, there is a dependency on these guys from the module’s assemblies. Putting them back obviously solves the problem.

Server Error in '/' Application.


Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.]

System.Reflection.Module._GetTypesInternal(StackCrawlMark& stackMark) +0

System.Reflection.Assembly.GetTypes() +111

System.Data.Metadata.Edm.AssemblyCacheEntry.LoadTypesFromAssembly(LoadingContext context) +28

System.Data.Metadata.Edm.AssemblyCacheEntry.InternalLoadAssemblyFromCache(LoadingContext context) +290

System.Data.Metadata.Edm.AssemblyCacheEntry.LoadAssemblyFromCache(Assembly assembly, Boolean loadReferencedAssemblies, Dictionary`2 knownAssemblies, Dictionary`2& typesInLoading, List`1& errors) +137

System.Data.Metadata.Edm.ObjectItemCollection.LoadAssemblyFromCache(ObjectItemCollection objectItemCollection, Assembly assembly, Boolean loadReferencedAssemblies) +284

System.Data.Metadata.Edm.ObjectItemCollection.LoadAssemblyForType(Type type) +33

System.Data.Metadata.Edm.MetadataWorkspace.LoadAssemblyForType(Type type, Assembly callingAssembly) +80

System.Data.Common.Utils.MetadataHelper.TryDetermineCSpaceModelType(MetadataWorkspace workspace, EntityType& modelEntityType) +67

System.Data.Objects.ObjectContext.ExecuteFunction(String functionName, ObjectParameter[] parameters) +238

Sitecore.Forms.Data.SitecoreWebFormsContext.GetFormsByMainParams(Nullable`1 formId, String storageName, Nullable`1 pageIndex, Nullable`1 pageSize, Nullable`1 asc, ObjectParameter returnValue) +593

Sitecore.Forms.Data.DataProviders.WFMDataProvider.GetForms(QueryParams queryParams, Int32& total) +911

Sitecore.Forms.Data.DataProvider.GetPage(PageCriteria page, IList`1 sort, IList`1 filters) +534

Sitecore.Form.DataViewer.SortedFilterable`1.GetPage(PageCriteria page, IList`1 sort, IList`1 filter) +55

Sitecore.Form.Core.DataViewer.FormGridSource`1.GetEntries(Int32 pageIndex, Int32 pageSize) +104

Sitecore.Form.DataViewer.ComponentArtGridHandler`1.GetDataSource(Int32 pageIndex, Int32 pageSize) +56

Sitecore.Form.DataViewer.ComponentArtGridHandler`1.ApplyDataSource() +76

Sitecore.Form.DataViewer.ComponentArtGridHandler`1.Grid_NeedDataSource(Object sender, EventArgs e) +54

ComponentArt.Web.UI.Grid.OnNeedDataSource(EventArgs e) +36

ComponentArt.Web.UI.Grid.DataBind() +475

Sitecore.Form.DataViewer.ComponentArtGridHandler`1.DataBind() +17

Sitecore.Form.DataViewer.ComponentArtGridHandler`1.InitializeGrid(Boolean dataBind) +503

Sitecore.Form.DataViewer.ComponentArtGridHandler`1..ctor(Grid grid, IGridSource`1 source, Boolean dataBind) +173

Sitecore.Form.DataViewer.ComponentArtGridHandler`1.Manage(Grid grid, IGridSource`1 source, Boolean dataBind) +94

Sitecore.Forms.Shell.UI.FormDataViewer.FormDataViewerPage.GridRender(Boolean update) +360

Sitecore.Forms.Shell.UI.FormDataViewer.FormDataViewerPage.OnPageSelected(Object sender, MultiPageSelectEventArgs e) +110

Sitecore.Forms.Shell.UI.FormDataViewer.FormDataViewerPage.OnLoad(EventArgs e) +223

System.Web.UI.Control.LoadRecursive() +50

System.Web.UI.Control.LoadRecursive() +141

System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627


Version Information: Microsoft .NET Framework Version:2.0.50727.4927; ASP.NET Version:2.0.50727.4927

Friday, December 11, 2009

Friday case: Sitecore is not starting up


Just had to deal with a pretty mysterious issue when my Sitecore app stopped staring up for whatever reasons.
Symptoms:
- nothing happens, browser just hangs with the “Connecting…” message
- nothing in the Sitecore logs
- nothing in the Event Viewer
- nothing unusual on the SQL side
- nothing unusually heavy on the worker process – CPU is idling out, memory is fine.

In overall, a sign that something is inherently wrong.

Thursday, September 03, 2009

Announcement: Partial (Item) Cache Clearing Module - SitecoreStager


Great news! We have released a shared source component that implements partial cache clearing model. Make sure to download the tool and read more about it. Since it is Shared Source, make sure you understand the support restrictions, etc. first before deploying the tool to production.

This tool does not substitute the Staging module as it provides cache clearing only, not file upload/download functionality.

For the implementations with frequent publish operations enabled (from workflow or single item publishes) and especially for multisite environments, this will significantly improve the performance of the delivery system and take the load off the SQL Server.

What I love about the tool is that the code is available so if there are specific architectural considerations for your implementation, you can reuse the code and implement the solution that fits your needs.

Kudos to Alexey Romaniuha for the actual implementation.

Enjoy and don’t forget to provide feedback!

Friday, July 17, 2009

Registry Cache for “website”


Applies to 5.3.x and 6.0.x.
Recently discovered issue with disabled “registry” cache can potentially increase chattiness of your Sitecore web server with SQL Server.

Basically what happens is regular SQL selects from ‘Properties’ table that stores user-based registry settings for a current site. The call is initiated by Item.DisplayName property which is frequently used on the delivery boxes too. This is not a problem for the authoring environments that operate in the context of “shell” site by default since the registry cache is enabled there. This is not the case for “website”*** as two places where this may be changed contain zeros:

<site name="website" … registryCacheSize="0" …  />

<cacheSizes>
  <sites>
    <website>
     <html>10MB</html>
     <registry>0</registry>
     <viewState>0</viewState>
      <xsl>5MB</xsl>
    </website>
   </sites>
</cacheSizes>

The way to fix this is to simply adjust the value of registry cache. You can try 1KB and monitor the /sitecore/admin/cache.aspx page to see the actual consumption. From my experience, it is rarely even approaching 1KB in most installations unless you are writing something there with custom code.

This will be officially documented as a known issue and published on SDN.

In meantime, go ahead and put it in your web.config ;-)

*** If you have a multisite environment, change this on the level of your custom site definition responsible for the front-end requests. If in doubt, let me know.

Tuesday, May 12, 2009

Updated: Standalone apps under Sitecore web root


As this article suggests, it is possible though not officially recommended. Here is an update for what you need to do in Sitecore 6.x to make it happen.

***Updated. (Thanks to the commenters):

The easiest way to do it, especially if you don’t want to inherit anything from the parent Sitecore configuration down to your asp.net app is to use the <location /> config element with inheritInChildApplications="false". With this element you can wrap most config sections like <system.web />, <system.webserver />, etc:

image

It is worth mentioning that not all configuration sections can be wrapped into the <location /> element.

========================================

- Open the web.config of your standalone web app.
- Locate <httpHandlers>section under <system.web> and remove Sitecore specific http handlers:

<httpHandlers>
   <remove verb="*" path="sitecore_media.ashx"/>
   <remove verb="*" path="sitecore_xaml.ashx"/>
   <remove verb="*" path="sitecore_icon.ashx"/>
   ...
</httpHandlers>

- Do the same thing for httpModules section:

<httpModules>
   <remove name="SitecoreHttpModule" />
   <remove name="SitecoreUploadWatcher" />
   <remove name="SitecoreXslWatcher" />
   <remove name="SitecoreLayoutWatcher" />
   <remove name="SitecoreConfigWatcher" />
   ...
</httpModules>

- If you are running on IIS7 in integrated mode, you will need to the same thing for the <system.webServer> section:

<modules runAllManagedModulesForAllRequests="true">
   <remove name="SitecoreHttpModule" />
   <remove name="SitecoreUploadWatcher" />
   <remove name="SitecoreXslWatcher" />
   <remove name="SitecoreLayoutWatcher" />
   <remove name="SitecoreConfigWatcher" />
   ...
</modules>
 
<handlers>
   ...
   <remove name="Sitecore.MediaRequestHandler" />
   <remove name="Sitecore.XamlPageRequestHandler" />
   <remove name="Sitecore.IconRequestHandler" />
   ...
</handlers>
 
- Your standalone app will most likely use its own membership provider(s), so you will need to disable Sitecore membership provider:
<membership defaultProvider="AspNetSqlMembershipProvider">
   <providers>
      <remove name="sitecore" />
      ...
   </providers>
</membership>

- If neither role nor profile providers are used, disable them or if you do use them, add the remove statement the same way as it it shown above for the membership provider.

<profile enabled="false">
   ...
</profile>
<roleManager enabled="false">
   ...
</roleManager>

This way you can easily have an MVC app running in a virtual application (separate pool) of your Sitecore website.

Thursday, April 09, 2009

How to troubleshoot SQL connection issues


Had a problem with remote web app not connection to newly installed SQL Server. Was getting generic “A network-related or instance-specific error occurred while establishing a connection to SQL Server…”

Found this great article with the breakdown of possible scenarios, very useful. Mine was #6, SQLBrowser not running. Was clicking too fast through the installation ;-)

Thursday, December 11, 2008

Changing the application pool identity for Sitecore


Though the Sitecore installer does not support Windows authentication yet, it is possible to reconfigure the system manually after the installation.
In production environments where security considerations represent a major concern, using a SQL user as well as having username and password specified as clear text in the connection string might be undesirable.
Production SQL Server boxes generally reside on a different machine that do not have access to the account the Sitecore application process in authenticated. That’s why the same domain user should be used for both Windows authentication on the SQL Server box and the application pool identity on the web server where Sitecore is running.

Here are the steps to configure this:

  1. Find the application pool that your Sitecore is running under. Open Properties and set the identity to the domain user on the corresponding tab.
  2. On the SQL Server box register the domain user and grant security permissions on Sitecore databases for the domain user according to the section “3.7.2 Creating a Database Account for Sitecore CMS Databases on SQL Server 2005” of the Installation Guide.
  3. On the machine that hosts Sitecore add this domain user to the IIS_WPG group.
  4. Adjust the permissions for the IIS_WPG group according to this section of the Installation Guide “3.6 Configuring Folder Permissions”.
  5. Edit the /App_Config/ConnectionStrings.config file and replace the user id and password parameters with the trusted_connection=yes option:
  6. <?xml version="1.0" encoding="utf-8"?>
      <connectionStrings>
        <add name="core" connectionString="Data Source=.\sql2008;Database=Sandbox6_Core;Trusted_Connection=Yes" />
        <add name="master" connectionString="Data Source=.\sql2008;Database=Sandbox6_Master;Trusted_Connection=Yes" />
        <add name="web" connectionString="Data Source=.\sql2008;Database=Sandbox6_Web;Trusted_Connection=Yes" />
    </connectionStrings>
  7. Prepare your identity so it can be used as a service account with “aspnet_regiis.exe” and the -ga switch.
  8. Adjust your global.asax so two methods are executed on Application_Start:
    public void Application_Start()
    {
       System.Security.Cryptography.RSACryptoServiceProvider.UseMachineKeyStore = true;
       System.Security.Cryptography.DSACryptoServiceProvider.UseMachineKeyStore = true;
    }

Notes:
- Anonymous access to the website is still enabled, using the IUSR account. Also the impersonation is still disabled in the web.config as by default.
- ASP.NET cannot send NT credentials over network if SQL server name is resolved using HOSTS file though accessing the same server using NetBIOS name or IP address works fine.