Aquesta pàgina forma part de la documentació de Moodle en català, tot i que no ha estat traduïda encara. Podeu contribuir obertament a les tasques de traducció. Podeu consultar la Guia d'edició de la documentació i també participar ens els debats del fòrum de traductors de la documentació a moodle.org

Internet Information Services: diferència entre les revisions

De MoodleDocs
Salta a:navegació, cerca
(Adding capture of settings)
 
(8 revisions intermèdies per 2 usuaris que no es mostren)
Línia 1: Línia 1:
{{Installing Moodle}}[[Internet Information Services]] ('''IIS''') is the web server software bundled with Windows Server, as well as certain client versions of Windows.
{{Installing Moodle}}[[Internet Information Services]] ('''IIS''') is the web server software bundled with Windows Server, as well as certain client versions of Windows. Please note Apache web server has much better community support and there are usually fewer problems when running Moodle on Apache.


==PHP installation==
==PHP installation==
Línia 7: Línia 7:
==Configuration==
==Configuration==


Unfortunately IIS does not natively support unicode characters in so called ''slashargument URL'' which are used in Moodle for file serving. Moodle requires manual configuration of rewrite rules, the PHP installation via ''Microsoft Web Platform Installer'' installs necessary ''URL Rewrite 2.0'' module.
===Fix UTF-8 file names===
 
By default IIS is unable to handle unicode characters in files uploaded into Moodle.
 
See http://support.microsoft.com/kb/2277918.
 
Execute:
<code>
reg add HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\w3svc\Parameters /v FastCGIUtf8ServerVariables /t REG_MULTI_SZ /d REQUEST_URI\0PATH_INFO
</code>
 
===URL rewriting workaround===
If you can not modify registry as described above you may try manual configuration of rewrite rules, the PHP installation via ''Microsoft Web Platform Installer'' installs necessary ''URL Rewrite 2.0'' module.


[[File:Rewrite_rule_-_Internet_Information_Services_(IIS)_Manager.png|thumb]]
[[File:Rewrite_rule_-_Internet_Information_Services_(IIS)_Manager.png|thumb]]


Add following rewrite rule to enable support for unicode file names in Moodle:
 
Add following rewrite rule to enable support for unicode file names in Moodle and to work around internal file length limitation breaking YUI file serving:


* Matches the Pattern - Regular Expressions - <code>^([^\?]+?\.php)(\/.+)$</code>
* Matches the Pattern - Regular Expressions - <code>^([^\?]+?\.php)(\/.+)$</code>
* Action - Rewrite - <code>{R:1}\?file={R:2}</code> - Append query string
* Action - Rewrite - <code>{R:1}\?file={R:2}</code>
* Append query string - enabled
* Stop processing of subsequent rules - enabled
 
===CGI timeouts===
 
By default IIS is configured to stop execution of any PHP script after 5 minutes of activity, this interferes with long running Moodle scripts such as upgrade or cron. The timeout should be increased to at least one hour.


==Directory permissions==
==Directory permissions==
Línia 22: Línia 41:
==Debugging problems==
==Debugging problems==


By default IIS contains custom error pages that intentionally hide error details on production sites. When diagnosing problems you may want to disable temporarily the IIS Error Pages.
By default, IIS contains custom error pages that intentionally hide error details on production sites. When diagnosing problems you may want to disable temporarily the IIS Error Pages so you can see Moodle specific error messages, alongside enabling debugging in ''Settings>Site administration>Development>Debugging''. This [http://blogs.iis.net/kehand/archive/2009/08/09/php-and-custom-error-pages.aspx blog post about IIS error messages] explains how to get more useful error messages when using IIS.


== See also ==
== See also ==


* [[Installing MSSQL for PHP]]
* [http://www.iis.net  The Official Microsoft IIS Site]
* [http://www.iis.net  The Official Microsoft IIS Site]
* [http://en.wikipedia.org/wiki/Internet_Information_Services Wikipedia article on IIS]
* [http://en.wikipedia.org/wiki/Internet_Information_Services Wikipedia article on IIS]

Revisió de 13:48, 29 set 2013

Internet Information Services (IIS) is the web server software bundled with Windows Server, as well as certain client versions of Windows. Please note Apache web server has much better community support and there are usually fewer problems when running Moodle on Apache.

PHP installation

It is strongly recommended to use only the official Microsoft PHP installer from http://php.iis.net/, it automatically installs all necessary components and facilitates easy configuration with PHP manager. Manual installation attempts often fail or may not allow Moodle to function properly.

Configuration

Fix UTF-8 file names

By default IIS is unable to handle unicode characters in files uploaded into Moodle.

See http://support.microsoft.com/kb/2277918.

Execute: reg add HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\w3svc\Parameters /v FastCGIUtf8ServerVariables /t REG_MULTI_SZ /d REQUEST_URI\0PATH_INFO

URL rewriting workaround

If you can not modify registry as described above you may try manual configuration of rewrite rules, the PHP installation via Microsoft Web Platform Installer installs necessary URL Rewrite 2.0 module.

Rewrite rule - Internet Information Services (IIS) Manager.png


Add following rewrite rule to enable support for unicode file names in Moodle and to work around internal file length limitation breaking YUI file serving:

  • Matches the Pattern - Regular Expressions - ^([^\?]+?\.php)(\/.+)$
  • Action - Rewrite - {R:1}\?file={R:2}
  • Append query string - enabled
  • Stop processing of subsequent rules - enabled

CGI timeouts

By default IIS is configured to stop execution of any PHP script after 5 minutes of activity, this interferes with long running Moodle scripts such as upgrade or cron. The timeout should be increased to at least one hour.

Directory permissions

The default IIS account is IIS_IUSRS, make sure it has appropriate access right to Moodle dirroot (read only) and dataroot (read/write) directories.

Debugging problems

By default, IIS contains custom error pages that intentionally hide error details on production sites. When diagnosing problems you may want to disable temporarily the IIS Error Pages so you can see Moodle specific error messages, alongside enabling debugging in Settings>Site administration>Development>Debugging. This blog post about IIS error messages explains how to get more useful error messages when using IIS.

See also