Command disabled: diff
[wiki]dokuwiki

dokuwiki

インストール

設定

.htaccess

さくらのレンタルサーバに設置するとき以下のようにするとindex.phpがあるようには感じさせない設定にできました。

## Uncomment these rules if you want to have nice URLs using
## $conf['userewrite'] = 1 - not needed for rewrite mode 2
RewriteEngine on
## Not all installations will require the following line.  If you do,
## change "/dokuwiki" to the path to your dokuwiki directory relative
## to your document root.
RewriteBase /
## If you enable DokuWikis XML-RPC interface, you should consider to
## restrict access to it over HTTPS only! Uncomment the following two
## rules if your server setup allows HTTPS.
#RewriteCond %{HTTPS} !=on
#RewriteRule ^lib/exe/xmlrpc.php$     https://%{SERVER_NAME}%{REQUEST_URI} [L,R=301]

RewriteRule ^_media/(.*)             /lib/exe/fetch.php?media=$1  [QSA,L]
RewriteRule ^_detail/(.*)            /lib/exe/detail.php?media=$1  [QSA,L]
RewriteRule ^_export/([^/]+)/(.*)    /doku.php?do=export_$1&id=$2  [QSA,L]
RewriteRule ^/$                       /doku.php  [L]
RewriteCond %{REQUEST_FILENAME}       !-f
RewriteCond %{REQUEST_FILENAME}       !-d
RewriteRule (.*)                      /doku.php?id=$1  [QSA,L]
RewriteRule ^index.php$              /doku.php

ポイントはRewriteBaseが/で、さらにRewriteRuleなどで/を挿入してあげること。
この設定によってVirtualDomainでもうまくうごいてくれています。

新サーバー(FreeBSD 9.x系+ apache httpd 2.2系)になってからうまく動作しなくなりました。
RewriteRule ^/で始まるとループしてしまったりするようなので/を外して書いたほうがいいようです。
また、最近dokuwikiのdoku.phpに?do=registerやdo=login等のリクエストが増えているようです。
この場合の対策は、以下のように設定を追加すれば指定したIPアドレスやホスト以外はエラー画面となります。
RewriteCond %{REMOTE_HOST} !\.example\.jp$
RewriteCond %{REMOTE_HOST} !\.example\.ne\.jp$
RewriteCond %{REMOTE_ADDR} !^203\.0\.113\.101
RewriteCond %{QUERY_STRING} ^.*(do=(login|register)).* [NC]
RewriteRule ^(.*)$ index.php [F,L]
1~3行目を適宜ご自身のISPやIPアドレスに切り替えて指定してみてください。

旧鯖情報は以下を参考にどうぞ。

Apache httpd 1.3.x系(旧式サーバ向け)

以下の設定はFreeBSD 7.x系 + apache httpd 1.3.x系で動いていたものです。新しい環境では動きませんので上記のを参考にしてください。

## Uncomment these rules if you want to have nice URLs using
## $conf['userewrite'] = 1 - not needed for rewrite mode 2
RewriteEngine on
## Not all installations will require the following line.  If you do,
## change "/dokuwiki" to the path to your dokuwiki directory relative
## to your document root.
RewriteBase /
## If you enable DokuWikis XML-RPC interface, you should consider to
## restrict access to it over HTTPS only! Uncomment the following two
## rules if your server setup allows HTTPS.
#RewriteCond %{HTTPS} !=on
#RewriteRule ^lib/exe/xmlrpc.php$     https://%{SERVER_NAME}%{REQUEST_URI} [L,R=301]

RewriteRule ^/_media/(.*)             /lib/exe/fetch.php?media=$1  [QSA,L]
RewriteRule ^/_detail/(.*)            /lib/exe/detail.php?media=$1  [QSA,L]
RewriteRule ^/_export/([^/]+)/(.*)    /doku.php?do=export_$1&id=$2  [QSA,L]
RewriteRule ^/$                       /doku.php  [L]
RewriteCond %{REQUEST_FILENAME}       !-f
RewriteCond %{REQUEST_FILENAME}       !-d
RewriteRule (.*)                      /doku.php?id=$1  [QSA,L]
RewriteRule ^/index.php$              /doku.php

ポイントはRewriteBaseが/で、さらにRewriteRuleなどで/を挿入してあげること。
この設定によってVirtualDomainでもうまくうごいてくれています。

plugins

ja:pluginsでは日本語でプラグインについて解説されていますが、翻訳は遅延しているのでオリジナルの英語版を参考にするといいと思います。
以下は私がこのwikiで導入しているPluginsと簡単な説明です。

プラグイン名 種類 機能 備考
Note PluginSyntaxノート(Tips)を表示
Changes PluginSyntax最近の変更を表示
commentSyntaxコメント機能
Pagelist PluginSyntaxページのリストを表示
Indexmenu tagSyntax指定した項目でインデックスメニューを表示(左側サイドバーの構造化メニュー)
include pluginSyntaxwiki内の中から引用
syntaxhighlighter3 pluginSyntaxsyntaxhighlighter3の導入<code></code>も強力ですが、行番号表示したり強調表示など色々便利です。
WikiCalendar PluginSyntaxカレンダー機能使い方次第ではスケジュール管理っぽいことができるようです
Plugin Numbered HeadingsSyntaxヘッダーに章番号表示(1.1 ~みたいなもの)PurpleNumbersも使ってみましたが私はこちらのほうが好きでした。
hidden PluginSyntax記述内容を非表示長い内容を隠して表示できます(js必須ですが)

改造

加筆修正情報

追記修正@2014/02/18
新サーバに移行後しばらく気が付いていませんでいしたが、新しいさくらのレンタルーサーバはApacheが2.2系ベースとなり従来の1.3系とは異なる挙動です。
このため新しい.htaccessの設定書式と旧式向けの並行記述してあります。

参考資料

  1. DokuWiki [CMSレジュメ]
    Dokuwiki関係の日本語資料としてはプラグインからインストールの注意点まで様々なことが大変参考になります。(サイト閉鎖のためarchive.orgへのリンクに切替え)
  2. 研究開発 [松林堂/shorindo.com]
    dokuwikiのプラグインを作成公開されています。
    comingsoon pluginをこのサイト内でも使わせていただいております。
tech/dokuwiki.txt · 最終更新: 2018/03/25 16:54 by noel
Copyright (c) 2011-, Secret Society Across, and etc. All Rights Reserved.
Driven by DokuWiki FreeBSD Recent changes RSS feed Valid CSS Valid XHTML 1.0