差分
このページの2つのバージョン間の差分を表示します。
| 両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン | ||
| dokuwiki [2018/11/16 18:48] – [インストール方法] mumeiyamibito | dokuwiki [2018/11/16 18:59] (現在) – [サーバのインストール (nginx 編)] mumeiyamibito | ||
|---|---|---|---|
| 行 1: | 行 1: | ||
| ====== DokuWiki ====== | ====== DokuWiki ====== | ||
| ===== インストール方法 ===== | ===== インストール方法 ===== | ||
| - | - サーバ環境の確認 | + | ==== サーバのインストール |
| - | * apache や lighttpd、nginx、Abyss などの web サーバ環境 | + | |
| - | * php 5.3.3 以上 | + | |
| - | - [[http:// | + | |
| - | * Version: Stable | + | |
| - | * Languages: en, ja (Toggle all ボタンを押して全て無効化してから作業すると楽) | + | |
| - | * 下の「Start Download」ボタンでダウンロード開始 | + | |
| - | - 得られたファイルをウェブ表示可能なディレクトリに展開 | + | |
| - | - パーミッションの変更\\ 以下のいずれかを行う | + | |
| - | * 誰でもアクセス可にする\\ <code bash> | + | |
| - | $ chmod -R 777 data | + | |
| - | $ chmod 777 conf | + | |
| - | $ chmod 666 conf/* | + | |
| - | </ | + | |
| - | * Web のみからアクセスする\\ <code bash> | + | |
| - | $ chown -R 777 data | + | |
| - | $ chown -R www-data. conf | + | |
| - | </ | + | |
| - | - ウェブ上から install.php にアクセス (パーミッションが不足しているとここで注意される) | + | |
| - | - 必要事項を入力して、Wiki ライフをスタート | + | |
| - | + | ||
| - | ==== nginx サーバでのインストール ==== | + | |
| - nginx をインストールする。\\ <code bash> | - nginx をインストールする。\\ <code bash> | ||
| $ sudo add-apt-repository ppa: | $ sudo add-apt-repository ppa: | ||
| $ sudo apt update | $ sudo apt update | ||
| - | $ sudo apt install nginx</ | + | $ sudo apt install nginx php-fpm</ |
| * [[https:// | * [[https:// | ||
| - 自動起動設定する。\\ <code bash>$ sudo systemctl enable nginx</ | - 自動起動設定する。\\ <code bash>$ sudo systemctl enable nginx</ | ||
| 行 34: | 行 13: | ||
| * 【変更】ルートディレクトリを必要に応じて変更する。\\ < | * 【変更】ルートディレクトリを必要に応じて変更する。\\ < | ||
| * 【変更】エラーページを dokuwiki のエラーページに変更する\\ < | * 【変更】エラーページを dokuwiki のエラーページに変更する\\ < | ||
| - | | + | location / { |
| - | # First attempt to serve request as file, then | + | # First attempt to serve request as file, then |
| - | # as directory, then fall back to displaying a 404. | + | # as directory, then fall back to displaying a 404. |
| - | try_files $uri $uri/ @dokuwiki; | + | try_files $uri $uri/ @dokuwiki; |
| - | }</ | + | }</ |
| * 【追記】URL 書き換えなどの設定を追記する。\\ < | * 【追記】URL 書き換えなどの設定を追記する。\\ < | ||
| - | | + | #Remember to comment the below out when you're installing, and uncomment it when done. |
| - | location ~ / | + | location ~ / |
| - | | + | location ~ ^/ |
| - | expires 365d; | + | expires 365d; |
| - | } | + | } |
| - | | + | location @dokuwiki { |
| - | # rewrites " | + | # rewrites " |
| - | rewrite ^/ | + | rewrite ^/ |
| - | rewrite ^/ | + | rewrite ^/ |
| - | rewrite ^/ | + | rewrite ^/ |
| - | rewrite ^/(.*) / | + | rewrite ^/(.*) / |
| - | } | + | } |
| - | location ~ \.php$ { | + | location ~ \.php$ { |
| - | try_files $uri $uri/ / | + | try_files $uri $uri/ / |
| - | include fastcgi_params; | + | include fastcgi_params; |
| - | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | + | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; |
| - | fastcgi_param REDIRECT_STATUS 200; | + | fastcgi_param REDIRECT_STATUS 200; |
| - | fastcgi_pass unix:/ | + | fastcgi_pass unix:/ |
| - | # fastcgi_pass unix:/ | + | # fastcgi_pass unix:/ |
| - | }</ | + | }</ |
| - | - 以下の内容の dokuwiki のトップディレクトリにて .htaccess を新規作成する。\\ <code bash>$ sudoedit .htaccess</ | + | * [[https:// |
| + | - 以下の内容の dokuwiki のトップディレクトリにて .htaccess を新規作成する | ||
| <Files ~ " | <Files ~ " | ||
| Order allow,deny | Order allow,deny | ||
| 行 83: | 行 63: | ||
| </ | </ | ||
| * [[https:// | * [[https:// | ||
| - | - a | + | - nginx の再起動をする。\\ <code bash>$ sudo systemctl restart nginx</ |
| + | - 場合によっては php7.0 の再起動も必要かもしれない。\\ < | ||
| * その他トラブルシューティング | * その他トラブルシューティング | ||
| * ブラウザでアクセスすると php ファイルがダウンロードされる。 | * ブラウザでアクセスすると php ファイルがダウンロードされる。 | ||
| 行 93: | 行 74: | ||
| * [[https:// | * [[https:// | ||
| * [[https:// | * [[https:// | ||
| + | |||
| + | ==== dokuwiki 本体のインストール ==== | ||
| + | - サーバ環境の確認 | ||
| + | * apache や lighttpd、nginx、Abyss などの web サーバ環境 | ||
| + | * php 5.3.3 以上 | ||
| + | - [[http:// | ||
| + | * Version: Stable | ||
| + | * Languages: en, ja (Toggle all ボタンを押して全て無効化してから作業すると楽) | ||
| + | * 下の「Start Download」ボタンでダウンロード開始 | ||
| + | - 得られたファイルをウェブ表示可能なディレクトリに展開 | ||
| + | - パーミッションの変更\\ 以下のいずれかを行う | ||
| + | * 誰でもアクセス可にする\\ <code bash> | ||
| + | $ chmod -R 777 data | ||
| + | $ chmod 777 conf | ||
| + | $ chmod 666 conf/* | ||
| + | </ | ||
| + | * Web のみからアクセスする\\ <code bash> | ||
| + | $ chown -R 777 data | ||
| + | $ chown -R www-data. conf | ||
| + | </ | ||
| + | - ウェブ上から install.php にアクセス (パーミッションが不足しているとここで注意される) | ||
| + | - 必要事項を入力して、Wiki ライフをスタート | ||
| + | |||
| + | |||
| ===== 既存データの移行 ===== | ===== 既存データの移行 ===== | ||
| インストール方法のパーミッションの変更を行う。 | インストール方法のパーミッションの変更を行う。 | ||