安装
安装php和nginx yum install -y php70w php70w-gd php70w-xml php70w-fpm nginx
开机自启动 systemctl enable nginx php-fpm
配置nginx
server {
listen 80;
server_name localhost;
# Maximum file upload size is 4MB - change accordingly if needed
client_max_body_size 4M;
client_body_buffer_size 128k;
root /dokuwiki;
index doku.php;
#Remember to comment the below out when you're installing, and uncomment it when done.
location ~ /(conf/|bin/|inc/|install.php) { deny all; }
#Support for X-Accel-Redirect
location ~ ^/data/ { internal ; }
location ~ ^/lib.*\.(js|css|gif|png|ico|jpg|jpeg)$ {
expires 365d;
}
location / { try_files $uri $uri/ @dokuwiki; }
location @dokuwiki {
# rewrites "doku.php/" out of the URLs if you set the userwrite setting to .htaccess in dokuwiki config page
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&$args last;
}
location ~ \.php$ {
try_files $uri $uri/ /doku.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param REDIRECT_STATUS 200;
fastcgi_pass 127.0.0.1:9000;
}
}
启动nginx和php-fpm systemctl start php-fpm nginx
在网站一栏输入:http://你的ip地址/install.php 在右上角选好语言,简体中文zh,按照提示安装即可。如果打开页面保存,请修改conf、data、lib目前的权限。
安装插件
新增页面Add New Page插件
Markdown插件Markdown Page Plugin
侧边栏
安装Indexmenu Plugin插件
新建data\pages\sidebar.txt,内容如下:
===== 导航目录 =====
{{indexmenu>..|navbar}}
===== 添加新页面 =====
{{NEWPAGE}}
中文文件名乱码
修改dokuwiki/conf/local.php在最后一行加上:
$conf['fnencode']='utf-8';