{{tag>dokuwiki インストール}} ====== 【Dokuwiki】インストールと初期設定 ====== Dokuwiki のインストールと初期設定に関する覚書です。 バージョンは 2023-04-04a “Jack Jackrum” です。 ===== インストール ===== 1. [[doku>dokuwiki|DokuWIki Webサイト]] にいき DokuWiki をダウンロードする。 {{gallery>:dokuwiki:48867e4d21a528f3d702caa2a1c9af29.png?lightbox}} 2. いくつかダウンロードオプションを問われるので適切なものを選択し、Download ボタンを押す。 {{gallery>:dokuwiki:07f762f49c1f85166ed8cfaa9a2b81cd.png?lightbox}} ^項目^説明| |Version|ダウンロードするバージョンの選択。通常利用なので Stable を選択。| |Update|前回の Stable 版からの差分ファイルのみ取得するか。新規インストールなので off を選択。| |Include Web-Server|MicroApache を含めるか。Webサーバーはレンタルサーバーにインストールされているものを使うので off。| |Languages|使用言語パックの選択。「ja - 日本語」を選択。en、ja 以外は不要なのでOFF。| |Popular Plugins|ダウンロードに含めるプラグイン。「Upgarade Plugin」「Wrap Plugin」だけチェックした。| 3. DokuWiki のダウンロードが完了したら、ダウンロードしたファイルを解凍し、Webサーバーの公開フォルダーにアップロードする。\\ 公開フォルダー直下にアップロードするか、間にサブフォルダーを設けるかどうかは都合にあわせて。 4. ブラウザで「install.php」にアクセスする。\\ (公開フォルダー直下へアップロードしたのであれば URL は %%http://ドメイン名/install.php%%) 5. 使用言語を ja(日本語)に変更する {{gallery>:dokuwiki:861818936ec83178c91d447e9373a095.png?lightbox}} 6. 各項目を入力し「保存」ボタンを押す。 {{gallery>:dokuwiki:d45be962b8fe5bc5d3ff14441dd9d359.png?lightbox}} 7. インストール完了。「install.php」を削除する。 {{gallery>:dokuwiki:dd28c349336023b81b7acead5f5c6004.png?lightbox}} ===== 初期設定 ===== 1. 「管理者メニュー」→「サイト設定」で下記の設定項目を変更した。 ^ 設定項目 ^ 説明 ^ | 表示:youarehere | 現在位置を表示。「on」に変更。 | | 表示:useheading | 最初の見出しをページ名とする。「常に使用する」に変更。 | | スパム対策:relnofollow | 外部リンクにrel="ugc nofollow"を付加しないよう「off」に変更。 | | スパム対策:indexdelay | インデックスを許可を「0」秒後に変更。 | | リンク:interwiki | 「_blank」に変更。 | | リンク:extern | 「_blank」に変更。 | | リンク:media | 「_blank」に変更。 | | リンク:windows | 「_blank」に変更。 | | RSS:sitemap | Googleサイトマップ作成頻度を「1」日に変更。 | | RSS:rss_type | XMLフィード形式を「Atom 1.0」に変更。 | | RSS:rss_linkto | XMLフィード内リンク先を「現在のページ」に変更。 | | RSS:rss_media | XMLフィードで、どんな種類の変更を記載するかを「ページ」に変更。 | | RSS:rss_show_summary | XMLフィードのタイトルに概要を表示を「off」に変更。 | | RSS:rss_show_deleted | 削除されたフィードを含めるを「off」に変更。 | | 高度な設定:userewrite | URLの書き換えを「.htaccess」で行うように変更。 | | 高度な設定:useslash | URL上の名前空間の区切りにスラッシュを使用を「on」。 | | ネットワーク:jquerycdn | 「CDN: code.jquery.com を使用」を指定。 | 2. DokuWiki のフォルダーに「.htaccess」をつくり、下記の内容を追記する。 * フォルダー、ファイルへのアクセス制御を設定 * URL書き換えルールの設定 * HTTPアクセスをHTTPSにリダイレクトする設定 ## You should disable Indexes and MultiViews either here or in the ## global config. Symlinks maybe needed for URL rewriting. #Options -Indexes -MultiViews +FollowSymLinks Options -Indexes -MultiViews ## make sure nobody gets the htaccess, README, COPYING or VERSION files Require all denied Order allow,deny Deny from all ## Don't allow access to git directories RedirectMatch 404 /\.git ## Uncomment these rules if you want to have nice URLs using ## $conf['userewrite'] = 1 - not needed for rewrite mode 2 RewriteEngine on 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 ## 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 /dokuwiki # ## 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] RewriteCond %{HTTPS} !=on RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]