文書の過去の版を表示しています。
目次
インストール
DokuWikiのインストールはとても簡単――通常はファイルを解凍してパーミッションを設定するだけで使えますが、ここではいろんな環境に対応する方法の詳細をご説明します。
ステップ1: ダウンロードページ から最新版1)をダウンロードします。ここまでの手順は誰でも同じです。
ステップ2: 使っているプラットフォームに応じたそれぞれの説明にしたがって作業してください。
基本のインストール作業の直後の箱から出したままの状態のDokuWikiは次のような動作をします。
- そのままではまだ動きません。 “changes.log” という名前の空のファイルを/dataディレクトリに作って、そのファイルに書き込み可能なパーミッションを設定する必要があります。これがないと “changes.log does not exist or isn't writable.” といったエラーが出ます。
- この他のディレクトリでも同様の問題が起こります。 “metadir does not exist or isn't writable. Check config!” とか “mediadir does not exist or isn't writable. Check config!” というエラーが出た場合は、/dataディレクトリの下に指摘されたサブディレクトリ(この場合mediaやmeta)を作ってください。この他の必要なディレクトリの名前は '/inc/init.php' ファイルの中を参照してください。
- アクセスコントロール機能が動いていません(Authentication Options参照)
- 誰でもページを読め、編集でき、作成できる状態になっています(Permissionlevels参照)
(上記の『ディレクトリやファイルがない』という問題は将来の新しいバージョンでは修正したいと思っています。提案:必要な空のファイルとディレクトリをあらかじめアーカイブファイルの中に入れておく。可能か?あるいは、スペース1つだけが入ったファイルを入れる?
Linux/UnixとApache一般
これは企業内サーバーなどroot権限を持っているサーバーにDokuWikiをインストールする場合など、もっとも通常の方法です。
- Apache(Webサーバー)とPHPがインストールされていることを確認してください(たいていのGNU/LinuxディストリビューションはApacheとPHPが標準装備されています)――それぞれのバージョンがDokuWikiに対応していること。
- Webサーバーのドキュメントルートの下のどこかにDokuWikiのtarボールファイルを展開します。例:
#> cd /var/www/ #> tar -xzvf /path/to/downloaded/dokuwiki-YYYY-MM-DD.tgz
- できたディレクトリを好きな名前に変えます
#> mv dokuwiki-YYYY-MM-DD dokuwiki
- 空のログファイルを作ります
#> touch dokuwiki/data/changes.log
- アクセスコントロール(ACL)機能を使いたい場合は、users.auth.phpとacl.auth.phpというファイルを作ります。 (just a user, TL)
#> cp dokuwiki/conf/users.auth.php.dist dokuwiki/conf/users.auth.php #> cp dokuwiki/conf/acl.auth.php.dist dokuwiki/conf/acl.auth.php
- ファイルのパーミッションを正しく設定します
- 通常、Webサーバーのプログラムは
nobody
、www-data
、apache
といった特権なしの特別なユーザー名で動作しています - DokuWikiが使うファイルやディレクトリの中にはWebサーバーが書き込みができるようにパーミッションを設定する必要があるものがあります(ですから下の例の
chown nobody
という部分などは、サーバーの設定にあわせて読み替えてください。例えばchown apache
といったように) - アクセスコントロール機能を使う場合は、ファイルのグループオーナーもWebサーバーが属するグループが書き込めるように変更する必要があります(ユーザーとWebサイトの管理者であるあなたも直接ファイルを編集できるようにするためにグループオーナーを使います)――これを設定しないと、ユーザー登録ができなくなり、あなた自身もWebブラウザからACLの設定ができなくなります。私自身、ACL機能を使ったサイトをインストールするときによくこの設定を忘れてしまうので、ここでご説明しています。
- Webサーバープログラムが属しているグループの名前は通常はユーザー名と同じか “nobody/nogroup” の組み合わせですが、念のためあなたのサーバーの設定がどうなっているか確認してください (just a user, TL)
#> chgrp nogroup dokuwiki/conf/users.auth.php #> chgrp nogroup dokuwiki/conf/acl.auth.php
#> chown -R nobody dokuwiki/data
- その他、必要に応じて
dokuwiki/conf/dokuwiki.php
(config参照)ファイルを編集します。あるいは、dokuwiki/conf/local.php
というファイルを作って、その中にdokuwiki.php
から変更したい行だけを抜き出して書き込みます。こうしておくと、新しいバージョンのDokuWikiをインストールするときに、dokuwiki.php
を上書きしてもあなたが追加した変更はそのまま引き継がれます - 最後に、設定がすべて正しくできたか確認します。DokuWikiのURLの後ろに
check
オプションをつけてブラウザで開きます: http://127.0.0.1/dokuwiki/doku.php?do=check
- アクセスコントロール機能を使うときは、自分がログインしたときに画面に “管理” ボタンが表示されるようにするために、自分自身を管理者として指定する必要があります(dokuwiki.phpかlocal.phpの中で、管理者として自分のユーザー名を指定、あるいは管理者グループとして指定したグループの中に自分のユーザー名を登録します。 (just a user, TL)
注意
- まれに、chownがうまく効かない場合があります。そのときは、dataディレクトリをchownするかわりにchmodして書き込めるようにします
- .htaccessファイルでの指定がエラーを起こす場合があります。 'Internal Server Error 500' が出て、どんな単純なPHPプログラムも動かないといった症状です。その場合は.htaccessファイルの名前を変えるか削除すると直ります。
Debian GNU/Linux, Ubuntu Linux
Official Debian Packages, provided by Matti Pöllä, can be fetched with apt from the testing and unstable sections. Homepage for this .deb is http://packages.debian.org/unstable/web/dokuwiki.
On Ubuntu, Dokuwiki is avaliable from the “universe”. Please see https://wiki.ubuntu.com/UniversePackages for instructions on how to add this to your system. Once you have added it, you will be able to continue on with this guide. Remember that all apt-get commands need to be run as root (using “sudo”).
To install DokuWiki, use the standard Debian procedure:
#> apt-get update #> apt-get install dokuwiki
The package is unpacked, debconf asks a few questions, and it is set up. You can then invoke dokuwiki through your browser. For example, if you said the web-accessible location should be /dokuwiki, and access should be by localhost only, http://localhost/dokuwiki will bring up the start page.
Use the Debian bug tracking system to report any bugs with the package http://www.debian.org/Bugs/
FreeBSD
To install dokuwiki using the FreeBSD ports tree, do the following:
#> cd /usr/ports/www/dokuwiki #> make install clean
The default DokuWiki directory is /usr/local/www/data/dokuwiki
– Of course the directory can be changed or symbolic linked to anywhere
To upgrade using the ports tree, do:
#> portupgrade dokuwiki
Make sure that the ports tree has been updated, or this will have no effect.
Mac OS X and Apache
See the detailed HOWTO for DokuWiki on Tiger.
The HOWTO does not appear to be up-to-date (though it was helpful).
Below is what I did for Tiger (no previous DokuWiki installed):
- Enable PHP on Mac OS X (includes starting Personal Web Sharing)
- Downloaded dokuwiki-2005-07-13.tgz (assuming to ~/Desktop)
- From the command line:
$ cd ~/Desktop && tar -zxvf dokuwiki-2005-07-13.tgz $ mv dokuwiki-2005-07-13 ~/Sites/dokuwiki $ cd ~/Sites/dokuwiki $ touch data/changes.log $ sudo chown -R www data
- If you want autorization (change useacl in conf/local.php), also from the command line:
$ cp conf/users.auth.php.dist conf/users.auth.php $ sudo chown www conf/users.auth.php $ cp conf/acl.auth.php.dist conf/acl.auth.php $ sudo chown www conf/acl.auth.php
- Important: set
$conf['basedir'] = '/~user/dokuwiki/';
in conf/local.php; autodetection does not work!
## in 10.4.3 client running the built in apache, but with site at /Library/Webserver/Documents (to mimic server) adding 'basedir' actually breaks it.
Windows
With Apache
This is for people who want to use DokuWiki on their Desktop-Machine
- Make sure you have Apache and PHP installed 2)
- move the
dokuwiki-YYYY-MM-DD
directory to somewhere below your new webserver documentroot eg.c:\xampp\htdocs\
and rename it todokuwiki
- in the
dokuwiki/data/
directory create a new empty file namedchanges.log
(rightclick and select new → Textfile, then rename the file) - edit the
dokuwiki.php
file in theconf
directory to configure your Wiki (see config) or (better) create a newconf/local.php
file containing those lines fromdokuwiki.php
, which you want to change. This way your changes are preserved when overwriting thedokuwiki.php
with a new release. - Your new Wiki should be available at http://127.0.0.1/dokuwiki/doku.php
Sometimes, you might require to create a attic/ directory under data dir. Thanks to oak to help me out with this.
In the last version (2005-07-01) you have to create those directories too : data/cache, data/meta, data/locks.
With IIS
This is for people who want to use DokuWiki on a Windows machine with IIS webserver (Windows 2000, Windows XP or Windows Server 2003)
- Make sure you have PHP installed. See the PHP site for installers or complete packages. PHP can run either as CGI-application or as an ISAPI extension.
- Rename the
dokuwiki-YYYY-MM-DD
directory todokuwiki
and move it to- somewhere below your new webserver documentroot, e.g.
c:\inetpub\dokuwiki
- any other location on your machine, and make sure to setup a Virtual Directory mapping to that location
- In the
dokuwiki/data/
directory create a new empty file namedchanges.log
, and create the folders attic/, meta/, locks/ and cache/ - Edit the
dokuwiki.php
file in theconf
directory to configure your Wiki (see config) or (better) create a newconf/local.php
file containing those lines fromdokuwiki.php
, which you want to change. This way your changes are preserved when overwriting thedokuwiki.php
with a new release. - Your new Wiki should be available at http://localhost/dokuwiki/doku.php
File Extraction
Windows-Users may need to rename the file from dokuwiki-YYYY-MM-DD.tgz
to dokuwiki-YYYY-MM-DD.tar.gz
to make their archive tool recognize the file format correctly (See 209).
The windows file extension is now .tar - however renaming it and using winzip works just fine.
Extraction Programs:
- Windows zipping and compression program, WinZIP
- Opensource file archiver, 7-Zip
- For Windows and other platforms, free Ultimate Zip worked fine for me in unpacking dokuwiki.tgz.
- Use the amazing TotalCommander, it handles tgz and FTP perfectly.
NanoWeb Web Server
NanoWeb is a PHP-based web server, and much lighter in its memory footprint than something like Apache. Nagios and Double Choco Latte both work fine, as does DokuWiki.
However, after following the instructions as described above for use with the Apache web server, it will be necessary to modify dokuwiki.php, as it does not automatically detect its web server location (URL).
Autodetection of an URL is not possible in all thinkable environments. Especially not when extensive URL rewriting and other forwarding mechnisms are in use. Furthermore the word “relative dir” is a bit missleading. Because dokuwiki requires an absolute pathname here. So start with a slash and end with a slash as in the example below. – Doogie - 27. May 2005
Change the line:
$conf['basedir'] = ''; //relative dir to serveroot - blank for autodetection
to something like:
$conf['basedir'] = '/dokuwiki/'; //relative dir to serveroot - blank for autodetection
Note that, for whatever reason, a trailing slash is required!!
FTPでファイルを転送するホスティングサービスのサーバー
レンタルサーバーをお使いの方はほとんどこれに該当します
このタイプのサーバーへのインストールの英語版のScreencast(動画デモ)もご覧ください。
- ダウンロードしたtarボールのファイルをローカルのパソコンのハードディスク上に展開します 3)。
dokuwiki-YYYY-MM-DD/data
ディレクトリの中にchanges.log
という空のファイルを作ります。- Windowsの場合: Explorerでマウスを右クリックし、新規作成 → テキスト ドキュメントでファイルを作成してからファイル名を変更
conf
ディレクトリの中のdokuwiki.php
ファイルを編集してWikiの設定を変更(設定を参照)するか、conf/local.php
という新しいファイルを作って、その中にdokuwiki.php
の中から変更したい行だけを抜き出したものを書き込みます。後者の場合、DokuWikiの新しいバージョンを上書きインストールしても、あなたが設定した変更内容はそのまま保存されるので、こちらがお勧めです。- お好みのFTPツールを使って
dokuwiki-YYYY-MM-DD
ディレクトリの中身をそのままWebサーバーにアップロードします。このとき、dokuwiki-YYYY-MM-DD
というディレクトリの名前をdokuwiki
などお好みのものに変えてください。 - ホスティング会社のFTPサーバーの設定によっては、このままですでにDokuWikiが使える状態になっているかもしれません ― 次のようにURLの後ろに
check
オプションをつけてDokuWikiのページを開いてみます: http://www.example.com/dokuwiki/doku.php?do=check - 赤い警告メッセージが出ている場合は、FTPプログラムを使ってファイルのパーミッションを変更する必要があります。
- FTPプログラムでファイルのパーミッションを変更するオプションはたいてい
chmod
という名前がついていて、メニューのどこかに隠れていたり、ファイルを右クリックすると使えたりします。
- いちばん単純な設定は、
dokuwiki/data/
ディレクトリとその中の全部のファイルとディレクトリのパーミッションをrwxrwxrwx
あるいは777
に変更することです。 その前に、まず
rwxrwx—
あるいは770
というパーミッション設定を試してみるのがよいでしょう。―このほうがセキュリティ上より安心な設定ですが、ホスティング会社のサーバーの設定によってはこのパーミッションではDokuWikiがうまく動作しないこともあります。
Development Versions
You can also check out the newest development version using darcs.
Upgrading
Before upgrading, you should always read the changelog to see if something changed you should be aware of when upgrading. To determine the version you are running, have a look in the HTML source of a Page generated by DokuWiki there should be something like <meta name=“generator” content=“DokuWiki 2005-02-06” />
4).
Some reminders! I tried to upgrade from 2005-05-17 to 2005-07-13, and had problems with plain ACL. This has been discussed at http://wiki.splitbrain.org/wiki:discussion:acl?s=users%5C.auth#user_registration_-_can_t_register . I was in the process of reverted to 2005-05-13, and decided to give another try, which appears to have been successful. Two hints: (a) when transferring files over to the updated program directory, make sure that the chmod is set to 777 for all of them, or they won't be editable!; and (b) when updating configuration files, remember to use a UTF-8 editor if you're on Windows! (I use Crimson Editor). {David Ing, 2005/07/17}
The easiest way to upgrade is perform the following steps
- Move your old installation to a backup directory
- Install the new Version as described above
- Copy your
changes.log
and the contents of yourdata/
(perhaps not thewiki/
directory),attic/
andmedia/
directories from the backup location to the new install dir- As of 2005-07-01, …
- …
changes.log
(which was in the root directory) is now in thedata/
directory; - … the user-created content that was in the
data/
directory is now in thedata/pages/
directory; and - … the
attic/
andmedia/
directories that were in the root directory are now under thedata/
directory.
- Copy your old
conf/local.php
from the backup location to the new install dir- If you had originally edited .htaccess in the root directory for dokuwiki to have “nice URLs”, you should replace the overwritten file from the prior installation. (It's a hidden file!)
-
- These are new files for version 2005-07-13, so you'll have to copy the contents of
user.auth
intouser.auth.php
andacl.auth
intoacl.auth.php
. If you're using Windows, remember to use an editor that saves in UTF-8 Unix format, such as Crimson Editor.
- Try the doku.php?do=check to find out if permissions have changed. On a hosted wiki, the following error messages are evidence that you haven't done chmod at the directory level (let alone the file level!)
- Changelog is not writable
- Datadir is not writable
- This was because the data/pages/ directory was new for 2005-07-01
- Attic is not writable
- Mediadir is not writable
- Cachedir is not writable
If you have made any changes on interwiki or smiley configurations or the source code itself, you will probably want to reapply them after upgrading.
When you upgrade from a version prior to 2005-02-06, you will need to convert your data to UTF8 after upgrading.
If you encounter some inconsistencies in DokuWikis behaviour after upgrading, you should delete the cache files in data/.cache/
and media/.cache/
. You should make sure your browser hasn't cached an old stylesheet, too.
Easier/Faster upgrade method
This method is not official - i (redeeman, visitor) just thought it would be nice to present this method of upgrade, which i just have used myself to upgrade from 2005-07-01 to 2005-07-13.
the thing i do, is to use diff, a command to generate a patch, this should be present on almost any unix system, however, it is probably also possible to find a win32 version on google.
now all we do to create the patch is to unpack the two different versions, so we get the dirs: “dokuwiki-2005-07-01” and “dokuwiki-2005-07-13” (this is the version change i did, your upgrade might be from/to different versions). now all we need to do is issue the diff command, and create the patch:
diff -Naur dokuwiki-2005-07-01 dokuwiki-2005-07-13 > doku.diff
now we have the patch, this is essentially only the differences between the two directories (e.g it knows nowthing of your pages, which is good) and you should be able to patch up, without it interfering with anything. however, you should not, that it might have changes in the conf/ dir in files you have edited, in which case you should do a backup of the file, copy the file from the version you already have, so the patch will work, and then when the patch is applied redo your changes, however this is only the case if changes to the dokuwiki standard php file is in an upgrade.
To check which files the patch will affect, you can run with –dry-run.. just cd into the dir where dokuwiki is installed, and run:
patch -p1 </path/to/doku.diff --dry-run
then if you accept it :) just run it like this, without –dry-run:
patch -p1 </path/to/doku.diff
It Works - What Now ?
Here is what you may want to do when everything is up and working.
- Check the security page for hotfixes
- Consider enabling modrewrite
- Choose a license for your content – edit the
footer.html
inside the dokuwiki/lib/tpl/default folder to represent the appropriate license:- Creative Commons Attribution-NonCommercial-ShareAlike License (included by default)
- If using Apache, enable URL rewriting in
.htaccess
and set the appropriate config file option. - Change the
style.css
to your own ideas - subscribe to DokuWiki at freshmeat.net to stay informed of updates and get a mail whenever a security problem is encountered.
Multiple Wiki
The topic of multi-wiki, or wiki farms, comes up briefly in freelists.org archives, in this thread, this thread, and this one. In the last one, Andi describes changes he made so $conf['title'] can be used to establish different cookies for separate installations.
Note that namespaces could be used to separate content in a single installation. And multiple installation means each one will need its own upgrade. It is not the same as multiple instances sharing common code. Package upgrades, like Debian’s, will not handle multiple installations. But for some this is a price worth paying. Here is an approach that worked with the GNU/Linux installation using Apache. It can probably be adapted to the other situations:
- Do the regular installation, and test it.
- Create conf/local.php with the title line and any other lines you want to tailor.
- Copy the folder “dokuwiki” and give it a name suggesting its content.
- Set $conf[’title’] in local.php of new folder, to title and differentiate the installation.
- If the new folder is named “newwiki,” bring up http://localhost/newwiki.
Do the first two steps once and repeat the last three to make multiple installations.