这是本文档旧的修订版!
配置 DokuWiki
许多 DokuWiki 的功能可以通过配置不同的配置选项,最简单的方法是使用 配置管理器 来修改这些选项 。Wiki的管理员能用自己喜欢的网页浏览器轻松在线更改配置选项。
请用超级用户身份登录后点击 管理员 按钮。
那些能被配置?
DokuWiki 的“系统” 配置可以在文件 conf/dokuwiki.php
中找到。然而这个文件只包含系统“缺省”设置。你可以通过编辑 conf/local.php
文件来修改相关配置,如果文件不存在,你也可以自己创建。 你可以通过下面的 可用选项 中的列表来查找出除了这些文件以外的配置选项。
用户账号,(认证)密码和访问控制规则都包含在文件users.auth.php and acl.auth.php中。
当通过媒体管理器上传一个新的文件的时候,可能出现 “上传失败。该扩展名被禁止!”
的提示。这是由 conf/mime.conf
文件来控制扩展名的。要想上传其他格式的文件,可以在 mime.conf 文件中指定。
当你修改页面的时候会有自动保全功能。生成工具提示,笑脸表情或者特殊字符,这些行为都是由 acronyms.conf, smileys.conf 和 entities.conf 文件约束。
配置文件
所有的配置文件都可以在 ./conf
目录中找到,如果通过Debian package安装的话,配置文件目录是 /etc/dokuwiki
。
“主文件” 通常由 DokuWiki 管理, 然而 “局部文件” 必须由 wiki管理员创建.
如果本地文件支持,你应该直接使用而不是修改主文件以避免升级错误。
主文件 | 局部文件 | 配置类型 | 简要信息 |
---|---|---|---|
dokuwiki.php | local.php local.protected.php | see below | general wiki configuration |
acronyms.conf | acronyms.local.conf | abbreviations | automatic abbreviation hints |
entities.conf | entities.local.conf | entities | automatic text replacements |
interwiki.conf | interwiki.local.conf | interwiki | interwiki shortcut links |
mime.conf | mime.local.conf | mime | mime type settings for uploads |
smileys.conf | smileys.local.conf | smileys | image replacements |
acl.auth.php | 参照 acl | Access Control settings | |
users.auth.php | 参照 acl | Users and passwords | |
license.php | license.local.php | license | list of available licenses |
scheme.conf | scheme.local.conf | urlschemes | URL schemes to be recognized as links |
mediameta.php | exif | Metadata editable for images | |
wordblock.conf | wordblock.local.conf | blacklist | Spam blacklist |
plugins.required.php | plugins.local.php plugins.protected.php | see below | Enabling/disabling plugins |
userscript.js | javascript | Custom JavaScript enhancements | |
userstyle.css | css | Custom CSS enhancements |
启用/关闭 插件
默认被安装的插件会被立即启用。 当然你可以试试 Plugin Manager ,她可以通过改写 plugins.local.php
文件来将其关闭.你可以将某些插件放置到conf/plugins.protected.php
,以此来将其保护起来 。
DokuWiki 默认按照以下顺序来加载她的配置文件:
conf/plugins.php
– 默认的插件conf/plugins.local.php
– 通过插件管理器更改conf/plugins.required.php
– 这些核心插件不能通过插件管理器来控制conf/plugins.protected.php
– 在其他文件里重新设置
配置文件的加载顺序是通过全局变量 $config_cascade
控制。你可以通过修改 preload.php 改变其顺序等。
Configuration Options
Most of DokuWiki's features can be configured through various config options. The easiest way to modify these options is using the Configuration Manager.
The available settings are listed below. Their default values are stored in a file called conf/dokuwiki.php
. If you want to modify a setting you should do this in a file called conf/local.php
– this makes sure your special configs are not overwritten by a later upgrade. The config manager will use this file as well. The file conf/local.protected.php
can be used for configuration settings which cannot be modified.
Here is a sample conf/local.php
:
<?php $conf['title'] = "Admin's Wiki. "; $conf['useacl'] = 1; $conf['superuser'] = 'admin';
Some notes about the config file. The file is a piece of PHP code so the PHP syntax has to be preserved. E.g. each line has to have a semicolon at the end. There are multiple types of variables:
- Numbers can be written as is. Example:
9
- Strings have to be enclosed in single or double quotes. Example:
'foo bar'
- Booleans can be either
1
or0
- Arrays contain multiple values of one of the above types
Available Options
- Basic Settings
- Display Settings
- Authentication Settings
- Anti-Spam Settings
- Editing Settings
- Link Settings
- Media Settings
- Advanced options
- Network Settings