DokuWiki

It's better when it's simple

User Tools

Site Tools


install:iis

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
install:iis [2014-12-22 12:10] – [Handler Mappings] 62.232.64.37install:iis [2023-09-20 21:48] (current) – rewrite info moved here. needs refactoring andi
Line 1: Line 1:
-====== DokuWiki with IIS ======+====== DokuWiki with IIS ====== 
  
-===== Overview ===== 
  
 This is for people who want to use [[:DokuWiki]] on a Windows machine with IIS webserver (Windows 2000, Windows XP or Windows Server 2003, 2008) This is for people who want to use [[:DokuWiki]] on a Windows machine with IIS webserver (Windows 2000, Windows XP or Windows Server 2003, 2008)
- 
-===== IIS 7 ===== 
- 
-==== Installation ==== 
- 
-The first step is to setup the web server for CGI [[http://www.iis.net/learn/application-frameworks/install-and-configure-php-applications-on-iis/using-fastcgi-to-host-php-applications-on-iis|Link]] \\ 
-Basically you just tick the CGI tickbox under windows server IIS roles features 
- 
-The next step is to install [[http://windows.php.net/download/|PHP]] for Windows \\ 
-Use the latest stable non-thread safe version (MS recommends this) \\ 
-install this into C:\PHP\ 
- 
-Next try to see if PHP Works via the command line 
-<code> 
-cd C:\PHP\ 
-php -info 
-</code> 
- 
-If you get an error about MSVCR110.dll then try installing this (64bit) [[http://www.microsoft.com/en-us/download/details.aspx?id=30679|Link]] 
- 
-==== Handler Mappings ==== 
- 
-Next we need to setup the Handler Mappings for IIS7 
-  * Open the IIS Manager 
-  * Select the Server 
-  * Double Click the Handler Mappings Icon 
- 
-  * Select Add Module Mapping 
- 
-^ Title ^ Value ^ 
-| Request path: | *.php | 
-| Module: | FastCgiModule | 
-| Executable | C:\PHP\php-cgi.exe | 
-| Name | PHP via FastCGI | 
- 
  
  
Line 45: Line 9:
 === Install PHP === === Install PHP ===
  
-  * New DL-Link for PHP under IIS (auto-install): [[http://www.iis-aid.com/iis_aid_php_installer|IIS-Aid]]+  * New DL-Link for PHP under IIS (auto-install): [[http://www.iis-aid.com/iis_aid_php_installer|IIS-Aid]]FIXME Link broken/Download unavailable
   * If you want to do an offline install and want to use fast-cgi, install the addin before you install php: [[http://www.iis.net/extensions/FastCGI|IIS-FastCGI]]   * If you want to do an offline install and want to use fast-cgi, install the addin before you install php: [[http://www.iis.net/extensions/FastCGI|IIS-FastCGI]]
 (Just install and leave the setting 'download and install FastCGI' and it will auto-detect fast-cgi on your System) (Just install and leave the setting 'download and install FastCGI' and it will auto-detect fast-cgi on your System)
-  * Use the windows install from PHP's website. See the [[http://www.php.net|PHP site]] for installers or complete packages. PHP can run either as CGI-application or as an ISAPI extension. As an alternative, see the [[http://php.iis.net/| Microsoft IIS Site]] for automatic setup of PHP.+  * Use the windows install from PHP's website. See the [[http://www.php.net|PHP site]] for installers or complete packages. PHP is not fully compatible between major releases, as of Q1/2021 choose the newest 7.x release. If in doubt, refer to the [[:Requirements|system requirements]]. PHP can run either as CGI-application or as an ISAPI extension. As an alternative, see the [[http://php.iis.net/| Microsoft IIS Site]] for automatic setup of PHP.
   * If you're using the [[http://www.php.net/manual/en/book.wincache.php|Windows Cache Extension for PHP]], you will need to disable the file caching functionality of the extension by setting ''[[http://www.php.net/manual/en/wincache.configuration.php#ini.wincache.fcenabled|wincache.fcenabled]]'' to ''0'' in ''php.ini''.   * If you're using the [[http://www.php.net/manual/en/book.wincache.php|Windows Cache Extension for PHP]], you will need to disable the file caching functionality of the extension by setting ''[[http://www.php.net/manual/en/wincache.configuration.php#ini.wincache.fcenabled|wincache.fcenabled]]'' to ''0'' in ''php.ini''.
  
Line 68: Line 32:
  
  
-===== IIS7 =====+===== IIS7/10 =====
  
 ==== Install PHP ==== ==== Install PHP ====
  
-  * Use the windows install from PHP's website. See the [[http://windows.php.net/download/|PHP site]] for installers or complete packages. There are 2 installers, choose the "thread safe" and the "non-thread safe" installer. It is recommended that you use a non-thread safe build of PHP with IIS 7 FastCGI. A non-thread safe build of PHP provides significant performance gains over the standard build by not doing any thread-safety checks, which are not necessary, since FastCGI ensures a single threaded execution environment.+  * Use the windows install from PHP's website. See the [[http://windows.php.net/download/|PHP site]] for installers or complete packages. PHP is not fully compatible between major releases, as of Q1/2021 choose the newest 7.x release. If in doubt, refer to the [[:Requirements|system requirements]]. There are 2 installers, the "thread safe" and the "non-thread safe" installer. It is recommended that you use a non-thread safe build of PHP with IIS 7 FastCGI. A non-thread safe build of PHP provides significant performance gains over the standard build by not doing any thread-safety checks, which are not necessary, since FastCGI ensures a single threaded execution environment.
   * PHP can run either as CGI-application or as an ISAPI extension.  These instructions are for Fast-CGI as it is quicker and more stable than ISAPI.  Even Microsoft instructs to install using Fast-CGI, even though they invented ISAPI. See the [[http://learn.iis.net/page.aspx/246/using-fastcgi-to-host-php-applications-on-iis-7/|How To]]   * PHP can run either as CGI-application or as an ISAPI extension.  These instructions are for Fast-CGI as it is quicker and more stable than ISAPI.  Even Microsoft instructs to install using Fast-CGI, even though they invented ISAPI. See the [[http://learn.iis.net/page.aspx/246/using-fastcgi-to-host-php-applications-on-iis-7/|How To]]
  
Line 94: Line 58:
     * New Website like "wiki.YourSite.com": so add an new website-Config in the IIS and set the Root-Directory to the wiki-code-location     * New Website like "wiki.YourSite.com": so add an new website-Config in the IIS and set the Root-Directory to the wiki-code-location
   - Browse to the ''dokuwiki/'' directory and Check the properties of the ''data/'' folder.  Ensure that the Internet Guest Account(IUSR), the appropriate web server account or Server Group(IIS_IUSRS) has Folder level "Write" permissions to the ''data/'' folder. See above for instructions.   - Browse to the ''dokuwiki/'' directory and Check the properties of the ''data/'' folder.  Ensure that the Internet Guest Account(IUSR), the appropriate web server account or Server Group(IIS_IUSRS) has Folder level "Write" permissions to the ''data/'' folder. See above for instructions.
-  - Browse to the ''dokuwiki/'' directory and Check the properties of the ''conf/'' folder.  Ensure that the Internet Guest Account(IUSR), the appropriate web server account or Server Group(IIS_IUSRS) has Folder level "Write" permissions to the ''conf/'' folder.  See above for instructions.+  - Browse to the ''dokuwiki/'' directory and ensure that the Internet Guest Account(IUSR), the appropriate web server account or Server Group(IIS_IUSRS) has Folder level "Write" permissions to the ''conf/'' folder.  See above for instructions. 
 +        * ''conf/'' 
 +        * ''lib/plugins'' (//if you don't do this, you will see the warning message in the Extension Manager//)
   - The wiki installer should now be available.  Depending on how you installed it you can find it at %%http://localhost/dokuwiki/install.php%% OR %%http://(wiki site name)/install.php%%   - The wiki installer should now be available.  Depending on how you installed it you can find it at %%http://localhost/dokuwiki/install.php%% OR %%http://(wiki site name)/install.php%%
-  - Browse to the ''dokuwiki/'' directory and delete the install.php file. +  - Browse to the ''dokuwiki/'' directory and delete the install.php file
 + 
 + 
 + 
 + 
 +==== Rewrite ==== 
 +Enable url rewriting and insert appropriate set of rules: 
 + 
 +<code xml> 
 +<rewrite> 
 +<rules> 
 +  
 +<rule name="rule 1C" stopProcessing="true"> 
 + <match url="^_media/(.*)" /> 
 + <action type="Rewrite" url="/lib/exe/fetch.php?media={R:1}" appendQueryString="true" /> 
 +</rule> 
 +<rule name="rule 2C" stopProcessing="true"> 
 + <match url="^_detail/(.*)" /> 
 + <action type="Rewrite" url="/lib/exe/detail.php?media={R:1}" appendQueryString="true" /> 
 +</rule> 
 +<rule name="rule 3C" stopProcessing="true"> 
 + <match url="^_export/([^/]+)/(.*)" /> 
 + <action type="Rewrite" url="/doku.php?do=export_{R:1}&amp;id={R:2}" appendQueryString="true" /> 
 +</rule> 
 +<rule name="rule 4C" stopProcessing="true"> 
 + <match url="^$" /> 
 + <action type="Rewrite" url="/doku.php" /> 
 +          <conditions> 
 +            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> 
 +            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> 
 +           </conditions> 
 +</rule> 
 +<rule name="rule 5C" stopProcessing="true"> 
 + <match url="(.*)" /> 
 + <action type="Rewrite" url="/doku.php?id={R:1}" appendQueryString="true" /> 
 +          <conditions> 
 +            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> 
 +            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> 
 +          </conditions> 
 +</rule> 
 +<rule name="rule 6C"> 
 + <match url="^index.php$" /> 
 + <action type="Rewrite" url="/doku.php" /> 
 +</rule> 
 +</rules> 
 +</rewrite> 
 + 
 +</code> 
 + 
 +**If you are using Azure Web App**, just put these lines under the <system.webServer> tags in web.config file (situated in wwwroot of your App). 
 + 
 + 
 +=== IIS 7.0 or greater === 
 +IIS 7.0 and above can be extended with a the URL Rewrite module 2.0 available from Microsoft for both [[https://download.microsoft.com/download/D/8/1/D81E5DD6-1ABB-46B0-9B4B-21894E18B77F/rewrite_x86_en-US.msi|x86]] and [[https://download.microsoft.com/download/1/2/8/128E2E22-C1B9-44A4-BE2A-5859ED1D4592/rewrite_amd64_en-US.msi|x64]]  
 + 
 +Save the Apache rules above to a .htaccess file removing the "RewriteBase /dokuwiki" line. This will not be required as we will be adding the rules directly to the root of the wiki. 
 + 
 +In IIS Manager select your Wiki folder, and under IIS select "URL Rewrite" (if you had Manager open before installing, a refresh will be required)  
 + 
 +In the actions pane on the right hand side, choose "Import Rules" 
 + 
 +For your configuration file, select the .htaccess file and Import, this should give you 6 converted rules. 
 + 
 +Finally hit Apply in the Actions panel on the right hand side. 
 + 
 +Configure your Wiki to use .htaccess rules for rewrite and you should now be seeing your URLs rewritten.
  
install/iis.1419246624.txt.gz · Last modified: 2014-12-22 12:10 by 62.232.64.37

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki