<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Fredrik Haglund's blog &#187; enableRemoteEvents</title>
	<atom:link href="http://blog.fredrikhaglund.se/blog/tag/enableremoteevents/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.fredrikhaglund.se</link>
	<description>Chatter about EPiServer, ASP.NET, CSS and Web Development.</description>
	<lastBuildDate>Tue, 07 Sep 2010 08:55:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>EPiServer CMS: How to configure Remote Events with many servers and Firewalls between them</title>
		<link>http://blog.fredrikhaglund.se/blog/2009/09/22/episerver-cms-how-to-configure-remote-events-with-many-servers-and-firewalls-between-them/</link>
		<comments>http://blog.fredrikhaglund.se/blog/2009/09/22/episerver-cms-how-to-configure-remote-events-with-many-servers-and-firewalls-between-them/#comments</comments>
		<pubDate>Tue, 22 Sep 2009 20:40:22 +0000</pubDate>
		<dc:creator>Fredrik Haglund</dc:creator>
				<category><![CDATA[EPiServer]]></category>
		<category><![CDATA[enableRemoteEvents]]></category>
		<category><![CDATA[EPiServer 5]]></category>
		<category><![CDATA[EPiServer CMS]]></category>
		<category><![CDATA[RemoteEventsBinding]]></category>
		<category><![CDATA[WCF]]></category>

		<guid isPermaLink="false">http://blog.fredrikhaglund.se/blog/2009/09/22/episerver-cms-how-to-configure-remote-events-with-many-servers-and-firewalls-between-them/</guid>
		<description><![CDATA[The Event Management System in EPiServer CMS 5 is used to propagate information that a page has changed to other web servers connected to the same database. This is very important to setup if you have more than one web server or an enterprise site with several start pages because if it does not invalidate [...]]]></description>
			<content:encoded><![CDATA[<p>The Event Management System in EPiServer CMS 5 is used to propagate information that a page has changed to other web servers connected to the same database. </p>
<p>This is very important to setup if you have more than one web server or an enterprise site with several start pages because if it does not invalidate cache, the other web sites can potentially return old versions of a page!</p>
<h3>Pitfall – Default configuration is using Multicast UDP!</h3>
<p>If you read <a href="http://world.episerver.com/Documentation/Items/Tech-Notes/EPiServer-CMS-5/EPiServer-CMS-5-R2-SP2/Configuring-EPiServer-CMS-5-R2-SP2-Enterprise/">Configuring EPiServer CMS 5 R2 SP2 Enterprise</a> you will learn that all you have to do is to set <code>enableRemoteEvents=&quot;true&quot;</code> in <em>web.config</em>. </p>
<p>It is only mentioned briefly that it is using UDP and you may have to change your firewall settings. Too be more specific the default configuration is using multicast UDP broadcast! Tell this to your network guys and watch their reaction&#8230;</p>
<p>If you look around you will also find a tech note about the <a href="http://world.episerver.com/Documentation/Items/Tech-Notes/EPiServer-CMS-5/EPiServer-CMS-5-R2-SP2/Event-Management-System-Specification/">Event Management System Specification</a> and a FAQ about <a href="http://world.episerver.com/FAQ/Items/Multicast-UDP-not-working/">setting up a server to use TCP protocol</a> but not all clues needed are found there – you have to dig with the reflector to find out the rest.</p>
<h3>Scenario: 4 start pages, 8 Front-end servers IN DMZ and 2 in LAN</h3>
<p>You can change how the Event Management System communicates by changing WCF settings in <em>web.config</em>. It is possible to use TCP instead of UDP and also specify ports to use.</p>
<p>First, the current release (5 R2 SP2) does not support WCF Port Sharing so we need one port opened in the firewall for each start page (that is when you have several <em>siteSettings</em>-tags in web.config).</p>
<p>In our case we need to get four ports (for example port 13000-13003) opened in the firewall for TCP traffic between servers in DMZ and LAN.</p>
<p>Use the sample configuration below as a template to get it to work. In production I suggest using <em>configSource</em>-attribute in <em>web.config</em> to keep the WCF-settings in separate files.</p>
<h4>Web.Config</h4>
<pre class="code"><span style="color: blue">&lt;</span><span style="color: #a31515">system.serviceModel</span><span style="color: blue">&gt;
  &lt;</span><span style="color: #a31515">services </span><span style="color: red">configSource</span><span style="color: blue">=</span>&quot;<span style="color: blue">system.serviceModel.services.config</span>&quot; <span style="color: blue">/&gt;
  &lt;</span><span style="color: #a31515">client </span><span style="color: red">configSource</span><span style="color: blue">=</span>&quot;<span style="color: blue">system.serviceModel.client.config</span>&quot; <span style="color: blue">/&gt;
  &lt;</span><span style="color: #a31515">behaviors</span><span style="color: blue">&gt;
    &lt;</span><span style="color: #a31515">serviceBehaviors</span><span style="color: blue">&gt;
      &lt;</span><span style="color: #a31515">behavior </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">DebugServiceBehaviour</span>&quot;<span style="color: blue">&gt;
        &lt;!--</span><span style="color: green">TODO: the option should be only in test environment true in the production should be false</span><span style="color: blue">--&gt;
        &lt;</span><span style="color: #a31515">serviceDebug </span><span style="color: red">includeExceptionDetailInFaults</span><span style="color: blue">=</span>&quot;<span style="color: blue">true</span>&quot; <span style="color: blue">/&gt;
      &lt;/</span><span style="color: #a31515">behavior</span><span style="color: blue">&gt;
    &lt;/</span><span style="color: #a31515">serviceBehaviors</span><span style="color: blue">&gt;
  &lt;/</span><span style="color: #a31515">behaviors</span><span style="color: blue">&gt;
  &lt;</span><span style="color: #a31515">bindings</span><span style="color: blue">&gt;
    &lt;</span><span style="color: #a31515">netTcpBinding</span><span style="color: blue">&gt;
      &lt;</span><span style="color: #a31515">binding </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">RemoteEventsBinding</span>&quot;<span style="color: blue">&gt;
        &lt;</span><span style="color: #a31515">security </span><span style="color: red">mode</span><span style="color: blue">=</span>&quot;<span style="color: blue">None</span>&quot; <span style="color: blue">/&gt;
      &lt;/</span><span style="color: #a31515">binding</span><span style="color: blue">&gt;
    &lt;/</span><span style="color: #a31515">netTcpBinding</span><span style="color: blue">&gt;
  &lt;/</span><span style="color: #a31515">bindings</span><span style="color: blue">&gt;
&lt;/</span><span style="color: #a31515">system.serviceModel</span><span style="color: blue">&gt;</span></pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<h4>system.serviceModel.services.config</h4>
<p>Use this to configure WCF Services (listens to incoming messages). Setup one service for each EPiServer site-tag.</p>
<ul>
<li>Name should be unique. </li>
<li>Name must be the value of episerver/sites[siteid] plus &quot;/EPiServer.Events.Remote.EventReplication&quot;, i.e. if siteId is “sss.se” then name should be “sss.se/EPiServer.Events.Remote.EventReplication”. </li>
<li>Each site must use a diffrent port in services/service/endpoint[address]. </li>
<li>Use &quot;localhost&quot; in the address attribute to bind to all NIC on the machine. </li>
</ul>
<pre class="code"><span style="color: blue">&lt;</span><span style="color: #a31515">services</span><span style="color: blue">&gt;
  &lt;</span><span style="color: #a31515">service </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">sss.se/EPiServer.Events.Remote.EventReplication</span>&quot; <span style="color: red">behaviorConfiguration</span><span style="color: blue">=</span>&quot;<span style="color: blue">DebugServiceBehaviour</span>&quot;<span style="color: blue">&gt;
    &lt;</span><span style="color: #a31515">endpoint </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">RemoteEventServiceEndPoint</span>&quot; <span style="color: red">contract</span><span style="color: blue">=</span>&quot;<span style="color: blue">EPiServer.Events.ServiceModel.IEventReplication</span>&quot; <span style="color: red">bindingConfiguration</span><span style="color: blue">=</span>&quot;<span style="color: blue">RemoteEventsBinding</span>&quot; <span style="color: red">address</span><span style="color: blue">=</span>&quot;<span style="color: blue">net.tcp://localhost:13000/RemoteEventService</span>&quot; <span style="color: red">binding</span><span style="color: blue">=</span>&quot;<span style="color: blue">netTcpBinding</span>&quot; <span style="color: blue">/&gt;
  &lt;/</span><span style="color: #a31515">service</span><span style="color: blue">&gt;
  &lt;</span><span style="color: #a31515">service </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">sss.no/EPiServer.Events.Remote.EventReplication</span>&quot; <span style="color: red">behaviorConfiguration</span><span style="color: blue">=</span>&quot;<span style="color: blue">DebugServiceBehaviour</span>&quot;<span style="color: blue">&gt;
    &lt;</span><span style="color: #a31515">endpoint </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">RemoteEventServiceEndPoint</span>&quot; <span style="color: red">contract</span><span style="color: blue">=</span>&quot;<span style="color: blue">EPiServer.Events.ServiceModel.IEventReplication</span>&quot; <span style="color: red">bindingConfiguration</span><span style="color: blue">=</span>&quot;<span style="color: blue">RemoteEventsBinding</span>&quot; <span style="color: red">address</span><span style="color: blue">=</span>&quot;<span style="color: blue">net.tcp://localhost:13001/RemoteEventService</span>&quot; <span style="color: red">binding</span><span style="color: blue">=</span>&quot;<span style="color: blue">netTcpBinding</span>&quot; <span style="color: blue">/&gt;
  &lt;/</span><span style="color: #a31515">service</span><span style="color: blue">&gt;
  &lt;</span><span style="color: #a31515">service </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">sss.dk/EPiServer.Events.Remote.EventReplication</span>&quot; <span style="color: red">behaviorConfiguration</span><span style="color: blue">=</span>&quot;<span style="color: blue">DebugServiceBehaviour</span>&quot;<span style="color: blue">&gt;
    &lt;</span><span style="color: #a31515">endpoint </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">RemoteEventServiceEndPoint</span>&quot; <span style="color: red">contract</span><span style="color: blue">=</span>&quot;<span style="color: blue">EPiServer.Events.ServiceModel.IEventReplication</span>&quot; <span style="color: red">bindingConfiguration</span><span style="color: blue">=</span>&quot;<span style="color: blue">RemoteEventsBinding</span>&quot; <span style="color: red">address</span><span style="color: blue">=</span>&quot;<span style="color: blue">net.tcp://localhost:13002/RemoteEventService</span>&quot; <span style="color: red">binding</span><span style="color: blue">=</span>&quot;<span style="color: blue">netTcpBinding</span>&quot; <span style="color: blue">/&gt;
  &lt;/</span><span style="color: #a31515">service</span><span style="color: blue">&gt;
  &lt;</span><span style="color: #a31515">service </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">sss.com/EPiServer.Events.Remote.EventReplication</span>&quot; <span style="color: red">behaviorConfiguration</span><span style="color: blue">=</span>&quot;<span style="color: blue">DebugServiceBehaviour</span>&quot;<span style="color: blue">&gt;
    &lt;</span><span style="color: #a31515">endpoint </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">RemoteEventServiceEndPoint</span>&quot; <span style="color: red">contract</span><span style="color: blue">=</span>&quot;<span style="color: blue">EPiServer.Events.ServiceModel.IEventReplication</span>&quot; <span style="color: red">bindingConfiguration</span><span style="color: blue">=</span>&quot;<span style="color: blue">RemoteEventsBinding</span>&quot; <span style="color: red">address</span><span style="color: blue">=</span>&quot;<span style="color: blue">net.tcp://localhost:13003/RemoteEventService</span>&quot; <span style="color: red">binding</span><span style="color: blue">=</span>&quot;<span style="color: blue">netTcpBinding</span>&quot; <span style="color: blue">/&gt;
  &lt;/</span><span style="color: #a31515">service</span><span style="color: blue">&gt;
&lt;/</span><span style="color: #a31515">services</span><span style="color: blue">&gt;</span></pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<h4>system.serviceModel.client.config</h4>
<p>And each server that changes the content must also be aware of where to send notifications so we must list all servers and websites. </p>
<ul>
<li>Name should be unique. </li>
<li>It is better if address contains IP-addresses than hostnames. </li>
<li>There should be one endpoint for each website on a server where port number matches the ports used in the services/service/endpoint[address]. </li>
</ul>
<pre class="code"><span style="color: blue">&lt;</span><span style="color: #a31515">client</span><span style="color: blue">&gt;
  &lt;!-- </span><span style="color: green">SERVER1 </span><span style="color: blue">--&gt;
  &lt;</span><span style="color: #a31515">endpoint </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">sss.se-SERVER1</span>&quot; <span style="color: red">contract</span><span style="color: blue">=</span>&quot;<span style="color: blue">EPiServer.Events.ServiceModel.IEventReplication</span>&quot; <span style="color: red">bindingConfiguration</span><span style="color: blue">=</span>&quot;<span style="color: blue">RemoteEventsBinding</span>&quot; <span style="color: red">address</span><span style="color: blue">=</span>&quot;<span style="color: blue">net.tcp://SERVER1:13000/RemoteEventService</span>&quot; <span style="color: red">binding</span><span style="color: blue">=</span>&quot;<span style="color: blue">netTcpBinding</span>&quot; <span style="color: blue">/&gt;
  &lt;</span><span style="color: #a31515">endpoint </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">sss.no-SERVER1</span>&quot; <span style="color: red">contract</span><span style="color: blue">=</span>&quot;<span style="color: blue">EPiServer.Events.ServiceModel.IEventReplication</span>&quot; <span style="color: red">bindingConfiguration</span><span style="color: blue">=</span>&quot;<span style="color: blue">RemoteEventsBinding</span>&quot; <span style="color: red">address</span><span style="color: blue">=</span>&quot;<span style="color: blue">net.tcp://SERVER1:13001/RemoteEventService</span>&quot; <span style="color: red">binding</span><span style="color: blue">=</span>&quot;<span style="color: blue">netTcpBinding</span>&quot; <span style="color: blue">/&gt;
  &lt;</span><span style="color: #a31515">endpoint </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">sss.dk-SERVER1</span>&quot; <span style="color: red">contract</span><span style="color: blue">=</span>&quot;<span style="color: blue">EPiServer.Events.ServiceModel.IEventReplication</span>&quot; <span style="color: red">bindingConfiguration</span><span style="color: blue">=</span>&quot;<span style="color: blue">RemoteEventsBinding</span>&quot; <span style="color: red">address</span><span style="color: blue">=</span>&quot;<span style="color: blue">net.tcp://SERVER1:13002/RemoteEventService</span>&quot; <span style="color: red">binding</span><span style="color: blue">=</span>&quot;<span style="color: blue">netTcpBinding</span>&quot; <span style="color: blue">/&gt;
  &lt;</span><span style="color: #a31515">endpoint </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">sss.com-SERVER1</span>&quot; <span style="color: red">contract</span><span style="color: blue">=</span>&quot;<span style="color: blue">EPiServer.Events.ServiceModel.IEventReplication</span>&quot; <span style="color: red">bindingConfiguration</span><span style="color: blue">=</span>&quot;<span style="color: blue">RemoteEventsBinding</span>&quot; <span style="color: red">address</span><span style="color: blue">=</span>&quot;<span style="color: blue">net.tcp://SERVER1:13003/RemoteEventService</span>&quot; <span style="color: red">binding</span><span style="color: blue">=</span>&quot;<span style="color: blue">netTcpBinding</span>&quot; <span style="color: blue">/&gt;
  &lt;!-- </span><span style="color: green">SERVER2 </span><span style="color: blue">--&gt;
  &lt;</span><span style="color: #a31515">endpoint </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">sss.se-SERVER2</span>&quot; <span style="color: red">contract</span><span style="color: blue">=</span>&quot;<span style="color: blue">EPiServer.Events.ServiceModel.IEventReplication</span>&quot; <span style="color: red">bindingConfiguration</span><span style="color: blue">=</span>&quot;<span style="color: blue">RemoteEventsBinding</span>&quot; <span style="color: red">address</span><span style="color: blue">=</span>&quot;<span style="color: blue">net.tcp://SERVER2:13000/RemoteEventService</span>&quot; <span style="color: red">binding</span><span style="color: blue">=</span>&quot;<span style="color: blue">netTcpBinding</span>&quot; <span style="color: blue">/&gt;
  &lt;</span><span style="color: #a31515">endpoint </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">sss.no-SERVER2</span>&quot; <span style="color: red">contract</span><span style="color: blue">=</span>&quot;<span style="color: blue">EPiServer.Events.ServiceModel.IEventReplication</span>&quot; <span style="color: red">bindingConfiguration</span><span style="color: blue">=</span>&quot;<span style="color: blue">RemoteEventsBinding</span>&quot; <span style="color: red">address</span><span style="color: blue">=</span>&quot;<span style="color: blue">net.tcp://SERVER2:13001/RemoteEventService</span>&quot; <span style="color: red">binding</span><span style="color: blue">=</span>&quot;<span style="color: blue">netTcpBinding</span>&quot; <span style="color: blue">/&gt;
  &lt;</span><span style="color: #a31515">endpoint </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">sss.dk-SERVER2</span>&quot; <span style="color: red">contract</span><span style="color: blue">=</span>&quot;<span style="color: blue">EPiServer.Events.ServiceModel.IEventReplication</span>&quot; <span style="color: red">bindingConfiguration</span><span style="color: blue">=</span>&quot;<span style="color: blue">RemoteEventsBinding</span>&quot; <span style="color: red">address</span><span style="color: blue">=</span>&quot;<span style="color: blue">net.tcp://SERVER2:13002/RemoteEventService</span>&quot; <span style="color: red">binding</span><span style="color: blue">=</span>&quot;<span style="color: blue">netTcpBinding</span>&quot; <span style="color: blue">/&gt;
  &lt;</span><span style="color: #a31515">endpoint </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">sss.com-SERVER2</span>&quot; <span style="color: red">contract</span><span style="color: blue">=</span>&quot;<span style="color: blue">EPiServer.Events.ServiceModel.IEventReplication</span>&quot; <span style="color: red">bindingConfiguration</span><span style="color: blue">=</span>&quot;<span style="color: blue">RemoteEventsBinding</span>&quot; <span style="color: red">address</span><span style="color: blue">=</span>&quot;<span style="color: blue">net.tcp://SERVER2:13003/RemoteEventService</span>&quot; <span style="color: red">binding</span><span style="color: blue">=</span>&quot;<span style="color: blue">netTcpBinding</span>&quot; <span style="color: blue">/&gt;
  &lt;!-- </span><span style="color: green">Repeat pattern above for all other servers and sites </span><span style="color: blue">--&gt;
&lt;/</span><span style="color: #a31515">client</span><span style="color: blue">&gt;</span></pre>
<p>Good luck! And let me know if this helps you or if you get stuck&#8230;</p>
<p><em>Credits to Petter Klang at EPiServer Support and Shahram Shahinzadeh on the backend dev team that has been helping us out.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fredrikhaglund.se/blog/2009/09/22/episerver-cms-how-to-configure-remote-events-with-many-servers-and-firewalls-between-them/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>
