您的足迹:
差别
这里会显示出您选择的修订版和当前版本之间的差别。
后一修订版 | 前一修订版 | ||
config:xsendfile [2018/05/20 09:44] eureka 创建 |
config:xsendfile [2018/05/20 10:11] (当前版本) eureka |
||
---|---|---|---|
行 1: | 行 1: | ||
- | ====== Configuration Setting: xsendfile ====== | + | ====== 配置设置: xsendfile ====== |
- | In DokuWiki all media files (e.g. [[:images]]) are delivered using a PHP script to check access restrictions and in the case of images, resize them. This requires more resources than delivering them by the webserver alone. Several webservers make it possible to take over delivery from a script once it has done its checks. This is done by sending a certain HTTP header. The header itself is dependent on the particular webserver. | + | 在DokuWiki中,所有媒体文件 (例如 [[:images]]) 由PHP脚本分发,以检查约束以及在某些时候进行大小调整。这比单独使用WEB服务器更耗资源。有些WEB服务器在它完成检查后可以接管脚本分发。这通过发送特定的HTTP Header完成。Header本身依靠特定的WEB服务器。 |
+ | |||
+ | 该选项激活发送这些Header。注:如果你在这里用了错误的选项,你的图片和下载将不会起作用。 | ||
- | This option enables sending of this header. Note: if you enable the wrong option here, your images and downloads may no longer work. | ||
* Type: Number | * Type: Number | ||
* Default: 0 | * Default: 0 | ||
- | The following options are available: | + | 存在以下选项: |
^ Value ^ Result ^ | ^ Value ^ Result ^ | ||
- | | 0 | No header is sent, all data is delivered by DokuWiki | | + | | 0 | 不发送header, 所有数据由DokuWiki分发 | |
- | | 1 | A proprietary lighttpd header is used (for lighttpd < 1.5) | | + | | 1 | 使用了专有的lighttpd header (对于 lighttpd < 1.5) | |
- | | 2 | A standard X-Sendfile header is used | | + | | 2 | 使用一个标准的X-Sendfile header | |
- | | 3 | A proprietary Nginx header is used | | + | | 3 | 使用专有的Nginx header | |
- | For X-SendFile support in Apache you need [[https://github.com/nmaier/mod_xsendfile/|mod_xsendfile]]. Then add the ''XSendFile on'' and the ''XSendFilePath PATH'' directive to (for example) your ''VirtualHost'' configuration. The ''PATH'' for ''XSendFilePath'' should be the path to the data directory of your DokuWiki installation. | + | 在Apache中支持 X-SendFile 你需要 [[https://github.com/nmaier/mod_xsendfile/|mod_xsendfile]]. 然后添加 ''XSendFile on'' 和 ''XSendFilePath PATH'' 指令到 (例如) 你的 ''VirtualHost'' 配置. ''XSendFilePath'' 的 ''PATH'' 应该是你的Dokuwiki安装到data目录的路径。 |
- | Accelerated downloads in [[http://wiki.nginx.org/XSendfile|nginx]] are only possible with URIs. Configure a location for your data directory relative to the wiki root. | + | 在[[http://wiki.nginx.org/XSendfile|nginx]] 中加速下载仅在URI时可以。配置你相对于wiki根目录的data目录的location: |
<code bash> | <code bash> | ||
location ~ ^/dokuwiki/data/ { | location ~ ^/dokuwiki/data/ { | ||
行 25: | 行 26: | ||
} | } | ||
</code> | </code> | ||
- | The ''internal'' option protects the path from being accessed remotely. If the data directory is not a subdirectory of the web root, you can use an ''alias'' instead. | + | ''internal'' 选项保护路径不被远程访问。如果data目录不是网站root的子目录,你可以使用''alias'' 。 |
<code bash> | <code bash> | ||
location ~ ^/dokuwiki/.*\.php { | location ~ ^/dokuwiki/.*\.php { | ||
行 37: | 行 38: | ||
</code> | </code> | ||
- | {{:config:warning.png }} **Warning**: Changing this option could cause unintended behaviour. | + | {{:config:warning.png }} **警告**: 更改本选项可能导致不可预料的行为。 |
- | + | ||
- | ===== See also ===== | + | |
- | * [[:config:|Configuring DokuWiki]] | ||