このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン前のリビジョン次のリビジョン | 前のリビジョン | ||
50_dialy:2021:04:29 [2021/05/19 05:08] – matsui | 50_dialy:2021:04:29 [2023/05/17 01:26] (現在) – matsui | ||
---|---|---|---|
行 1: | 行 1: | ||
- | ====== 2021.04.29 Docker dokuwiki ====== | + | ====== 2021.04.29 Docker dokuwiki |
+ | |||
+ | ※[[50_dialy: | ||
+ | |||
+ | こちらのlinuxserverのdokuwikiはnginxで動きます。 | ||
+ | |||
+ | SSL付きのDokuwiki | ||
[[https:// | [[https:// | ||
+ | |||
+ | ===== docker-compose.yml ===== | ||
< | < | ||
行 31: | 行 39: | ||
volumes: | volumes: | ||
- ./ | - ./ | ||
+ | # - / | ||
#ports: | #ports: | ||
# - 80:80 | # - 80:80 | ||
行 36: | 行 45: | ||
restart: unless-stopped | restart: unless-stopped | ||
</ | </ | ||
+ | |||
+ | |||
+ | ===== 起動 ===== | ||
+ | < | ||
+ | # docker-compose up -d | ||
+ | </ | ||
+ | |||
+ | このあと下記へアクセス | ||
+ | |||
+ | https:// | ||
+ | |||
+ | |||
+ | ===== tmpfs ===== | ||
+ | |||
+ | tmpfsにfastcgi_cacheを置く場合、tmpfsの設定を入れる | ||
+ | |||
+ | < | ||
+ | tmpfs / | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | mkdir /tmpfs | ||
+ | mount /tmpfs | ||
+ | </ | ||
+ | |||
+ | ===== X-Forwared-For ===== | ||
+ | |||
+ | https-portalからforwardされてくるので、X-Forwared-Forからアクセス元IPを取得し、real_ipとしてセットする。 | ||
+ | |||
+ | < | ||
+ | set_real_ip_from | ||
+ | real_ip_header | ||
+ | </ | ||
+ | |||
+ | このX-Forwared-Forを入れないと、dockerの場合[[dokuwiki: | ||
+ | |||
+ | ===== FastCGI cache ===== | ||
+ | |||
+ | http{}の中にfastcgi_cache_pathとfastcgi_cache_keyの記述を追加 | ||
+ | < | ||
+ | http { | ||
+ | fastcgi_cache_path / | ||
+ | fastcgi_cache_key " | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | location ~ \.php$ { | ||
+ | fastcgi_split_path_info ^(.+\.php)(/ | ||
+ | # With php5-cgi alone: | ||
+ | fastcgi_pass 127.0.0.1: | ||
+ | # With php5-fpm: | ||
+ | # | ||
+ | fastcgi_index index.php; | ||
+ | include / | ||
+ | |||
+ | set $do_not_cache 0; | ||
+ | |||
+ | # -- POST or HEAD ? | ||
+ | if ($request_method != " | ||
+ | set $do_not_cache 1; | ||
+ | } | ||
+ | |||
+ | fastcgi_cache cache-zone; | ||
+ | fastcgi_cache_valid 200 60m; | ||
+ | add_header X-F-Cache $upstream_cache_status; | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== アクセス制限 ===== | ||
+ | |||
+ | [[# | ||
+ | |||
+ | < | ||
+ | location / { try_files $uri $uri/ @dokuwiki; | ||
+ | allow xxx.xxxx.xxx.xxx; | ||
+ | deny all; | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | ===== Error ===== | ||
+ | |||
+ | < | ||
+ | # docker-compose up -d | ||
+ | Starting dokuwiki ... error | ||
+ | |||
+ | ERROR: for dokuwiki | ||
+ | |||
+ | |||
+ | ERROR: for dokuwiki | ||
+ | |||
+ | ERROR: Encountered errors while bringing up the project. | ||
+ | </ | ||
+ | |||
+ | ==== 対応 ==== | ||
+ | |||
+ | 古いバージョンのsystemdにはTaskAccounting が無い | ||
+ | これは新しいsystemdにupdateすれば治る | ||
+ | |||
+ | < | ||
+ | # yum update systemd | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== 既存環境からのコピー ===== | ||
+ | |||
+ | data、conf、tplのコピー | ||
+ | < | ||
+ | rsync hoge@hogehoge.com:/ | ||
+ | rsync hoge@hogehoge.com:/ | ||
+ | rsync hoge@hogehoge.com:/ | ||
+ | </ | ||
+ | |||
+ | 後は、既存環境と同じ拡張機能をインストール | ||
+ | |||
{{tag> | {{tag> |