顯示頁面舊版反向連結Fold/unfold all回到頁頂 本頁是唯讀的,您可以看到原始碼,但不能更動它。您如果覺得它不應被鎖上,請詢問管理員。 ====== CentOS 7 安裝 Dokuwiki + Nginx ====== * 安裝環境是在 PVE(Proxmox VE 5.2) 的 CentOS7 CT Template 產生的 Container * 透過 [[tech/centostimezone]] 以及 [[tech/centoslocale]] ===== 安裝 Nginx + php-fpm ===== * <code sh> rpm -ivh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm yum install nginx wget </code> ===== php 要升級成 5.6 ===== * <code sh> yum install epel-release rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm yum remove php-* </code> * 啟用 [remi-php56] <code h vi /etc/yum.repos.d/remi.repo> : [remi-php56] : enabled=1 : </code> * 安裝 php 5.6 <code sh> yum install php php-fpm php-mbstring php-pdo php-gd php-xml php-mcrypt php-mysql </code> ===== 設定 nginx ===== * 網站名稱 - wiki.ichiayi.com * 網頁路徑 - /var/www/html * <code h vi /etc/nginx/conf.d/default.conf> 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 /var/log/nginx/wiki.ichiayi.com/access.log; error_log /var/log/nginx/wiki.ichiayi.com/error.log; root /var/www/html; location / { try_files $uri $uri/ @dokuwiki; } location ~ ^/lib.*\.(gif|png|ico|jpg)$ { expires 30d; } location = /robots.txt { access_log off; log_not_found off; } location = /favicon.ico { access_log off; log_not_found off; } location ~ /\. { access_log off; log_not_found off; deny all; } location ~ ~$ { access_log off; log_not_found off; deny all; } location @dokuwiki { rewrite ^/_media/(.*) /lib/exe/fetch.php?media=$1 last; rewrite ^/_detail/(.*) /lib/exe/detail.php?media=$1 last; rewrite ^/_export/([^/]+)/(.*) /doku.php?do=export_$1&id=$2 last; rewrite ^/(.*) /doku.php?id=$1 last; } location ~ \.php$ { try_files $uri =404; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include /etc/nginx/fastcgi_params; fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length; fastcgi_intercept_errors on; fastcgi_ignore_client_abort off; 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 ~ /(data|conf|bin|inc)/ { deny all; } location ~ /\.ht { deny all; } } </code> * php-fpm 的設定檔 - /etc/php-fpm.d/www.conf ===== 安裝 Dokuwiki ===== * <code sh> mkdir -p /var/www cd /var/www wget https://download.dokuwiki.org/src/dokuwiki/dokuwiki-stable.tgz tar -zxvf dokuwiki-stable.tgz mv dokuwiki-stable.tgz wiki-stable.tgz mv dokuwiki-*/* html </code> * 建立相關目錄與權限設定 <code sh> mkdir -p /var/log/nginx/wiki.ichiayi.com chown -R apache:apache /var/www/html/data chown -R apache:apache /var/www/html/conf </code> * 更改 /etc/php.ini 設定 <code h vi /etc/php.ini> : upload_max_filesize = 10M : post_max_size = 10M : : [Date] date.timezone = Asia/Taipei : </code> ===== 啟動 nginx + php-fpm ===== * <code sh> systemctl enable nginx systemctl enable php-fpm systemctl start php-fpm systemctl start nginx </code> <note> * 如果 dokuwiki 網址不是 / 而是在其他目錄底下 Exp. /wiki or /dokuwiki 需要修改 rewrite 設定 可參考 [[tech/nginx_rewrite]] </note> ===== 參考網址 ===== * https://www.nginx.com/resources/wiki/start/topics/recipes/dokuwiki/ * http://nginx.org/en/linux_packages.html * [[tech/nginx]] * https://blog.toright.com/posts/3890/%E7%84%A1%E5%A0%85%E4%B8%8D%E6%91%A7%EF%BC%8C%E5%94%AF%E5%BF%AB%E4%B8%8D%E7%A0%B4%EF%BC%81%E5%BF%AB%E6%94%B9%E7%94%A8-nginx-php-fpm-%E5%8F%96%E4%BB%A3-apache-%E5%90%A7%EF%BC%81.html * https://stackoverflow.com/questions/35701730/utf8-endecode-removed-from-php7 * http://blog.qoding.us/2017/09/centos-7-%E5%AE%89%E8%A3%9D%E3%80%81%E5%8D%87%E7%B4%9A-php-5-6/ {{tag>centos7 dokuwiki nginx}} tech/centos7_dokuwiki.txt 上一次變更: 2019/07/09 03:36由 jonathan_tsai