<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.technet.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>jorkeo - hosting geek : CGI</title><link>http://blogs.technet.com/jorke/archive/tags/CGI/default.aspx</link><description>Tags: CGI</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Cat Power - Tomcat on Server 2008 Core with IIS7</title><link>http://blogs.technet.com/jorke/archive/2008/09/17/cat-power-tomcat-on-server-2008-core-with-iis7.aspx</link><pubDate>Wed, 17 Sep 2008 13:51:54 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3125150</guid><dc:creator>jorkeo</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.technet.com/jorke/comments/3125150.aspx</comments><wfw:commentRss>http://blogs.technet.com/jorke/commentrss.aspx?PostID=3125150</wfw:commentRss><wfw:comment>http://blogs.technet.com/jorke/rsscomments.aspx?PostID=3125150</wfw:comment><description>&lt;p&gt;&lt;strong&gt;&lt;font size="4"&gt;EPIC START&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;So this turned out to be much longer than I thought - the basic goal is to utilise two of the coolest features of Window Server 2008 - Core and IIS7. The idea is to create an ultimately low footprint web server on &lt;a target="_blank" href="http://www.microsoft.com/windowsserver2008/en/us/2008-web.aspx"&gt;Microsoft Windows Web Server 2008 Core&lt;/a&gt; and show how that can easily support the &lt;a target="_blank" href="http://www.apache.org/"&gt;Apache Software Foundation&lt;/a&gt;'s Open Source Java Server - &lt;a target="_blank" href="http://tomcat.apache.org/"&gt;Tomcat&lt;/a&gt;. Ideally I don't want to logon to the console or via Remote Desktop of the server at any point - and I'll use our remote management tools to configure and install in a true 'headless' environment. My Starting point is a clean install of Windows Web Server 2008 Core on Hyper-V, &lt;strong&gt;not on a domain&lt;/strong&gt; and just having had the computer name set to &amp;quot;&lt;strong&gt;servercore&lt;/strong&gt;&amp;quot;. Let see how I go! &lt;/p&gt;  &lt;p&gt;&lt;font size="4"&gt;&lt;strong&gt;Set for Remote Management&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;So this the one thing I must do on the console (or I can script it as part of install). I need to configure our remote management tools &lt;a target="_blank" href="http://msdn.microsoft.com/en-us/library/aa384372(VS.85).aspx"&gt;WinRM&lt;/a&gt; to allow connections from my workstation to the server. (note that you should NOT leave WinRM with Basic auth set to true in a production environment - I need to do this because the machine is not in a domain)&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Courier New"&gt;WinRM quickconfig      &lt;br /&gt;WinRM set winrm/config/service/auth @{Basic=&amp;quot;true&amp;quot;}       &lt;br /&gt;WinRM set winrm/config/client @{TrustedHosts=&amp;quot;jorkeo-hp&amp;quot;} &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Courier New"&gt;WinRM set winrm/config/service/auth @{Basic=&amp;quot;true&amp;quot;}      &lt;br /&gt;WinRM set winrm/config/client @{TrustedHosts=&amp;quot;servercore&amp;quot;}&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;Now I connect to the server from the command prompt on my workstation (&amp;quot;&lt;strong&gt;jorkeo-hp&lt;/strong&gt;&amp;quot;) using &lt;a target="_blank" href="http://blogs.technet.com/server_core/archive/2006/08/11/446122.aspx"&gt;WinRS&lt;/a&gt;, and I'm going to instantiate a remote command prompt:&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Courier New"&gt;WinRS -r:servercore -u:Administrator -p:****** cmd.exe&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.technet.com/blogfiles/jorke/WindowsLiveWriter/9a0bfb6c0d5c_B772/image_12.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px" border="0" alt="image" src="http://blogs.technet.com/blogfiles/jorke/WindowsLiveWriter/9a0bfb6c0d5c_B772/image_thumb_5.png" width="514" height="105" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Now we have our remote shell - all commands from this point forward are run here.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;font size="4"&gt;Install Basic IIS requirements&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Normally I would use &lt;a target="_blank" href="http://technet.microsoft.com/en-us/library/cc766272.aspx"&gt;ocsetup&lt;/a&gt; to install everything with dependencies, but since I'm attempting a low footprint web server I want pick the exact packages I need to install without installing everything - to do this I use package manager - &lt;a target="_blank" href="http://technet.microsoft.com/en-us/library/cc749465.aspx"&gt;pkgmgr&lt;/a&gt; - and select the roles/modules to install.&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Courier New"&gt;start /w pkgmgr /iu:IIS-WebServerRole;IIS-WebServer;IIS-CommonHttpFeatures;IIS-StaticContent;IIS-DefaultDocument;IIS-DirectoryBrowsing;IIS-HttpErrors;IIS-HttpRedirect;IIS-ApplicationDevelopment;IIS-ISAPIExtensions;IIS-ISAPIFilter;IIS-HealthAndDiagnostics;IIS-HttpLogging;IIS-LoggingLibraries;IIS-RequestMonitor;IIS-HttpTracing;IIS-Security;IIS-BasicAuthentication;IIS-URLAuthorization;IIS-RequestFiltering;IIS-IPSecurity;IIS-Performance;IIS-HttpCompressionStatic;IIS-HttpCompressionDynamic;IIS-WebServerManagementTools;IIS-ManagementScriptingTools;WAS-WindowsActivationService;WAS-ProcessModel;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;Installation dependencies can be found here:&lt;a href="http://learn.iis.net/page.aspx/130/understanding-setup-in-iis-7/"&gt;http://learn.iis.net/page.aspx/130/understanding-setup-in-iis-7/&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Then you need to create the site under IIS7 to host your servlets.&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Courier New"&gt;mkdir c:\inetpub\mytomcat&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Courier New"&gt;C:\windows\system32\inetsrv\appcmd.exe add site /name:&amp;quot;mytomcat.com&amp;quot; /bindings:&lt;/font&gt;&lt;a href="http://mytomcat.com:80"&gt;&lt;font size="2" face="Courier New"&gt;http://mytomcat.com:80&lt;/font&gt;&lt;/a&gt;&lt;font size="2" face="Courier New"&gt;      &lt;br /&gt;/physicalPath:&amp;quot;c:\inetpub\mytomcat&amp;quot;       &lt;br /&gt;SITE object &amp;quot;mytomcat.com&amp;quot; added      &lt;br /&gt;APP object &amp;quot;mytomcat.com/&amp;quot; added      &lt;br /&gt;VDIR object &amp;quot;mytomcat.com/&amp;quot; added&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Courier New"&gt;c:\windows\system32\inetsrv\appcmd.exe add apppool /name:mytomcat&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Courier New"&gt;APPPOOL object &amp;quot;tomcat&amp;quot; added&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Courier New"&gt;c:\windows\system32\inetsrv\appcmd.exe set site &amp;quot;mytomcat.com&amp;quot;      &lt;br /&gt;/applicationDefaults.applicationPool:&amp;quot;mytomcat&amp;quot;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Courier New"&gt;SITE object &amp;quot;mytomcat.com&amp;quot; changed&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;font size="4"&gt;Install JRE + Tomcat&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Now we need to install the Java Runtime Environment - I just download the latest one from &lt;a href="http://java.sun.com"&gt;http://java.sun.com&lt;/a&gt; and install with defaults, the version I ended up with was JRE6 update 7 - the offline installation - I then ran the installer like so:&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Courier New"&gt;jre-6u7-windows-i586-p.exe /passive&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;Verified that was in place, by looking for the java directories under &lt;strong&gt;\Program Files&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Then just downloaded the latest version of &lt;a target="_blank" href="http://tomcat.apache.org/download-60.cgi?Preferred=http%3A%2F%2Fapache.mirror.aussiehq.net.au"&gt;Apache Tomcat&lt;/a&gt; from my buddies at &lt;a target="_blank" href="http://www.aussiehq.com.au/"&gt;AussieHQ&lt;/a&gt;. There are a couple of ways you can deploy this, by running the installer service/downloading the file - I like to run the installer on a reference machine then copy the contents of the tomcat directory to the server - it seems to clear out all the unnecessary stuff at installation time. I've copied my contents of a reference install to &lt;strong&gt;c:\tomcat&lt;/strong&gt; on &lt;strong&gt;servercore&lt;/strong&gt;.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;font size="4"&gt;Run Tomcat as a service&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Now this took aaaggess as the installation syntax is overly sensitive, case sensitive etc. So to save you the time here is my installation script line to install with all options pointing to my new installation of JRE:&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Courier New"&gt;tomcat6.exe //IS//Tomcat6 --Install=&amp;quot;c:\tomcat\bin\tomcat6.exe&amp;quot; --StartClass=org.apache.catalina.startup.Bootstrap --StopClass=org.apache.catalina.startup.Bootstrap --StartParams=start --StopParams=stop --JvmOptions &amp;quot;-Dcatalina.home=c:\tomcat;-Dcatalina.base=c:\tomcat;-Djava.endorsed.dirs=c:\tomcat\common\endorsed;-Djava.io.tmpdir=c:\tomcat\temp;-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager;-Djava.util.logging.config.file=c:\tomcat\conf\logging.properties;&amp;quot; --Jvm=&amp;quot;C:\Program Files\Java\jre1.6.0_07\bin\client\jvm.dll&amp;quot; --JavaHome=&amp;quot;C:\Program Files\Java\jre1.6.0_07&amp;quot; --Classpath=&amp;quot;c:\tomcat\bin\bootstrap.jar&amp;quot; --LogPath=c:\tomcat\logs --StdError=auto --StdOutput=auto --StartPath=c:\tomcat --StopPath=c:\tomcat --StartMode=jvm --StopMode=jvm&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;At this point I found that tomcat would fail to start&lt;/p&gt;  &lt;p&gt;&lt;font size="1"&gt;&lt;font face="Courier New"&gt;C&lt;/font&gt;&lt;font size="2" face="Courier New"&gt;:\tomcat\bin&amp;gt;net start tomcat6        &lt;br /&gt;The Tomcat6 service is starting.         &lt;br /&gt;The Tomcat6 service could not be started. &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Courier New"&gt;A service specific error occurred: 0. &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Courier New"&gt;More help is available by typing NET HELPMSG 3547. &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Courier New"&gt;C:\tomcat\bin&amp;gt;C:\tomcat\bin&amp;gt;tomcat6 //TS//Tomcat6      &lt;br /&gt;C:\tomcat\bin&amp;gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;hmmm nothing... looking in &lt;strong&gt;tomcat\logs &lt;/strong&gt;folder the &amp;quot;&lt;strong&gt;jakarta_service.log&lt;/strong&gt;&amp;quot; file seemed to be the latest timestamp, opening that in notepad and its full of this:&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Courier New"&gt;2008-09-16 12:39:50] [info] Procrun (2.0.3.0) started      &lt;br /&gt;[2008-09-16 12:39:50] [info] Debugging Service...       &lt;br /&gt;[2008-09-16 12:39:50] [info] Starting service...       &lt;br /&gt;[2008-09-16 12:39:50] [174&amp;#160; javajni.c] [error] The specified module could not be found.       &lt;br /&gt;[2008-09-16 12:39:50] [986&amp;#160; prunsrv.c] [error] Failed creating java C:\Program Files\Java\jre1.6.0_07\bin\client\jvm.dll       &lt;br /&gt;[2008-09-16 12:39:50] [1260 prunsrv.c] [error] ServiceStart returned 1       &lt;br /&gt;[2008-09-16 12:39:50] [info] Debug service finished.       &lt;br /&gt;[2008-09-16 12:39:50] [info] Procrun finished.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;which appears to be a problem finding an api to connect to, but the error is pretty vague as to &lt;strong&gt;what&lt;/strong&gt; its actually trying to do.. &lt;/p&gt;  &lt;p&gt;GROAN - this is the FIRST time i have to logon to the server via RDP/Console.. remember everything else so far has been via a remote &lt;a target="_blank" href="http://blogs.technet.com/server_core/archive/2006/08/11/446122.aspx"&gt;winrs&lt;/a&gt; console...&lt;/p&gt; &lt;a target="_blank" href="http://failblog.org/2008/05/12/plunger-cat/"&gt;&lt;img border="0" alt="Plunger Cat Fail" src="http://failblog.wordpress.com/files/2008/05/plungerfail.jpg?w=500" /&gt;&lt;/a&gt;   &lt;p&gt;Log On... Fire up &lt;a target="_blank" href="http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx"&gt;sysinternals Process Monitor&lt;/a&gt; (thank you &lt;a target="_blank" href="http://blogs.technet.com/sysinternals/archive/2008/08/08/new-coreinfo-v1-0-updates-process-monitor-v1-37-handle-v3-4-process-explorer-v11-21-debugview-4-75-mark-s-events-keynote-speaker-at-virtualization-congress.aspx"&gt;Mr Russinovich&lt;/a&gt;) to see what this tomcat process is trying to talk to (after some thought, I reckon I could probably spawn this remotely with a backing file to disk and load that on another machine... but too much stuffing around..). After attaching to the tomcat process, aha - there it is:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.technet.com/blogfiles/jorke/WindowsLiveWriter/9a0bfb6c0d5c_B772/image_2.png"&gt;&lt;img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" border="0" alt="image" src="http://blogs.technet.com/blogfiles/jorke/WindowsLiveWriter/9a0bfb6c0d5c_B772/image_thumb.png" width="451" height="68" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;When the tomcat process fires up it pokes around the OS looking for &lt;strong&gt;MSVCR71.dll&lt;/strong&gt; - which is the a bunch of C libraries generally shipped with the Microsoft C runtime library. So all I needed to do is find that file and put it in path - hang- on.. I remembered back to my Java development days in University - pretty sure that the JRE ships with the libraries in tow... ah... looking into the &lt;strong&gt;JRE\bin&lt;/strong&gt; directory of my Java Runtime Environment install, there it is, I'll copy that to my &lt;strong&gt;tomcat\bin&lt;/strong&gt; folder and try again. &lt;/p&gt;  &lt;p&gt;Ok - lets log off that server real quick - and back to our remote shell.&lt;/p&gt;  &lt;p&gt;So I kicked off starting tomcat from the command line again.. success!&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.technet.com/blogfiles/jorke/WindowsLiveWriter/9a0bfb6c0d5c_B772/image_4.png"&gt;&lt;img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" border="0" alt="image" src="http://blogs.technet.com/blogfiles/jorke/WindowsLiveWriter/9a0bfb6c0d5c_B772/image_thumb_1.png" width="463" height="251" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;You'll see its started with the default of http listening on port 8080 - so browsing to this (hoping no random proxy in the way) - Yee ha!&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.technet.com/blogfiles/jorke/WindowsLiveWriter/9a0bfb6c0d5c_B772/image_6.png"&gt;&lt;img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" border="0" alt="image" src="http://blogs.technet.com/blogfiles/jorke/WindowsLiveWriter/9a0bfb6c0d5c_B772/image_thumb_2.png" width="460" height="115" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Awesome, now I just have to CTRL-BREAK out of that and start the service:&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Courier New"&gt;C:\tomcat\bin&amp;gt;net start tomcat6     &lt;br /&gt;The Tomcat6 service is starting.      &lt;br /&gt;The Tomcat6 service was started successfully.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;And test again - also a Screen shot to prove it:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.technet.com/blogfiles/jorke/WindowsLiveWriter/9a0bfb6c0d5c_B772/image_10.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px" border="0" alt="image" src="http://blogs.technet.com/blogfiles/jorke/WindowsLiveWriter/9a0bfb6c0d5c_B772/image_thumb_4.png" width="478" height="52" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;But this is only the first step - Now I need to serve Tomcat through IIS7.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;font size="4"&gt;Setting up the IIS ISAPI Redirector&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Download the IIS Tomcat connector - &lt;a title="http://tomcat.apache.org/download-connectors.cgi" href="http://tomcat.apache.org/download-connectors.cgi"&gt;http://tomcat.apache.org/download-connectors.cgi&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The connector acts as a broker between IIS and Tomcat and as far as IIS is concerned just an &lt;a target="_blank" href="http://en.wikipedia.org/wiki/Isapi"&gt;ISAPI&lt;/a&gt; filter.&lt;/p&gt;  &lt;p&gt;For this example I've grabbed &lt;strong&gt;isapi_redirect-1.2.26.dll&lt;/strong&gt; - and renamed it to &lt;strong&gt;isapi_redirect.dll&lt;/strong&gt; just to make it easy. &lt;/p&gt;  &lt;p&gt;Now this is where your configuration choice can get interesting. Depending on how you're supporting tomcat you have the choice of using the registry for storing configuration information for the &lt;a target="_blank" href="http://en.wikipedia.org/wiki/Isapi"&gt;ISAPI&lt;/a&gt; filter OR using a file. This of course depends on how you intend to host it as well. If you intend host this in a multi-tenant environment with several java sites on the same server and possibly different customers as well I would recommend using a file based approach as you can set a configuration file per site. If you are just looking after one site on the server, registry configuration is fine. One thing to remember though, is when you need to replicate the configuration to another server then you will have to make sure the registry entries follow the site.&lt;/p&gt;  &lt;p&gt;For the purposes of this example, I'm going to attempt a multi-tenant configuration to allow the most flexibility, plus prevents me from having to play in the registry. When you need to create another site on the same server, create a new folder for the site under &lt;strong&gt;tomcat\conf&lt;/strong&gt; and &lt;strong&gt;tomcat\logs&lt;/strong&gt; and simply follow these steps for each new site :) (or script it)&lt;/p&gt;  &lt;p&gt;1. Create a folder under the website root called &lt;strong&gt;jakarta&lt;/strong&gt;     &lt;br /&gt;2. Copy the &lt;strong&gt;isapi_redirect.dll&lt;/strong&gt; into the &lt;strong&gt;jakarta&lt;/strong&gt; folder.     &lt;br /&gt;3. Create a file in the &lt;strong&gt;jakarta&lt;/strong&gt; folder called &lt;strong&gt;isapi_redirect.properties &lt;/strong&gt;(note that the name before the extension MUST match the dll filename)     &lt;br /&gt;4. Edit the isapi_redirect.properties file in notepad (server core IDE) - paste in the following:&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Courier New"&gt;# Configuration file for the Jakarta ISAPI Redirector &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Courier New"&gt;# The path to the ISAPI Redirector Extension, relative to the website      &lt;br /&gt;# This must be in a virtual directory with execute privileges       &lt;br /&gt;extension_uri=/jakarta/isapi_redirect.dll &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Courier New"&gt;# Full path to the log file for the ISAPI Redirector      &lt;br /&gt;log_file=c:\tomcat\logs\mytomcat\isapi_redirect.log &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Courier New"&gt;# Log level (debug, info, warn, error or trace)      &lt;br /&gt;log_level=INFO&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Courier New"&gt;# Full path to the workers.properties file      &lt;br /&gt;worker_file=c:\tomcat\conf\mytomcat\workers.properties &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Courier New"&gt;# Full path to the uriworkermap.properties file      &lt;br /&gt;worker_mount_file=c:\tomcat\conf\mytomcat\uriworkermap.properties &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;5. You can see that the&lt;strong&gt; log_file&lt;/strong&gt; directive is going to a folder that doesn't exist so we need to create the folder &lt;strong&gt;tomcat\logs\mytomcat\&lt;/strong&gt; - and also the configuration folder &lt;strong&gt;tomcat\conf\mytomcat\&lt;/strong&gt; - by creating a separate folder for each site you allow the separation of site logging and configuration.     &lt;br /&gt;6. Now we need to create the &lt;strong&gt;workers.properties&lt;/strong&gt; and &lt;strong&gt;uriworkermap.properties&lt;/strong&gt; files under the&lt;strong&gt; tomcat\conf\tomcatsite1\&lt;/strong&gt; folder. Create the worker.properties file first - This controls the configuration of tomcat worker processes allows control of resources to the site - something best left to the server administrators (&lt;a target="_blank" href="http://tomcat.apache.org/connectors-doc/generic_howto/workers.html"&gt;more info on tomcat workers&lt;/a&gt;) - lets create the file &lt;strong&gt;notepad.exe tomcat\conf\mytomcat\workers.properties&lt;/strong&gt; - and populate with the following:&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Courier New"&gt;# list of workers &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Courier New"&gt;worker.list=mytomcat,ajp13      &lt;br /&gt;worker.mytomcat.type=ajp13       &lt;br /&gt;worker.ajp13.type=ajp13 &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Courier New"&gt;# worker mytomcat      &lt;br /&gt;worker.mytomcat.host=localhost       &lt;br /&gt;worker.mytomcat.port=8009       &lt;br /&gt;worker.mytomcat.lbfactor=1 &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Courier New"&gt;# worker ajp13      &lt;br /&gt;worker.ajp13.host=localhost       &lt;br /&gt;worker.ajp13.port=8009       &lt;br /&gt;worker.ajp13.lbfactor=1 &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="1"&gt;&lt;font face="Courier New"&gt;&lt;font size="2"&gt;# time out          &lt;br /&gt;worker.mytomcat.connection_pool_timeout=600           &lt;br /&gt;worker.mytomcat.socket_timeout=60&lt;/font&gt; &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;You can see here we are trying to make sure we keep the naming specific to the site. Save the worker.properties file, then create the &lt;strong&gt;uriworkermap.properties&lt;/strong&gt; file - &lt;strong&gt;notepad.exe tomcat\conf\mytomcat\uriworkermap.properties&lt;/strong&gt; - this is where we map the request to the tomcat worker process. There is a whole level of URI re-mapping you can do here, but for the moment we are just going to take everything that comes to the site is fed to tomcat - just make sure we match up with the worker specified in the &lt;strong&gt;workers.properties&lt;/strong&gt; file.&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Courier New"&gt;# Use www.foo.org as virtual host      &lt;br /&gt;# /www.foo.org/myapp/*=myworker       &lt;br /&gt;# Normal mapping &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Courier New"&gt;/mytomcat.com/*=mytomcat      &lt;br /&gt;/mytomcat.com/=mytomcat&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;Save that file.&lt;/p&gt;  &lt;p&gt;7. The last bit of hacking around in tomcat is that we need to tell it that we've setup a site for it to to be aware of. To kick this I opened the file &lt;strong&gt;tomcat\conf\server.xml&lt;/strong&gt; in notepad.&lt;/p&gt;  &lt;p&gt;Between the &lt;strong&gt;&amp;lt;Service&amp;gt;&lt;/strong&gt; xml tags another &lt;strong&gt;&amp;lt;Engine&amp;gt;&lt;/strong&gt; tag that describes our site needs to put into place - this is the syntax I entered:&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Courier New"&gt;&amp;lt;Engine name=&amp;quot;Catalina&amp;quot; defaultHost=&amp;quot;mytomcat.com&amp;quot;&amp;gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;Host name=&amp;quot;mytomcat.com&amp;quot; appBase=&amp;quot;c:\inetpub\mytomcat&amp;quot; unpackWARs=&amp;quot;true&amp;quot; autoDeploy=&amp;quot;true&amp;quot; xmlValidation=&amp;quot;false&amp;quot; xmlNamespaceAware=&amp;quot;false&amp;quot;&amp;gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;Valve className=&amp;quot;org.apache.catalina.valves.RequestDumperValve&amp;quot;/&amp;gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;Valve className=&amp;quot;org.apache.catalina.valves.AccessLogValve&amp;quot; directory=&amp;quot;c:\tomcat\logs\mytomcat&amp;quot; prefix=&amp;quot;mytomcat_access_log.&amp;quot; suffix=&amp;quot;.log&amp;quot; pattern=&amp;quot;common&amp;quot; resolveHosts=&amp;quot;false&amp;quot;/&amp;gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/Host&amp;gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/Engine&amp;gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;( Note the Valves in place to dump engine logs - http access etc )&lt;/p&gt;  &lt;p&gt;You will need to restart the tomcat service to pick up these changes - if any weirdness happens just run the service from the console to pick up any issues.&lt;/p&gt;  &lt;p&gt;8. Now we need to tell IIS that we're using an ISAPI filter to serve the content - we just need to add the ISAPI filter via APPCMD. First allow the ISAPI filter into the CGI/ISAPI restriction policy - then we unlock the handlers config in applicationhost.config then actually add the &lt;a target="_blank" href="http://en.wikipedia.org/wiki/Isapi"&gt;ISAPI&lt;/a&gt; filter.&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Courier New"&gt;appcmd.exe set config&amp;#160; -section:system.webServer/security/isapiCgiRestriction      &lt;br /&gt;/+&amp;quot;[path='c:\inetpub\mytomcat\jakarta\isapi_redirect.dll',allowed='True',description='tomcat']&amp;quot; /commit:apphost&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Courier New"&gt;c:\windows\system32\inetsrv\appcmd.exe unlock config /section:system.webserver/handlers&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Courier New"&gt;Unlocked section &amp;quot;system.webServer/handlers&amp;quot; at configuration path &amp;quot;MACHINE/WEBROOT/APPHOST&amp;quot;.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Courier New"&gt;c:\windows\system32\inetsrv\appcmd.exe set config &amp;quot;mytomcat.com&amp;quot;      &lt;br /&gt;&lt;/font&gt;&lt;font size="2" face="Courier New"&gt;-section:system.webServer/handlers      &lt;br /&gt;/+&amp;quot;[name='tomcat',path='*',verb='*',       &lt;br /&gt;scriptProcessor='c:\inetpub\mytomcat\jakarta\isapi_redirect.dll']&amp;quot;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Courier New"&gt;Applied configuration changes to section &amp;quot;system.webServer/handlers&amp;quot; for &amp;quot;MACHIN     &lt;br /&gt;E/WEBROOT/APPHOST/mytomcat.com&amp;quot; at configuration commit path &amp;quot;MACHINE/WEBROOT/APPHOST/mytomcat.com&amp;quot;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;9. One thing I almost forgot is that we need make sure that the context our site is running on has the ability to read the tomcat configuration and files. Because our application pool runs as the built in account - &amp;quot;&lt;strong&gt;Network Service&lt;/strong&gt;&amp;quot; I have to ensure it can read and write in the appropriate locations around tomcat. Now I'm being a little lazy here - if I really wanted to lock it down I would create a user account, remove it from all groups and then sit with &lt;a target="_blank" href="http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx"&gt;Process Monitor&lt;/a&gt; and find the exact settings required. But this is enough to get me over the hump. Allowing read to all of &lt;strong&gt;tomcat&lt;/strong&gt;, and allowing write to &lt;strong&gt;tomcat\logs&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Courier New"&gt;cacls c:\tomcat /T /E /C /G &amp;quot;NETWORK SERVICE&amp;quot;:R&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Courier New"&gt;cacls c:\tomcat\logs /T /E /C /G &amp;quot;NETWORK SERVICE&amp;quot;:C&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;10. Finally we need to drop some content to serve, I'm just going to drop in the examples that ship with the default tomcat build, normally found in the &lt;strong&gt;tomcat\webapps\examples&lt;/strong&gt; folder. I've just copied all the files into the root of my site and now lets browse to my site &lt;strong&gt;http://mytomcat.com&lt;/strong&gt;&lt;a title="http://mytomcat.com/servlets/servlet/HelloWorldExample" href="http://mytomcat.com/servlets/servlet/HelloWorldExample"&gt;&lt;strong&gt;/servlets/servlet/HelloWorldExample&lt;/strong&gt;&lt;/a&gt; (local demo site) ... and:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.technet.com/blogfiles/jorke/WindowsLiveWriter/9a0bfb6c0d5c_B772/image_8.png"&gt;&lt;img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" border="0" alt="image" src="http://blogs.technet.com/blogfiles/jorke/WindowsLiveWriter/9a0bfb6c0d5c_B772/image_thumb_3.png" width="459" height="140" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Its working - HOORAY!&lt;/p&gt;  &lt;p&gt;Just to verify, looking at my IIS logs you can see the requests coming through to the server:&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Courier New"&gt;008-09-17 00:50:32 192.168.0.2 GET /servlets/servlet/HelloWorldExample - 80 - 127.0.0.1 HTTP/1.1 Mozilla/5.0+(Windows;+U;+Windows+NT+6.0;+en-GB;+rv:1.9)+Gecko/2008052906+Firefox/3.0+(.NET+CLR+3.5.30729) JSESSIONID=A86ABA6C645C8FC922551765899D09A0 - mytomcat.com 200 0 0 511 513 194      &lt;br /&gt;2008-09-17 00:50:32 192.168.0.2 GET /servlets/images/code.gif - 80 - 127.0.0.1 HTTP/1.1 Mozilla/5.0+(Windows;+U;+Windows+NT+6.0;+en-GB;+rv:1.9)+Gecko/2008052906+Firefox/3.0+(.NET+CLR+3.5.30729) JSESSIONID=A86ABA6C645C8FC922551765899D09A0 &lt;/font&gt;&lt;a href="http://mytomcat.com/servlets/servlet/HelloWorldExample"&gt;&lt;font size="2" face="Courier New"&gt;http://mytomcat.com/servlets/servlet/HelloWorldExample&lt;/font&gt;&lt;/a&gt;&lt;font size="2" face="Courier New"&gt; mytomcat.com 200 0 0 519 538 17      &lt;br /&gt;2008-09-17 00:50:32 192.168.0.2 GET /servlets/images/return.gif - 80 - 127.0.0.1 HTTP/1.1 Mozilla/5.0+(Windows;+U;+Windows+NT+6.0;+en-GB;+rv:1.9)+Gecko/2008052906+Firefox/3.0+(.NET+CLR+3.5.30729) JSESSIONID=A86ABA6C645C8FC922551765899D09A0 &lt;/font&gt;&lt;a href="http://mytomcat.com/servlets/servlet/HelloWorldExample"&gt;&lt;font size="2" face="Courier New"&gt;http://mytomcat.com/servlets/servlet/HelloWorldExample&lt;/font&gt;&lt;/a&gt;&lt;font size="2" face="Courier New"&gt; mytomcat.com 200 0 0 1460 540 21      &lt;br /&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;The request loads through the ISAPI filters, so looking at the tomcat access logs:&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Courier New"&gt;127.0.0.1 - - [17/Sep/2008:10:44:33 +1000] &amp;quot;GET /servlets/servlet/HelloWorldExample HTTP/1.1&amp;quot; 200 359      &lt;br /&gt;127.0.0.1 - - [17/Sep/2008:10:44:38 +1000] &amp;quot;GET /servlets/servlet/HelloWorldExample HTTP/1.1&amp;quot; 200 359       &lt;br /&gt;127.0.0.1 - - [17/Sep/2008:10:44:55 +1000] &amp;quot;GET /servlets/servlet/HelloWorldExample HTTP/1.1&amp;quot; 200 359       &lt;br /&gt;127.0.0.1 - - [17/Sep/2008:10:45:12 +1000] &amp;quot;GET /servlets/servlet/HelloWorldExample HTTP/1.1&amp;quot; 200 359       &lt;br /&gt;127.0.0.1 - - [17/Sep/2008:10:45:57 +1000] &amp;quot;GET /servlets/servlet/HelloWorldExample HTTP/1.1&amp;quot; 200 359&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="4"&gt;&lt;strong&gt;Further Security Lock Downs&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;One very important you should to for your site is to ensure that the jakarta folder is blocked from http reading, i.e. just being able to browse to it - this can be controlled by the request filtering feature that is built into IIS7. To protect the folder, very simply appcmd directive:&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Courier New"&gt;appcmd.exe set config &amp;quot;mytomcat.com/jakarta&amp;quot; -section:system.webServer/security/requestFiltering /+&amp;quot;hiddenSegments.[segment='jakarta']&amp;quot;&lt;/font&gt; &lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;Then remember to rollback the WinRM configuration when going into production:&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Courier New"&gt;WinRM set winrm/config/service/auth @{Basic=&amp;quot;false&amp;quot;}&lt;/font&gt; &lt;/p&gt;  &lt;p&gt;&lt;font size="5"&gt;&lt;strong&gt;EPIC DONE!&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;And we are done - so this is my no means an exhaustive configuration guide - merely a glimpse of how you can configure some competitive technologies with Windows Server 2008 Core and IIS7.&lt;/p&gt;  &lt;p&gt;- jorke&lt;/p&gt;  &lt;p&gt; p.s. (Fineprint) this whole post is totally without warranty, if you try this and it works or doesn't work its not my fault. If you girlfriend/wife/cat leaves you because of this - believe me it wasn't this - you have something else to worry about..&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:e840150e-52f2-41cb-abaf-71c350cdf127" class="wlWriterSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/Server%20Core" rel="tag"&gt;Server Core&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Tomcat" rel="tag"&gt;Tomcat&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Apache%20Tomcat" rel="tag"&gt;Apache Tomcat&lt;/a&gt;,&lt;a href="http://technorati.com/tags/IIS7" rel="tag"&gt;IIS7&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Windows" rel="tag"&gt;Windows&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Java" rel="tag"&gt;Java&lt;/a&gt;,&lt;a href="http://technorati.com/tags/JSP" rel="tag"&gt;JSP&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Servlets" rel="tag"&gt;Servlets&lt;/a&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3125150" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/jorke/archive/tags/Microsoft/default.aspx">Microsoft</category><category domain="http://blogs.technet.com/jorke/archive/tags/IIS/default.aspx">IIS</category><category domain="http://blogs.technet.com/jorke/archive/tags/Windows+Server+2008/default.aspx">Windows Server 2008</category><category domain="http://blogs.technet.com/jorke/archive/tags/IIS7/default.aspx">IIS7</category><category domain="http://blogs.technet.com/jorke/archive/tags/apache/default.aspx">apache</category><category domain="http://blogs.technet.com/jorke/archive/tags/CGI/default.aspx">CGI</category><category domain="http://blogs.technet.com/jorke/archive/tags/core/default.aspx">core</category><category domain="http://blogs.technet.com/jorke/archive/tags/Open+Source/default.aspx">Open Source</category><category domain="http://blogs.technet.com/jorke/archive/tags/tomcat/default.aspx">tomcat</category></item><item><title>HUGE performance increases with PHP on Windows 2008</title><link>http://blogs.technet.com/jorke/archive/2008/04/14/huge-performance-increases-with-php-on-windows-2008.aspx</link><pubDate>Mon, 14 Apr 2008 05:54:57 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3036323</guid><dc:creator>jorkeo</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.technet.com/jorke/comments/3036323.aspx</comments><wfw:commentRss>http://blogs.technet.com/jorke/commentrss.aspx?PostID=3036323</wfw:commentRss><wfw:comment>http://blogs.technet.com/jorke/rsscomments.aspx?PostID=3036323</wfw:comment><description>&lt;p&gt;One of our local developers &lt;a href="http://www.dallasjclark.com/" target="_blank"&gt;Dallas J Clark&lt;/a&gt; (Brisbane local) blogged about an article that shows &lt;a href="http://www.dallasjclark.com/blog/?p=292" target="_blank"&gt;PHP with a 130% performance increase on Windows Server 2008&lt;/a&gt; - and of course there have been a few comments asking about the metrics of the comparison etc. So naturally I'm wading into to try and clear the water..&lt;/p&gt;  &lt;p&gt;I have to agree that there are a lot of unknowns and its difficult to do a competitive comparison with such little comparative data. What needs to be understood as that the results are for a specific case that the customer experienced, see the &lt;a href="http://cid-9720229c26829d90.skydrive.live.com/self.aspx/Public/Virtual%20Maps%20Case%20Study.pdf" target="_blank"&gt;case study right here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;The facts&lt;/strong&gt; are that Microsoft has spent a lot of time working with &lt;a href="http://www.zend.com/en/" target="_blank"&gt;Zend&lt;/a&gt; to ensure that PHP has been engineered to run well on Windows. &lt;/p&gt;  &lt;p&gt;The key difference to understand here is that you need to understand the execution architecture differences between *nix vs Windows, respectively multi-process vs multi-threaded. As CGI is designed for multi-process execution this can give pretty ordinary performance on Windows due to the threads/cycles involved in spinning up processes every time a request is processed by the web server. Of course you could attempt multi-threading using the ISAPI filter but ask what the results were from anyone who has tried :) &amp;#8211; especially when you are not using code you have written all yourself &amp;#8211; thus the best way to ensure reliable performance on Windows is to run via CGI &amp;#8211; which of course the performance is not optimal.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Now how has this changed;&lt;/strong&gt; IIS 7 has a &lt;a href="http://www.fastcgi.com/" target="_blank"&gt;FastCGI&lt;/a&gt; module as part of its install which by its design will make anything CGI based run faster, the idea being that it allows you to process multiple requests in the one connection and once the script has been processed the &lt;a href="http://www.fastcgi.com/" target="_blank"&gt;FastCGI&lt;/a&gt; process will keep running, waiting for more requests until its spun down as part of the web server.&amp;#160; So in this case using PHP, it eliminates the constant overhead of loading PHP into memory each time a request needs to be processed or course increasing the speed of the request. &lt;/p&gt;  &lt;p&gt;Also there are the &amp;#8220;NTS&amp;#8221; &lt;a href="http://www.php.net/downloads.php" target="_blank"&gt;non thread safe windows binaries of PHP&lt;/a&gt; that are available off the &lt;a href="http://php.net" target="_blank"&gt;php.net&lt;/a&gt; site - These binaries allow you to execute your code without needing to wait for thread synchronisation, meaning a HUGE performance increase. Couple this with FastCGI then you are you going to experiencing PHP running at a speed never before possible.&lt;/p&gt;  &lt;p&gt;To test this I ran a little test, for metrics sake this is Windows Server 2008 Enterprise running in Virtual PC 2007 - allocated 512MB of RAM. The host machine is a HP Compaq Laptop &lt;/p&gt;  &lt;p&gt;nc8430 Core 2 Duo @ 2.16Ghz and 4GB RAM, with a 7200 rpm disk, running Vista of course. My methodology was to grab a simple PHP site, run PHP with the standard CGI Module run a performance test, then change handler mapping to run the FastCGI Module and run the same performance test. The site I tested was on &lt;a href="http://qdig.sourceforge.net/Main/HomePage" target="_blank"&gt;Qdig&lt;/a&gt; and performance tests were using the &lt;a href="http://www.iis.net/downloads/default.aspx?tabid=34&amp;amp;g=6&amp;amp;i=1466" target="_blank"&gt;Web Capacity Analysis Tool (WCAT)&lt;/a&gt;. The metric measured was Get Requests / second, because this is an indication of how long the requests are taking before they need to be queued by the web server.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.technet.com/blogfiles/jorke/WindowsLiveWriter/HUGEperformanceincreaseswithPHPonWindows_B596/image_2.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="289" alt="image" src="http://blogs.technet.com/blogfiles/jorke/WindowsLiveWriter/HUGEperformanceincreaseswithPHPonWindows_B596/image_thumb.png" width="521" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;On the left - NTS PHP with CGIModule - maximum approx 30 rps&lt;/p&gt;  &lt;p&gt;On the right - NTS PHP with FastCGIModule - maximum approx 870 rps&lt;/p&gt;  &lt;p&gt;Of course your mileage will vary, but &lt;strong&gt;you will&lt;/strong&gt; have a comparable or &lt;strong&gt;better&lt;/strong&gt; experience than on other platforms. &lt;/p&gt;  &lt;p&gt;Questions?&lt;/p&gt;  &lt;p&gt;-jorke&lt;/p&gt;  &lt;p&gt;   &lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:88c441f9-6c90-4130-afd2-6500e087273d" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/PHP%20Performance" rel="tag"&gt;PHP Performance&lt;/a&gt;,&lt;a href="http://technorati.com/tags/PHP" rel="tag"&gt;PHP&lt;/a&gt;,&lt;a href="http://technorati.com/tags/IIS%207" rel="tag"&gt;IIS 7&lt;/a&gt;,&lt;a href="http://technorati.com/tags/IIS" rel="tag"&gt;IIS&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Windows%20Server%202008" rel="tag"&gt;Windows Server 2008&lt;/a&gt;,&lt;a href="http://technorati.com/tags/FastCGI" rel="tag"&gt;FastCGI&lt;/a&gt;,&lt;a href="http://technorati.com/tags/CGI" rel="tag"&gt;CGI&lt;/a&gt;&lt;/div&gt;&lt;/p&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3036323" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/jorke/archive/tags/Microsoft/default.aspx">Microsoft</category><category domain="http://blogs.technet.com/jorke/archive/tags/Hosting/default.aspx">Hosting</category><category domain="http://blogs.technet.com/jorke/archive/tags/IIS/default.aspx">IIS</category><category domain="http://blogs.technet.com/jorke/archive/tags/Windows+Server+2008/default.aspx">Windows Server 2008</category><category domain="http://blogs.technet.com/jorke/archive/tags/IIS7/default.aspx">IIS7</category><category domain="http://blogs.technet.com/jorke/archive/tags/linux/default.aspx">linux</category><category domain="http://blogs.technet.com/jorke/archive/tags/CGI/default.aspx">CGI</category><category domain="http://blogs.technet.com/jorke/archive/tags/PHP/default.aspx">PHP</category><category domain="http://blogs.technet.com/jorke/archive/tags/FastCGI/default.aspx">FastCGI</category></item><item><title>What size footprint does your worker process leave?</title><link>http://blogs.technet.com/jorke/archive/2007/11/05/what-size-footprint-does-your-worker-process-leave.aspx</link><pubDate>Mon, 05 Nov 2007 15:43:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:2338327</guid><dc:creator>jorkeo</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.technet.com/jorke/comments/2338327.aspx</comments><wfw:commentRss>http://blogs.technet.com/jorke/commentrss.aspx?PostID=2338327</wfw:commentRss><wfw:comment>http://blogs.technet.com/jorke/rsscomments.aspx?PostID=2338327</wfw:comment><description>&lt;P&gt;Well it all depends on what you are cramming into your request pipeline! With &lt;A href="http://www.iis.net/default.aspx?tabid=7&amp;amp;subtabid=71" target=_blank mce_href="http://www.iis.net/default.aspx?tabid=7&amp;amp;subtabid=71"&gt;IIS7's modular architecture&lt;/A&gt; you have the ability to load only what you need to run. What does this mean - well let's look at the footprint of a worker process that has all default modules loaded, i.e. ASP/ASP.NET/CGI/Authorization etc etc.&lt;/P&gt;
&lt;P&gt;To see the footprint in its entirety we want to dump out the applications loaded and see their usage. For this I have a handy PowerShell script I whacked together (because I love PowerShell); So browse to your website to spin up a worker process then run the following at a PowerShell prompt:&lt;/P&gt;
&lt;P&gt;gps -name w3wp | select -expand Modules | where {$_.Filename -like '*\inetsrv*} | ft&lt;/P&gt;
&lt;P&gt;which should give you something like the following:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.technet.com/blogfiles/jorke/WindowsLiveWriter/Whatsizefootprintdoesyourworkerprocessle_13553/image_2.png" mce_href="http://blogs.technet.com/blogfiles/jorke/WindowsLiveWriter/Whatsizefootprintdoesyourworkerprocessle_13553/image_2.png"&gt;&lt;IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=389 alt=image src="http://blogs.technet.com/blogfiles/jorke/WindowsLiveWriter/Whatsizefootprintdoesyourworkerprocessle_13553/image_thumb.png" width=644 border=0 mce_src="http://blogs.technet.com/blogfiles/jorke/WindowsLiveWriter/Whatsizefootprintdoesyourworkerprocessle_13553/image_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;this shows the footprint of a worker module with a default install of IIS 7.0 - you can see all the various modules loaded there for authorization, authentication, gzip etc. So how big is our worker process with no modules? Well simply rip the &amp;lt;globalmodules&amp;gt; out of the applicationhost.config file - NOT RECOMMENDED - without backup up your config first of course. Now browse to your site and you will notice nothing happens...- because you've ripped out all the modules there is nothing to process the request - thus you will get a naked worker process - lets take a look:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.technet.com/blogfiles/jorke/WindowsLiveWriter/Whatsizefootprintdoesyourworkerprocessle_13553/image_4.png" mce_href="http://blogs.technet.com/blogfiles/jorke/WindowsLiveWriter/Whatsizefootprintdoesyourworkerprocessle_13553/image_4.png"&gt;&lt;IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=134 alt=image src="http://blogs.technet.com/blogfiles/jorke/WindowsLiveWriter/Whatsizefootprintdoesyourworkerprocessle_13553/image_thumb_1.png" width=644 border=0 mce_src="http://blogs.technet.com/blogfiles/jorke/WindowsLiveWriter/Whatsizefootprintdoesyourworkerprocessle_13553/image_thumb_1.png"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;So you can see with IIS7 you can really customize what happens in your request pipeline to make huge differences to the size of your worker processes. Neat eh?&lt;/P&gt;
&lt;P&gt;Now I've also found out you can do the same as PowerShell script by simply running:&lt;/P&gt;
&lt;P&gt;tasklist /fi "imagename eq w3wp.exe" /M&lt;/P&gt;
&lt;P&gt;but where's the fun in that.. :)&lt;/P&gt;
&lt;P&gt;-jorke&lt;/P&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=2338327" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/jorke/archive/tags/PowerShell/default.aspx">PowerShell</category><category domain="http://blogs.technet.com/jorke/archive/tags/Microsoft/default.aspx">Microsoft</category><category domain="http://blogs.technet.com/jorke/archive/tags/Hosting/default.aspx">Hosting</category><category domain="http://blogs.technet.com/jorke/archive/tags/Architecture/default.aspx">Architecture</category><category domain="http://blogs.technet.com/jorke/archive/tags/IIS/default.aspx">IIS</category><category domain="http://blogs.technet.com/jorke/archive/tags/Windows+Server+2008/default.aspx">Windows Server 2008</category><category domain="http://blogs.technet.com/jorke/archive/tags/IIS7/default.aspx">IIS7</category><category domain="http://blogs.technet.com/jorke/archive/tags/CGI/default.aspx">CGI</category><category domain="http://blogs.technet.com/jorke/archive/tags/ASP.NET/default.aspx">ASP.NET</category></item><item><title>FastCGI GoLive for IIS5.1/IIS6</title><link>http://blogs.technet.com/jorke/archive/2007/10/02/fastcgi-golive-for-iis5-1-iis6.aspx</link><pubDate>Tue, 02 Oct 2007 07:09:47 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:2133360</guid><dc:creator>jorkeo</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.technet.com/jorke/comments/2133360.aspx</comments><wfw:commentRss>http://blogs.technet.com/jorke/commentrss.aspx?PostID=2133360</wfw:commentRss><wfw:comment>http://blogs.technet.com/jorke/rsscomments.aspx?PostID=2133360</wfw:comment><description>&lt;p&gt;We just announced the Go Live release of FastCGI for IIS5.1/6 - how cool is that!&lt;/p&gt;  &lt;p&gt;This means the fully scalable production CGI environments can be run on the windows platform giving everyone the ability to deploy all sorts of applications. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.iis.net/php" target="_blank"&gt;Check out the full details&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Can't wait for IIS7 where FastCGI is a module that comes as part of the server out of the box! But don't wait for that, try IIS7 out today.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.iis.net/articles/view.aspx/IIS7/Hosting-Web-Applications/PHP/Using-FastCGI-to-Host-PHP-Applications-on-IIS-6-0-" target="_blank"&gt;Here is how to deploy this to support PHP on IIS5.1/6.0&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;-jorke&lt;/p&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=2133360" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/jorke/archive/tags/IIS/default.aspx">IIS</category><category domain="http://blogs.technet.com/jorke/archive/tags/IIS7/default.aspx">IIS7</category><category domain="http://blogs.technet.com/jorke/archive/tags/CGI/default.aspx">CGI</category><category domain="http://blogs.technet.com/jorke/archive/tags/PHP/default.aspx">PHP</category></item></channel></rss>