「DokuWiki」の版間の差分

提供: ArchWiki
ナビゲーションに移動 検索に移動
20行目: 20行目:
 
== インストール ==
 
== インストール ==
 
# Webサーバー (例えば、[[Apache]]、 [[nginx]] または [[lighttpd]]) を選んでインストールして、[[PHP]] を設定します。前述したように、DokuWikiは、データベース・サーバーを必要としないので、Webサーバを設定するときにこれらのステップをスキップできるかもしれません。
 
# Webサーバー (例えば、[[Apache]]、 [[nginx]] または [[lighttpd]]) を選んでインストールして、[[PHP]] を設定します。前述したように、DokuWikiは、データベース・サーバーを必要としないので、Webサーバを設定するときにこれらのステップをスキップできるかもしれません。
# [コミュニティ] から{{Pkg|dokuwiki}} を [[pacman]] を使用してインストールします。
+
# [community] {{Pkg|dokuwiki}} を [[pacman]] を使用してインストールします。
 
# Webサーバを設定します(以下のセクションを参照)。
 
# Webサーバを設定します(以下のセクションを参照)。
 
# お好みのWebブラウザで、<nowiki>http://&lt;your-server&gt;/dokuwiki/install.php</nowiki> を開いて、そこからインストールを続行してください。
 
# お好みのWebブラウザで、<nowiki>http://&lt;your-server&gt;/dokuwiki/install.php</nowiki> を開いて、そこからインストールを続行してください。

2015年12月4日 (金) 14:39時点における版

「DokuWiki はユーザーがリッチなドキュメントリポジトリを作成することを可能にする標準規格に準拠した、使いやすいウィキです。これは、作成する個人、チームや企業のための環境を提供し、構造化されたデータファイルによりウィキ外でも可読性のあるシンプルで強力な構文を使用して共同作業を可能とします」

「無制限のページのリビジョンは、以前のページのバージョンに復元を可能にし、プレーンテキストファイルに格納されたデータは、データベースを必要としません。強力なプラグインアーキテクチャは、コアシステムの拡張・強化することができます。DokuWiki が提供する完全な説明については、機能のセクションを参照してください」"[1]

言い換えると、DokuWikiはPHPで書かれたウィキであり、何のデータベースを必要としません。

実行例を見てみたいですか?

初期の注意事項

DokuWikiは、PHP5.1.2以降をサポートする任意のWebサーバー上で動作するはずです。要件は時間とともに変化するため、追加の詳細については、DokuWikiのrequirements pageを参照してください。

あなたのWebサーバのために、DokuWiki's security pageの適切なセクションを読むことを強くお勧めします。最も人気のあるWebサーバがカバーされていますが、一般的な指示もそこに記述してあります。

The package in [community] unpacks DokuWiki at /usr/share/webapps/dokuwiki with the configuration files in /etc/webapps/dokuwiki and the data files in /var/lib/dokuwiki/data. It also changes the ownership of the relevant files to the "http" user. This should work fine for most popular web servers as packaged for Arch.

インストール

  1. Webサーバー (例えば、Apachenginx または lighttpd) を選んでインストールして、PHP を設定します。前述したように、DokuWikiは、データベース・サーバーを必要としないので、Webサーバを設定するときにこれらのステップをスキップできるかもしれません。
  2. [community] の dokuwikipacman を使用してインストールします。
  3. Webサーバを設定します(以下のセクションを参照)。
  4. お好みのWebブラウザで、http://<your-server>/dokuwiki/install.php を開いて、そこからインストールを続行してください。

別の方法として、tarballからインストールしたい場合は、http://www.dokuwiki.org/Install を読んでください。一般的手順は上記と同様です。pacman を使用する代わりに、tarballをダウンロード し、サーバーのドキュメントルート(例えば、/srv/http/dokuwiki)にそれを解凍し、適切なユーザーに、chown してください。(例えば、 "HTTP")。

設定

If you are using lighttpd or nginx you need to adjust the open_basedir in /etc/php/php.ini to include the dokuwiki directories (php forbids following symbolic links outside of the allowed scope):

/etc/php/php.ini
open_basedir = /srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/:/etc/webapps/dokuwiki/:/var/lib/dokuwiki/

Also uncomment the following line.

/etc/php/php.ini
extension=gd.so

Dokuwiki needs this library for resizing images.

Apache

The package should add the file /etc/httpd/conf/extra/dokuwiki.conf with the following contents:

Alias /dokuwiki /usr/share/webapps/dokuwiki
<Directory /usr/share/webapps/dokuwiki/>
    Options +FollowSymLinks
    AllowOverride All
    order allow,deny
    allow from all
    php_admin_value open_basedir "/tmp/:/usr/share/pear/:/usr/share/webapps/:/etc/webapps/dokuwiki/:/var/lib/dokuwiki/"
</Directory>

If you are running Apache 2.4 or newer, you will have to change the following lines:

    order allow,deny
    allow from all

to read:

    Require all granted

Include the newly created file in the Apache configuration by placing the following line at the end of /etc/httpd/conf/httpd.conf:

Include conf/extra/dokuwiki.conf

Make sure the folders /etc/webapps/dokuwiki and /var/lib/dokuwiki are owned by user and group "http". You may relocate these directories if you like as long as you update the references in /etc/httpd/conf/extra/dokuwiki.conf respectively.

Afterwards restart Apache:

 # systemctl restart httpd.service

Then finish the installation by running the dokuwiki/install.php script in your browser.

lighttpd の設定

Edit the /etc/lighttpd/lighttpd.conf file as per the dokuwiki instructions (might contain updated information).

Make sure the modules mod_access and mod_alias are loaded. If not, load them by adding the following to /etc/lighttpd/lighttpd.conf:

server.modules += ("mod_access")
server.modules += ("mod_alias")

mod_access provides the url.access-deny command, which we are using from this point.

Under the line:

$HTTP["url"] =~ "\.pdf$" {
  server.range-requests = "disable"
}

add this:

# subdir of dokuwiki
# comprised of the subdir of the root dir where dokuwiki is installed
# in this case the root dir is the basedir plus /htdocs/
# Note: be careful with trailing slashes when uniting strings.
# all content on this example server is served from htdocs/ up.
#var.dokudir = var.basedir + "/dokuwiki"
var.dokudir = server.document-root + "/dokuwiki"

# make sure those are always served through fastcgi and never as static files
# deny access completly to these
$HTTP["url"] =~ "/(\.|_)ht" { url.access-deny = ( "" ) }
$HTTP["url"] =~ "^" + var.dokudir + "/(bin|data|inc|conf)/"  { url.access-deny = ( "" ) }

These entries give some basic security to DokuWiki. lighttpd does not use .htaccess files like Apache. You CAN install with out this, but I would NEVER recommend it.


Add alias somewhere in lighttpd or fastcgi conf file:

alias.url += ("/dokuwiki" => "/usr/share/webapps/dokuwiki/")

Restart lighttpd:

 # systemctl restart lighttpd

nginx

Add the following location blocks to your /etc/nginx/nginx.conf.

#Assuming that the root is set to /usr/share/webapps.
#You may need to adjust your location blocks accordingly.
location ~^/dokuwiki/(data|conf|bin|inc)/ { deny all; } # secure DokuWiki
location ~^/dokuwiki/\.ht { deny all; } # also secure the Apache .htaccess files
location ~^/dokuwiki/lib/^((?!php).)*$ { expires 30d; } # no need to serve non .php files through fastcgi, so we catch those requests here.
location ~^/dokuwiki/.*\.php$ {
            include fastcgi.conf;
            fastcgi_pass unix:/run/php-fpm/php-fpm.sock;
        }

Restart nginx

 # systemctl restart nginx

インストール後の作業

不要なファイルの削除

After configuring the server remove the install.php file!

 # rm /srv/http/dokuwiki/install.php

プラグインのインストール

Many community created plugins can be found here

They can be added through the web interface (as well as updated) through the Admin menu. Some plugins cannot be downloaded, if they go over ssl (e.g. git). Uncomment following line in /etc/php/php.ini:

extension=openssl.so

バックアップ

It is very trivial to backup DokuWiki, since there is no database. All pages are in plain text, and require only a simple tar, or rsync.

A quick breakdown of the directories of interest in the current (2008-05-05) version:

 /dokuwiki/data/  =>  All User Created Data
 /dokuwiki/lib/plugins/  =>  All User Added Plugins

参考文献

The DokuWiki main site has all of the information and help that you could possibly need.