<?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>Dizid &#187; Scripting</title>
	<atom:link href="http://www.dizid.com/category/scripting/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dizid.com</link>
	<description>Advanced Websites</description>
	<lastBuildDate>Sun, 22 Jan 2012 17:15:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Running more domains (sites) on 1 hosting account.</title>
		<link>http://www.dizid.com/web-development/hosting/iis7-rewrite-module/</link>
		<comments>http://www.dizid.com/web-development/hosting/iis7-rewrite-module/#comments</comments>
		<pubDate>Tue, 10 Aug 2010 19:57:17 +0000</pubDate>
		<dc:creator>Marc de Ruijter</dc:creator>
				<category><![CDATA[Coldfusion]]></category>
		<category><![CDATA[Hosting]]></category>
		<category><![CDATA[Scripting]]></category>

		<guid isPermaLink="false">http://www.dizid.com/?p=347</guid>
		<description><![CDATA[The problem: sometimes you want more sites with their own domainname to run on your hosting account. For example, when i have a few testing- or low-traffic sites it&#8217;s much more economic (e.g. cheaper) to use just 1 hosting account for that. The other day i found this solutionfor a hosting plan with Windows 2008/IIS7 [...]]]></description>
			<content:encoded><![CDATA[<p>The problem: sometimes you want more sites with their own domainname to run on your hosting account. For example, when i have a few testing- or low-traffic sites it&#8217;s much more economic (e.g. cheaper) to use just 1 hosting account for that.</p>
<p>The other day i found this <a href="http://weblogs.asp.net/owscott/archive/2010/01/26/iis-url-rewrite-hosting-multiple-domains-under-one-site.aspx">solution</a>for a hosting plan with Windows 2008/IIS7 and Adobe Coldfusion 9 running.<br />
On Apache hosting plans you would just configure a few virtual hosts and/or use mod_rewrite and on a Microsoft platform it involves either installing IIS 7 Manager and the URL Rewrite module on your local PC or editing the web.config file directly.<br />
When connected with IIS 7 Manager to your (Windows) hosting provider, startup the URL Rewrite module. This is the GUI to web.config file which should be placed in the root of your hosting account and is also editable. </p>
<p>My web.config looks like this, adjust the example texts.<br />
<pre><code>
&lt; ?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;configuration&gt;
&lt;system .webServer&gt;
&lt;rewrite&gt;
&lt;rules&gt;
 &lt;rule name=&quot;Example 1&quot; stopProcessing=&quot;true&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp; &lt;match url=&quot;.*&quot; /&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;conditions&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;add input=&quot;{HTTP_HOST}&quot; pattern=&quot;^(www.)?example-site.info$&quot; /&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;add input=&quot;{PATH_INFO}&quot; pattern=&quot;^/example-site/&quot; negate=&quot;true&quot; /&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/conditions&gt;
&lt;action type=&quot;Rewrite&quot; url=&quot;\example-directory\{R:0}&quot; /&gt;
&lt;/rule&gt;
&lt;/rules&gt;
&lt;/rewrite&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/system&gt;
&lt;/configuration&gt;
</code></pre><br />
This should route all incoming HTTP requests for both www.example-site.info and example-site.info to the folder (directory) at the webhost through a &#8217;301 Moved Permanently&#8217;. So far it works with 4 domains, all with fairly low traffic so no problems with the fair use policy in a shared environment.</p>
<p>Here&#8217;s the &#8216;Getting Started&#8217; with <a href="https://help.webcontrolcenter.com/KB/a792/getting-started-with-iis-url-rewrite-windows-2008iis7.aspx?KBSearchID=114718">IIS URL Rewrite</a> (Windows 2008/IIS7) and some usefull <a href="http://ruslany.net/2009/04/10-url-rewriting-tips-and-tricks/">tips and tricks</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dizid.com/web-development/hosting/iis7-rewrite-module/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Starting a service through Powershell on the Windows 7 local PC</title>
		<link>http://www.dizid.com/web-development/coldfusion/starting-a-service-through-powershell-on-the-windows-7-local-pc/</link>
		<comments>http://www.dizid.com/web-development/coldfusion/starting-a-service-through-powershell-on-the-windows-7-local-pc/#comments</comments>
		<pubDate>Sat, 19 Sep 2009 12:33:17 +0000</pubDate>
		<dc:creator>Marc de Ruijter</dc:creator>
				<category><![CDATA[Coldfusion]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[service]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.dizid.com/?p=268</guid>
		<description><![CDATA[In 1 sentence Create a shortcut with &#8216;Run as administrator&#8217; properties which points to powershell.exe path\to\script.ps1  with 1  line in it:  Start-Service -displayname  &#8220;the-name-of-the-service-that-you-want-to-sart&#8221; and have  the right execution policy for PS scripts. The longer version Through Windows Powershell-scripts administrators can automate almost all computermanagement tasks. All things that can be done through visual windows [...]]]></description>
			<content:encoded><![CDATA[<h2>In 1 sentence</h2>
<p>Create a shortcut with &#8216;Run as administrator&#8217; properties which points to powershell.exe path\to\script.ps1  with 1  line in it:  Start-Service -displayname  &#8220;the-name-of-the-service-that-you-want-to-sart&#8221; and have  the right execution policy for PS scripts.</p>
<h2>The longer version</h2>
<p>Through Windows Powershell-scripts administrators can automate almost all computermanagement tasks. All things that can be done through visual windows -and more- can be done through Powershell scripts.</p>
<p>When you want to start, restart or stop services it can be usefull to do that through a shortcut on the desktop, here is how i start or restart the Coldfusion service on my local PC.</p>
<p>Before you can execute Powershell scripts on Windows systems, you first have to set an execution policy. To get the current execution policy, open a Powershell command window or ISE  (Start &gt; type powershell &gt; hit enter) &#8216;as administrator&#8217;  and type get-executionpolicy. To set the needed execution policy, type set-executionpolicy RemoteSigned.  Now start creating the shortcut which start the service:</p>
<p>1. Create a file start-cf-service.ps1 and add the following line in it:<br />
Restart-Service -displayname &#8220;ColdFusion 9 Application Server&#8221;<br />
Save the file somewhere and notice i wrote the &#8216;Restart-Service&#8217; command instead of &#8216;Start-Service&#8217; because i want the script to double as a restarting service command, which restarts a service when it is already running (which can be usefull when a service &#8216;hangs&#8217;) and just starts the service when it is not running.</p>
<p>If this is the first time you are running Powershell scripts you also have to set an security policy for running scripts. without going into that too deep, you have to run a script with Set-ExecutionPolicy RemoteSigned in it once (see below).</p>
<p>2. Create a shortcut to powershell.exe by rightclicking on the desktop and typing the location of powershell.exe and the location of your newly created .ps1 script, for example: powershell.exe C:\powershell\start-coldfusion.ps1</p>
<p>3. The shortcut needs to be run &#8216;as administrator&#8217; (through advanced &gt; run as administrator in the shortcut tab of the shortcut (lol?)</p>
<p>5. Plus: the security settings of the local PC have to be changed to  &#8220;no notifications when a program tries to make changes&#8221;, to avoid pop-ups.</p>
<p>Some services, like the Coldfusion 9 (beta) service on my 4 year-old PC take a little time to start and stop, so the command window will show repeating warnings about starting or stopping the services. You can just ignore these warnings, they will stop when the service is really stopped or started and also the command windows will automatically disappear (except when used with the -noexit option, see below.)</p>
<p>There are a great number of other things that can be done with powershell, but starting a service on a remote PC is not 1 of them, due to beta status. If you want to see the status of your startservice script then use the -noexit option, as in: powershell.exe –noexit c:\scripts\test.ps1 which makes the command window stay open.</p>
<p>For more information on Powershell just <a href="http://www.google.com/search?q=powershell" target="_blank">Google</a> it or read the free online <a href="http://powershell.com/cs/blogs/ebook/" target="_blank">book on Powershell</a>. Example scripts can be found in thePowershell category of the <a onmousedown="return rwt(this,'','','res','1','AFQjCNGMr35_vTvF119lX6b13FN6Niv8bg','&amp;sig2=IbvM2N_vj4Xw0a7_l3DdIg')" href="http://www.google.com/url?sa=t&amp;source=web&amp;ct=res&amp;cd=1&amp;url=http%3A%2F%2Fgallery.technet.microsoft.com%2FScriptCenter%2Fen-us%2F&amp;ei=-Mu0Srr2KOCK4gbo_pl8&amp;usg=AFQjCNGMr35_vTvF119lX6b13FN6Niv8bg&amp;sig2=IbvM2N_vj4Xw0a7_l3DdIg">TechNet <em>Script</em> Center Gallery</a></p>
<p>Happy scripting <img src='http://www.dizid.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.dizid.com/web-development/coldfusion/starting-a-service-through-powershell-on-the-windows-7-local-pc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Served from: www.dizid.com @ 2012-02-05 14:10:03 by W3 Total Cache -->
