差異處
這裏顯示兩個版本的差異處。
兩邊的前次修訂版 前次修改 下次修改 | 前次修改 | ||
tech:centos7_dokuwiki [2018/07/23 17:13] – [php 要升級成 5.6] Jonathan Tsai | tech:centos7_dokuwiki [2019/07/09 11:36] (目前版本) – [安裝 Dokuwiki] jonathan_tsai | ||
---|---|---|---|
行 1: | 行 1: | ||
+ | ====== CentOS 7 安裝 Dokuwiki + Nginx ====== | ||
+ | * 安裝環境是在 PVE(Proxmox VE 5.2) 的 CentOS7 CT Template 產生的 Container | ||
+ | * 透過 [[tech/ | ||
+ | |||
+ | ===== 安裝 Nginx + php-fpm ===== | ||
+ | * <code sh> | ||
+ | rpm -ivh http:// | ||
+ | yum install nginx wget | ||
+ | </ | ||
+ | |||
+ | ===== php 要升級成 5.6 ===== | ||
+ | * <code sh> | ||
+ | yum install epel-release | ||
+ | rpm -Uvh http:// | ||
+ | yum remove php-* | ||
+ | </ | ||
+ | * 啟用 [remi-php56] <code h vi / | ||
+ | : | ||
+ | [remi-php56] | ||
+ | : | ||
+ | enabled=1 | ||
+ | : | ||
+ | </ | ||
+ | * 安裝 php 5.6 <code sh> | ||
+ | yum install php php-fpm php-mbstring php-pdo php-gd php-xml php-mcrypt php-mysql | ||
+ | </ | ||
+ | |||
+ | ===== 設定 nginx ===== | ||
+ | * 網站名稱 - wiki.ichiayi.com | ||
+ | * 網頁路徑 - / | ||
+ | * <code h vi / | ||
+ | server { | ||
+ | server_name wiki.ichiayi.com; | ||
+ | listen 80; | ||
+ | autoindex off; | ||
+ | client_max_body_size 15M; | ||
+ | client_body_buffer_size 128k; | ||
+ | index index.html index.htm index.php doku.php; | ||
+ | access_log | ||
+ | error_log | ||
+ | root / | ||
+ | |||
+ | location / { | ||
+ | try_files $uri $uri/ @dokuwiki; | ||
+ | } | ||
+ | |||
+ | location ~ ^/ | ||
+ | expires 30d; | ||
+ | } | ||
+ | |||
+ | location = / | ||
+ | location = / | ||
+ | location ~ /\. { access_log off; log_not_found off; deny all; } | ||
+ | location ~ ~$ { access_log off; log_not_found off; deny all; } | ||
+ | |||
+ | location @dokuwiki { | ||
+ | rewrite ^/ | ||
+ | rewrite ^/ | ||
+ | rewrite ^/ | ||
+ | rewrite ^/(.*) / | ||
+ | } | ||
+ | |||
+ | location ~ \.php$ { | ||
+ | try_files $uri =404; | ||
+ | fastcgi_pass | ||
+ | fastcgi_index | ||
+ | fastcgi_param | ||
+ | include / | ||
+ | fastcgi_param | ||
+ | fastcgi_param | ||
+ | fastcgi_param | ||
+ | fastcgi_param | ||
+ | fastcgi_intercept_errors | ||
+ | fastcgi_ignore_client_abort | ||
+ | fastcgi_connect_timeout 60; | ||
+ | fastcgi_send_timeout 180; | ||
+ | fastcgi_read_timeout 180; | ||
+ | fastcgi_buffer_size 128k; | ||
+ | fastcgi_buffers 4 256k; | ||
+ | fastcgi_busy_buffers_size 256k; | ||
+ | fastcgi_temp_file_write_size 256k; | ||
+ | } | ||
+ | |||
+ | location ~ / | ||
+ | deny all; | ||
+ | } | ||
+ | |||
+ | location ~ /\.ht { | ||
+ | deny all; | ||
+ | } | ||
+ | |||
+ | } | ||
+ | </ | ||
+ | * php-fpm 的設定檔 - / | ||
+ | |||
+ | ===== 安裝 Dokuwiki ===== | ||
+ | * <code sh> | ||
+ | mkdir -p /var/www | ||
+ | cd /var/www | ||
+ | wget https:// | ||
+ | tar -zxvf dokuwiki-stable.tgz | ||
+ | mv dokuwiki-stable.tgz wiki-stable.tgz | ||
+ | mv dokuwiki-*/ | ||
+ | </ | ||
+ | * 建立相關目錄與權限設定 <code sh> | ||
+ | mkdir -p / | ||
+ | chown -R apache: | ||
+ | chown -R apache: | ||
+ | </ | ||
+ | * 更改 / | ||
+ | : | ||
+ | upload_max_filesize = 10M | ||
+ | : | ||
+ | post_max_size = 10M | ||
+ | : | ||
+ | : | ||
+ | [Date] | ||
+ | date.timezone = Asia/Taipei | ||
+ | : | ||
+ | </ | ||
+ | ===== 啟動 nginx + php-fpm ===== | ||
+ | * <code sh> | ||
+ | systemctl enable nginx | ||
+ | systemctl enable php-fpm | ||
+ | systemctl start php-fpm | ||
+ | systemctl start nginx | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | * 如果 dokuwiki 網址不是 / 而是在其他目錄底下 Exp. /wiki or /dokuwiki 需要修改 rewrite 設定 可參考 [[tech/ | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== 參考網址 ===== | ||
+ | * https:// | ||
+ | * http:// | ||
+ | * [[tech/ | ||
+ | * https:// | ||
+ | * https:// | ||
+ | * http:// | ||
+ | |||
+ | {{tag> | ||