wangbin
  • wangbin
  • 2019-01-07
  • IT

dokuwiki:搭建wiki知识库

一. 简介

最近越来越发现wiki知识库的重要性,可以记录团队或个人知识的积累,方便团队内部分享,然后进步成长.

这里记录下dokuwiki的搭建过程.

二.官方教程

https://www.dokuwiki.org/zh:install

先奉上官方教程

三.安装

https://download.dokuwiki.org/

到这个网站下载最新版本的Stable程序包

  1. Version

    选择:Stable (Recommended)

  2. Languages

    选择:en和中文

  3. Popular Plugins

    全选

点击开始下载,然后将下载的压缩包上传到vps,然后执行

cd ~
tar zxvf dokuwiki*
mv dokuwiki /vps/hosts/
chown -R nobody:nobody /vps/hosts/dokuwiki

四. nginx配置

wiki.siyou325.com.conf

# wiki.siyou325.com
server {

    listen       81;
    listen       [::]:81;
    listen       50443 ssl http2;
    listen       [::]:50443 ssl http2;

    server_name  wiki.siyou325.com;

    # ssl
    ssl_certificate             /vps/save/certificate/acme/*.siyou325.com/fullchain.cer;
    ssl_certificate_key         /vps/save/certificate/acme/*.siyou325.com/*.siyou325.com.key;
    ssl_trusted_certificate     /vps/save/certificate/acme/*.siyou325.com/fullchain.cer;

    # ecc
    ssl_certificate             /vps/save/certificate/acme/*.siyou325.com_ecc/fullchain.cer;
    ssl_certificate_key         /vps/save/certificate/acme/*.siyou325.com_ecc/*.siyou325.com.key;

    # log
    access_log                  logs/siyou325.com/common.siyou325.com/access-common.siyou325.com.log siyou325;
    error_log                   logs/siyou325.com/common.siyou325.com/error.log;

    client_max_body_size        50m;

    root                        /vps/hosts/dokuwiki;
    index                       index.html index.htm index.php doku.php;

    location / {
        # First attempt to serve request as file, then
        # as directory, then fall back to displaying a 404.
        try_files $uri $uri/ =404;
        # Uncomment to enable naxsi on this location
        # include /etc/nginx/naxsi.rules
    }

    location ~ \.php$ {
        fastcgi_connect_timeout         300;
        fastcgi_send_timeout            300;
        fastcgi_read_timeout            300;
        fastcgi_pass                    127.0.0.1:9000;
        fastcgi_index                   index.php;
        fastcgi_param                   SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include                         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;
    }

    location ~ /(data|conf|bin|inc)/ {
        deny all;
    }

    location ~ /\.ht {
        deny  all;
    }

    # 禁止访问.svn目录,防止svn信息泄漏,必加项
    location ~ ^(.*)\/\.svn\/ {
        deny all;
    }

}

五. php7安装

参照我上篇博客centos7安装php7.

六. dokuwiki配置

第一次访问wiki.siyou325.com,需要到https://wiki.siyou325.com/install.php进行安装操作.

  1. Wiki Name: siyou325's wiki
  2. Enable ACL (recommended): 打勾
  3. Superuser: admin
  4. E-Mail: xxx@xxx
  5. Password: xxx
  6. once again: xxx
  7. Initial ACL policy: 选择Closed Wiki
  8. Allow users to register themselves: 不勾选

保存.

删除install.php,防止别人再次设置.

rm -f /vps/hosts/dokuwiki/install.php

七. 结尾

好了,dokuwiki安装好了,后面我们介绍些其他的配置.

参考:

  1. https://www.dokuwiki.org/zh:install