IIS

Table of contents
  1. 1. Configuration
  2. 2. IIS
  3. 3. FastCGI
  4. 4. PHP
  5. 5. MySQL

     

Configuration

I used the following configuration for this installation.

       

  • Windows Server 2003 R2 SP2

  • Internet Information Server 6

  • FastCGI for IIS

  • PHP 5.2.6

  • .net Framework 2.0

  • Helicon Isapi Rewrite 3.1.0.42

  • DekiWiki Jay-Cooke (8.05)

  • Active Perl 5.10

  • GhostScript 8.62

       

  • There are a lot of options which could be done differently than I describe here. The installation instructions I'm writing are based on the use of Windows Server 2003, IIS 6, FastCGI, PHP 5, .net Framework 2.0 and Isapi Rewrite 3. Any of these things could probably be changed to something else. Specifically mono for .net framework, CGI for FastCGI, Apache for IIS, one version of Windows for another or some other url rewriting system for Isapi Rewrite. The possibilities are pretty much endless. However, any of these choices would change the installation procedures, to one extent or another. There are some instructions for installing on Windows with Apache located here. That's where I started.

IIS

  • Install IIS on your Windows Server 2003 installation if it is not already installed.

  • If you need help installing IIS refer here.

  • The basic procedure is as follows:

    • Basically you just go to Start Menu – Control Panel – Add or Remove Programs

    • Click “Add/Remove Windows Components” from the left side menu.

    • Double-click the following components in order to drill down into them:

      • Application Server

      • Internet Information Services (IIS)

      • World Wide Web Service

    • Within the “World Wide Web Service” component, ensure that “World Wide Web Service” is checked.

    • Click “OK” until you're back to the “Component Wizard” dialog, then click “Next”.

    • When the Wizard is complete click “Finish”.

    • Restart the operating system if need be.

FastCGI

  • Download FastCGI from here.

  • Install FastCGI.

  • Configure IIS to use FastCGI for PHP requests.

    • Launch inetmgr.exe.

    • Double click the machine icon for the local computer.

    • Right click on "Web Sites" and pick "Properties".

    • Click the tab labeled "Home Directory".

    • Click the "Configuration…" button.

    • Click the "Add…" button.

    • Browse to %WINDIR%\system32\inetsrv\ to select fcgiext.dll as the Executable.
      Note: If you are setting this up on 64bit platform in WOW mode, then you must use fcgiext.dll located in %WINDIR%\SysWOW64\inetsrv

    • Enter .php as the Extension

    • Enter Verbs as GET,HEAD,POST

    • Ensure that "Script Engine" and "Verify that file exists" are checked.

    • Click “OK”

  • For further documentation on FastCGI go here.

PHP

  • Download the latest version of PHP here.

    • At this time, the latest release is 5.2.6, and that's what these instructions are based on.

    • I suggest the Windows installation package unless you're intimately familiar with PHP. It's definitely the easiest way for the rest of us.

  • Install PHP.

    • When installing specify “C:\PHP5\” as the installation directory. The installation defaults to “C:\Program Files\PHP\” but other things default to “C:\PHP5\” and I find it all just works better if you use that instead.

    • During the installation you will be asked to choose a “Web server setup” with lots of different options. You want to choose “IIS FastCGI”.

    • When presented with the “Choose items to install” dialog during the installation of PHP. You will choose to install the following extensions and extras in addition to the PHP itself.

      • Extensions

        • Curl”

        • GD2”

        • Multi-Byte String” aka “mbstring”

        • Mimetypec” aka “Mime_Magic”

        • MySQL”

        • MySQLi”

      • Extras

        • PEAR Install”

    • Edit “C:\PHP5\php.ini”.

      • Set the following value.

        • short_open_tag = On”

      • Uncomment the following line.

        • ;extension=php_mbstring.dll”
          ie. “;extension=php_mbstring.dll” becomes “extension=php_mbstring.dll”

      • Edit the “error_reporting” value to be “E_ALL & ~E_NOTICE”
        ie. “error_reporting = E_ALL”
        becomes: “error_reporting = E_ALL & ~E_NOTICE”

      • Set the following value:

        • "SMTP = localhost"

        • It should be whatever your mail server is.

  • Installing PHP in this way will have made some changes to the fcgiext.dll file.

    • The file should now have the following entries at the bottom:

      [Types]
      php=PHP

      [PHP]
      ExePath=C:\PHP5\php-cgi.exe

    • Add the following entries to the PHP section:

      InstanceMaxRequests=10000
      EnvironmentVars=PHP_FCGI_MAX_REQUESTS:10000
      RequestTimeout=90
      ActivityTimeout=60

  • Restart IIS

    • From the IIS Administration Console:

      • Right click the server we are using.

      • Go into “All Tasks”

      • Select “Restart IIS”

      • In the “Start/Stop/Restart...” window:

        • Ensure that “Restart Internet Services on YOURSERVER” is selected.

        • Click “OK”

      • Allow that process to complete.

MySQL

  • Download the latest MySQL windows installation package here.
    NOTE: Choose the Windows installation package (setup.exe). It's the easiest way.

    • At this time, the latest release is 5.0.51b, and that's what these instructions are based on.

  • Install MySQL.

    • All the configuration options possible with MySQL are well beyond the scope of this document. However if you are the type that doesn't know or want to know anything about MySQL but just want to get this thing up and running, just let it go with the defaults. When the instance config runs, use the standard configuration and remember the root password you set.

  • Edit your my.ini file: “C:\Program Files\MySQL\MySQL Server 5.0\my.ini”

    • Make sure you DO NOT have “NO_AUTO_CREATE_USER” and “STRICT_TRANS_TABLES” in your sql-mode settings.

      • It should look something like this:


      • /div[5]/ul/li[3]/ul/li/ul/li[2]/p/span, reference to undefined name 'geshi'
        # Set the SQL mode to strict
        #sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
        sql-mode="NO_ENGINE_SUBSTITUTION"

    • Restart MySQL:
      Goto Start > Run > Services.msc > MySQL service and select "RESTART" or "STOP" "START"

  • Deki Wiki

    • Download the latestDeki Wiki Source Release.

      • At this time, the latest release is Jay Cooke (8.05), and that's what these instructions are based on.

    • Extract the archive to “C:\deki\”.

      • Any location will do. I just like to keep it simple.

  • Isapi Rewrite

    • Download the latest version of Isapi Rewrite from Helicon.

      • At this time, the latest release is 3.1.0.42, and that's what these instructions are based on.

    • Install Isapi Rewrite

      • Accept the default options.

  • .NET 2.0 Runtime

    • Make sure you have the Microsoft .NET 2.0 framework installed

  • ImageMagick

    • Download ImageMagick for Win32

    • Run the installer and choose the defaults.

  • Configure IIS.

    • Create a new Web Site in IIS management console.

      • The following settings must be set in the web site creation wizard.

        • Use whatever you like as the description.

        • If there are no other web sites hosted on this server then the default ip address, port and host header settings will be fine.
          NOTE: If IIS was just installed the default site may be deleted prior to creating this one.

          • Describing how to host multiple sites on one IIS server is beyond the scope of this document, however I should note that the use of a “host header redirect” will work in the context of hosting Deki Wiki. It's the method I most commonly use to differentiate multiple sites hosted on one server.

        • Set the home directory path to “C:\deki\web\” or whatever alternate location you have chosen.

        • Allow “Read”, “Run Scripts” and “Execute” permissions on the web site.

    • Change web site settings within IIS.

      • Once the site is created, right click on the new web site within the IIS management console and select “properties”.

      • Go to the “Documents” tab.

      • Remove the “default.asp” and “default.htm” entries from the list.

      • Add an entry to the list for “index.php” and move it to the top.

  • Configure Isapi Rewrite.

    • Go to the Start menu and open “Isapi_Rewrite Manager”

    • Within the Isapi Rewrite Manager window:

      • Select the new web you have created in the left pane under “IIS Web Sites”.

      • Something like this “C:\deki\web\.htaccess” should now be displayed in the right pane under “Config”.

      • Click the “Edit” button.

      • A windows titled “.htaccess - Helicon Config Editor” will be displayed.

      • Paste the following into that window:

        RewriteEngine On
        RewriteCompatibility2 On
        RepeatLimit 200
        RewriteBase

        RewriteRule ^(/)?$ /index.php?title= [L]

        RewriteCond %{REQUEST_URI} ^/@gui/[^.]+$
        RewriteRule ^/@gui/(.*)$ /proxy.php?path=$1 [L,QSA,NE]

        # RewriteCond %{REQUEST_URI} ^/@api/[^.]+$
        # RewriteRule ^/@api/(.*)$ /proxy.php?path=$1 [L,QSA,NE]
        # in the following rule, $1 contains the whole url
        RewriteProxy ^/@api/(.*)$ http://localhost:8081/$1

        RewriteCond %{REQUEST_URI} !^/(@api|editor|skins|config|@gui)/
        RewriteCond %{REQUEST_URI} !^/(index|redirect|texvc|Version|dummy|phpinfo)\.php
        RewriteCond %{REQUEST_URI} !^/(robots\.txt|favicon\.ico)$
        RewriteCond %{REQUEST_URI} !^/error/(40(1|3|4)|500)\.html$
        RewriteCond %{QUERY_STRING} ^$ [OR]
        ReWriteCond %{REQUEST_URI} ^/Special:Search
        RewriteRule ^/(.*)$ /index.php?title=$1 [L,QSA,NE]

         

      • Click the “Apply” button within the “Config Editor” window.

      • Click the “Apply” button within the “Helicon Manager” window.

      • Close the “Helicon Manager” window.

  • html2ps and ps2pdf

    • Follow the instructions located here.

      • The attached zip file from the preceding linked document should be extracted to the “C:\deki\web\bin\filters\” or equivalent, directory.

      • Later in the installation, the Deki Wiki automated configuration script will ask for the location of html2ps and ps2pdf. Filling out those fields in the installation script places the necessary lines in the mindtouch.deki.startup.xml file, so you shouldn't have to do that part manually.

    • ActivePerl and GhostScript.

      • Download the latest version of Active Perl here.
        I suggest the MSI installer.

      • Download the latest version of GhostScript from here.
        It will be something like “gsXXXw32.exe” where XXX represents the version number.

    • To change the PATH environment variable.

      • Right click on “My Computer”.

      • Click “Properties”.

      • Go to the “Advanced” tab.

      • Click the “Environment Variables” button.

      • Find and select the “Path” variable within the “System variables” list.

      • Click the “Edit” button.

      • If the variable does not already contain the path to the GhostScript binaries, add it. In my case, I had to add the following to the end of my PATH variable: “;C:\gs\gs8.62\bin” It all depends on where you had GhostScript installed to though. The default location is “C:\Program Files\gs\”. I chose to install to “C:\gs\” in order to simplify matters.

      • Click “OK” three times.

  • Run the Deki Wiki automated installation script.

    • Navigate to your web in a browser eg. http://deki.yourdomain.com/

    • This will redirect you to http://deki.yourdomain.com/config/index.php

    • Fill in the fields on the installation page.

      • The “ImageMagick convert” field should contain the full path and file name of the ImageMagick convert executable.
        eg. “C:\Program Files\ImageMagick\convert.exe”

      • The “ImageMagick identify” field, the identify executable.
        eg. “C:\Program Files\ImageMagick\identify.exe”

      • The “html2ps” field should contain the full path and file name of the html2ps.bat file that you placed in the deki folder earlier.
        eg. “C:\deki\web\bin\filters\html2ps.bat”

      • The “ps2pdf” field, the ps2pdf.bat file.
        eg. “C:\deki\web\bin\filters\ps2pdf.bat”

      • The “Mono” field should remain empty.

    • Click “Install Deki Wiki”.

    • After the installation script runs, you will be told to run a series of commands from a command prompt. Do so.

      • This will run the Dream host in the command prompt you have open.
        That will work for now. Eventually we will move all of that into a Windows service.

    • Once the Dream host is running, click the “Visit your Deki Wiki” link on the installation page.

    • The Deki Wiki should basically function at this time. Make sure everything is good here before moving on to some of the secondary tasks provided below.

  • SrvAny

    • This will allow you to run the Dream host as a windows service which will run when Windows starts and when nobody is logged on.

    • Install SrvAny

      • Download the latest Windows Resource Kit Tools (rktools) from here.

      • More information on using srvany can be found here.

      • Install the Dream host as a service using srvany following the instructions found here.

         

  • SSO

    • If you would like to set up “single sign on” with Active Directory, as I have, you will have to do a little more work.

    • I'm still working on this part of the documentation.

     

Tag page
Viewing 2 of 2 comments: view all
Hi, I done all and it works. But i now get the javascript error YAHOO not defined. It seems the yahoo.js is not included. What can i do ?
Thanks
Freddi
Posted 11:10, 4 Jun 2008
"After the installation script runs, you will be told to run a series of commands from a command prompt. "
When doing this the host fails with exception: Unhandled Exception: System.Net.HttpListenerException: The process cannot access the file because it is being used by another process.
What could be the problem?
Posted 09:32, 2 Jul 2008
Viewing 2 of 2 comments: view all
You must login to post a comment.
Powered by MindTouch Deki v.8.08