文書の過去の版を表示しています。
目次
設定
DokuWikiのほとんどの機能はconf/dokuwiki.php
というファイルで設定します。この文書では、このファイルのそれぞれのオプションについて説明します。たいへん分量が多いですが、ご心配なく。ほとんどの場合、設定ファイルの変更なしに、インストールしたままの状態でお使いいただけるようになっています。
設定(config)ファイルについての注意事項です。このファイルはPHPのプログラムファイルで、PHPの文法にのっとって記述しないといけません。たとえば、それぞれの行の終わりは必ずセミコロンで終わっていることなどです。また、設定する変数は次のような種類があります。
- 数値はそのまま数字を記入します。例:
9
- 文字列はアポストロフィで囲みます。例:
'foo bar'
- 論理値は
true
かfalse
、1
か0
のいずれかです。 - 配列には、上の種類のいずれかを複数セットにして格納します。
ヒント: もしconf/local.php
というファイルがあるときは、それも設定ファイルとして読み込まれる仕組みになっています。これのおかげで、conf/dokuwiki.php
ファイルの中の変更したいオプションだけをconf/local.php
に記述して、元のconf/dokuwiki.php
は変更せずに置いておくことができます。こうしておくと、将来DokuWikiをアップグレードするときにファイルの書き換えが簡単になります。
conf/local.phpの例を示します。
<?php $conf['useacl'] = 1; //アクセス制御用にアクセスコントロールリスト機能を使う? ?>
インストール済みのDokuWikiの動作をカスタマイズできる箇所は、このほかにinterwiki、include hooks、templates、smileys、abbreviations、stylesheetsがあります。
Datastorage and Permissions
umask
This parameter influences the file permissions which new files will get. See umask for general info about umask. You're not setting the permissions here but the logically inverse. So the default of 0111
creates files with permissions of 0666
(rw-rw-rw-
).
- Type: Number
- Default:
0111
dmask
This works like umask above but sets the permissions of new directories. The default creates directories with permissions of 0777
(rwxrwxrwx
). For better security (if you followed the installation instructions) change this value to 0002
(rwxrwxr-x
).
- Type: Number
- Default:
0000
basedir
Usually DokuWiki can detect the directory that it is installed in on its own. But sometimes this does not work for various reasons. If DokuWiki does not seem to function properly and cannot find things such as images for its web pages, you can set the directory here.
The path you should set here, is the path from the server root to your DokuWiki installation. Eg. if your wiki is available at http://www.yourserver.com/dokuwiki/
you should set basedir to /dokuwiki/
. Be sure to have a leading and a trailing slash!
- Type: String
- Default:
lang
This sets the language of the interface. See multilanguage.
- Type: String
- Default:
en
savedir
This is the path were all files will be stored. This is a filesystem path. It needs to be writable by the webserver.
- Type: String
- Default:
./data
Inside this directory are multiple subdirectories and the changelog. You can override their position by the following config parameters:
Parameter | default inside savedir |
---|---|
datadir | pages |
olddir | attic |
mediadir | media |
cachedir | cache |
lockdir | locks |
changelog | changes.log |
metadir | meta |
Display options
start
This is the name of the default page which is loaded when no page was given also known as “The Homepage” .
- Type: String
- Default:
start
title
This is the name of your Wiki installation. Change it to whatever you like. If you want to run multiple installations of DokuWiki on the same server they need to have different titles!
- Type: String
- Default:
DokuWiki
template
The name of the template used by your Wiki installation. For more details refer templates.
- Type: String
- Default:
default
fullpath
Enable this to see the full filesystem path of the displayed document.
- Type: boolean
- Default: 1
recent
Defines the number of documents to show in the Recent changes
- Type: Number
- Default:
20
breadcrumbs
Defines the number of recently visited pages to show in the breadcrumbs trail
- Type: Number
- Default:
10
typography
Enable to convert certain character combinations to their typographically correct counterpart.
- Type: Boolean
- Default:
1
htmlok
Defines if embedding HTML using the <html>
tags is allowed. This may break the layout and XHTML compliance if wrong HTML is inserted.
- Type: Boolean
- Default:
0
phpok
Defines if embedding PHP using the <php>
tags is allowed. This is a huge security problem when used on a freely accessible site!
- Type: Boolean
- Default:
0
dformat
Configures how dates are formated. This is directly passed to the date PHP function. Some people may prefer to set it to d.m.Y H:i
.
- Type: String
- Default:
Y/m/d H:i
signature
Configures how the signature string of logged in users should look like. You can use all variables defined by the strftime function and the following special variables:
variable | gets replaced with |
---|---|
@USER@ | The user's login name |
@NAME@ | The user's full name |
@MAIL@ | The user's e-mail address |
@DATE@ | The current date and time formatted as specified in dformat above |
- Type: String
- Default:
--- //[[@MAIL@|@NAME@]] @DATE@//
Some people may prefer to use something shorter like: --- //[[@MAIL@|@USER@]] %b%e//
. If you want to have user pages you could use something like this: --- //[[user:@USER@|@NAME@]] @DATE@//
maxtoclevel
Set this variable to the maximum number of heading levels to include in the automatically generated Table of Contents.
- Type: Number (0-5)
- Default:
3
maxseclevel
Set this variable to the maximum number of heading levels deep to create as separate, editable, sections.
- Type: Number (0-5)
- Default:
3
camelcase
Enable this for CamelCase links. This is a common but controversial way of linking in Wikis. If you enable this, and later disable it again, you may create orphan pages.
- Type: Boolean
- Default:
0
deaccent
When this is enabled, accented chars in page names will be replaced by their unaccented ASCII equivalents. Eg. ü
becomes ue
or á
becomes a
.
- Type: Boolean
- Default:
1
useheading
When this option is enabled, a link to a wiki page name will automatically use the first heading in the page for each of the following:
- The title of the page, as shown in the browser or in search engine results.
- The text for a link to the page, unless the link specification contains an explicit title.
- The title of RSS feed entries for the page (develonly).
For more information, read Using the first heading as the page name.
- Type: Boolean
- Default:
0
Antispam features
usewordblock
Enables the use of a blacklist against WikiSpam.
- Type: Boolean
- Default:
1
mailguard
This configures if and how email addresses will be obfuscated against harvesting bots. Possible options are:
visible
– replaces@
with[at]
,.
with[dot]
and-
with[dash]
hex
– uses hex entities to encode the addressnone
– no obfuscating is used
- Type: String
- Default:
hex
Authentication Options
useacl
Enable this, to use a Access Control List to restrict what the users of your wiki may do.
- Type: Boolean
- Default:
0
openregister
This has only an effect when useacl
is enabled. If this is enabled users are allowed to register themselves. Be sure the conf/users.auth
file is writable by the webserver if you enable this feature.
If openregister
is disabled people can't subscribe themselves to DokuWiki anymore. In this case the superuser is able to register new users through the admin page. A new menu item will appear there when openregister
was disabled.
- Type: Boolean
- Default:
1
autopasswd
DokuWiki supports two methods of password handling after a new user has been registered. The setting of this configuration variable determines which method is used:
- automatically generated passwords (
1
)
The user specifies his email address and DokuWiki generates a password and sends it to him. To use this method, setautopassword
to1
. - user defined passwords (
0
)
The registration form contains two fields where the new user can type in his desired password. No email is sent. To use this method set,autopasswd
to0
.
- Type: Boolean
- Default:
0
authtype
This specifies which backend should be used to authenticate against.
DokuWiki supports several authentication backends. For full list see DokuWiki Manual, Chapter Authentication Methods.
- Type: String
- Default:
plain
passcrypt
Passwords should always be saved as an encrypted hash. DokuWiki supports multiple hash methods, which one it should use is defined by this option. What you choose here depends on your security needs and if you want to use an existing authentication database. DokuWiki is able to determine which method was used from an encrypted password, so you can always change the used method as long as your authentication backend supports this.
The following hash methods are available:
Option | Description |
---|---|
smd5 | Salted MD5 hashing |
md5 | Simple MD5 hashing (this was the method used in older Releases) |
sha1 | SHA1 hashing |
ssha | Salted SHA1 hashing (as used in LDAP) |
crypt | Unix crypt |
mysql | Password as used in MySQL before Version 4.1.1 |
my411 | Password as used in MySQL 4.1.1 or higher |
- Type: String
- Default:
smd5
defaultgroup
If a user signs up (using openregister
) he will automatically be added to this group.
- Type: String
- Default:
user
superuser
Specifies who has superuser rights in DokuWiki. Superusers have always all permissions regardless of ACL restrictions and are allowed to edit ACL restrictions (think root).
You can set either a username or the name of a group by prepending an @
char to the groupname.
- Type: String
- Default:
!!not set!!
profileconfirm
Require a user to confirm their current password when updating their Dokuwiki user profile.
- Type: Boolean
- Default: 1
Advanced options
userewrite
Enable this to use rewriting for nicer URLs. Either using the Apache mod_rewrite module or by letting DokuWiki rewrite the URLs itself-
- Type: Number
- Default:
0
You can set the following values:
Value | Info | Example URL |
---|---|---|
0 | No URL rewriting is used. This is the default. | http://example.com/dokuwiki/doku.php?wiki:syntax |
1 | URL rewriting is done with an Apache module. You need to edit the .htaccess file | http://example.com/dokuwiki/wiki:syntax |
2 | The rewriting is done by DokuWiki. | http://example.com/dokuwiki/doku.php/wiki:syntax |
The included .htaccess example has the correct rules for option 1, they are uncommented below.
It seems the rewriting only works for standard characters while nonstandard ones like öäü for example mess up the system and can't be found. Is there a workaround or are there any plans to fix this?
.htaccess entry for option 2 would be good:
A .htaccess entry for option 2 is not necessary. The whole point of option 2 is it doesn't require a .htaccess file. — Christopher Smith 2005-10-21 23:25
## Enable this to restrict editing to logged in users only #disable indexes Options -Indexes ## make sure nobody gets the htaccess files <Files ~ "^[\._]ht"> Order allow,deny Deny from all Satisfy All </Files> ## Comment these rules in if you want to have nice URLs RewriteEngine on RewriteBase /dokuwiki RewriteRule ^_media/(.*) lib/exe/fetch.php?media=$1 [QSA,L] RewriteRule ^_detail/(.*) lib/exe/detail.php?media=$1 [QSA,L] RewriteRule ^$ doku.php [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ doku.php?id=$1 [L,QSA]
Apache'serror.log
file is a good place to check what goes wrong if the.htaccess
file does not work. Also ensure that yourhttpd.conf
allows user to supply their own.htaccess
file. — Cinly Ooi 2005-11-23 2100 GMT
useslash
If you enabled the rewrite option above, you can use this option to use a slash instead of a colon as namespace separator in URLs.
- Type: Boolean
- Default:
0
sepchar
This variable determines the character that separates words in a page ID and that replaces characters not valid in a page ID.
The page ID is the component of the URL that specifies the page. For example, by default the link doesn't exist goes to the URL wiki.splitbrain.org/wiki:doesn_t_exist
. wiki:doesn_t_exist
is the page ID. The default sepchar is '_', so the apostrophe and the space each appear as an '_' in the link.
By changing sepchar to another character, you can change the '_' to another character. The valid sepchar characters are those that are valid in a page ID: letters, digits, underscore (_
), dash (-
), and dot (.
). The sepchar variable must contain exactly one character.
Be careful with this variable. By changing it you can make pages created under a previous sepchar inaccessible. When you create a new page, the page ID becomes the file name for the page. If you create pages with sepchar '_' and then later use sepchar '-', your links to those previously created pages will break because the links will change but the file names won't.
- Type: Character (letter, digit, '_', '-', or '.')
- Default:
_
canonical
When this is enabled, all links are created as absolute URLs in the form http://server/path
. This was the default in previous releases. URLs relative to the Serverroot are now prefered.
- Type: Boolean
- Default:
0
autoplural
This option is probably only useful in English Wikis. If set to 1
, plural forms of linked pages are tried automatically when if the singular form is not found (and the other way round). So pagenames and pagename would then both link automatically to the same existing page.
- Type: Boolean
- Default:
0
usegzip
When set to 1
(enabled), old versions of files will be stored in compressed format (using gzip).
- Type: Boolean
- Default:
1
cachetime
Configures the maximum age of a cached paged in seconds. See caching.
- Type: Number
- Default:
60*60*24
(one day)
purgeonadd
Configures if the cache is purged on adding a new page. See caching.
- Type: Boolean
- Default:
1
locktime
Defines the maximum age for lockfiles in seconds. See locking.
- Type: Number
- Default:
15*60
(15 Minutes)
notify
This option may contain an email address to which notifications about page adds and changes will be sent. No mails are sent when this is a blank string. To add more than one email address, use the comma to separate the entries (',').
- Type: String
- Default:
mailfrom
This address will be used as sender address for all mails which are sent through DokuWiki. Make sure your Mailserver accepts the address you supply here. If you leave this empty the default PHP address will be used (usually webserveruser@webserverhostname)
- Type: String
- Default:
gdlib
For resizing images DokuWiki uses PHP's libGD if available. DokuWiki tries to detect the availability and version of libGD automatically. However, in older PHP versions, this does not work. You can force a version by setting this variable. Possible values are: '0
' for no libGD support; '1
' for libGD version 1.x; and '2
' for libGD 2 with autodetect.
- Type: Number
- Default: 2
im_convert
By default DokuWiki uses PHP's libGD (see above) however ImageMagick's convert is more powerful but not always available. If it is installed on your server you can give it's path here and DokuWiki will use it instead of libGD.
- Type: String
- Default:
spellchecker
Enables the optional Spell Checker (Check the page for requirements).
- Type: Boolean
- Default: 0
subscribers
Allows to be notify of a specific page changes (similar to the notify option) .
- Type: Boolean
- Default: 0
pluginmanager
- Type: Boolean
- Default: 0
compress
develonly - Enables simple whitespace and comment stripping in CSS and JavaScript files.
- Type: Boolean
- Default: 0
hidepages
develonly - This option accepts a Regular Expression to filter certain pages from all automatic listings (RSS, recent changes, search results, index). This is useful to exclude certain pages like the ones used in the sidebar templates. The regexp is matched against the full page ID with a leading colon. If it matches, the page is assumed to be a hidden one.
- Type: String
- Default:
rss_type
- Type: String
- Default: 'rss1'
rss_linkto
- Type: String
- Default: 'diff'
target
This configures the HTML TARGET value used for different link types. The target value tells the web browser where to open the requested link. If a target is empty, then the link will open in the same window.
- Type: Array
- Default: All external and interwiki links are opened in an new window (
_blank
); all others are opened in the same window.
Possible keys for this array are :
wiki
interwiki
extern
media
for uploaded files.windows
for windows shares.
Possible values for the target attribute :
_blank
: open the link in a new window._self
or empty string : open the link in the same window.- Other values such as
_parent
or_top
or framename assume you are using a template with frames : in that situation, you should know what to put in this array.
proxy
Use this to configure a Web-Proxy to use for outbound connections. See proxy for details.
- Type: Array
- Default: no proxy is used
safemodehack
Enables the safemodehack - read the page for more info
- Type: Boolean
- Default: 0
ftp
FTP-Options for the safemodehack - read the page for more info
- Type: Array
- Default: not used