dokuwiki使用:ubuntu安装dokuwiki

Ubuntu 16.04 dokuwiki安装

  1. )Ubuntu 16.04.3 LTS
  2. )Apache/2.4.18 (Ubuntu)
  3. )dokuwiki 2017-02-19e “Frusterick Manners”

一.软件安装

sudo apt-get install apache2
apt-get install php7.0-fpm php7.0-cli php-apcu php7.0-gd php7.0-xml php7.0-curl php7.0-json php7.0-mcrypt php7.0-cgi php7.0 libapache2-mod-php7.0
  • 重启Apache,以便Apache注册PHP模块 /etc/init.d/apache2 restart 或者 service apache2 restart
  • 使用vi编辑器在/var/www/html目录下新建一个php脚本test.php
  <?php
  phpinfo();
  ?>
  • 打开浏览器,输入:localhost/test.php,如果显示了php的版本信息等,那么就说明成功支持PHP

下载最新(稳定)的 dokuWiki:

wget http://download.dokuwiki.org/src/dokuwiki/dokuwiki-stable.tgz

解压并修改文件夹属主和权限:

tar -xzf dokuwiki-stable.tgz -C /var/www/
chown www-data:www-data -R /var/www/dokuwiki
chmod -R 700 /var/www/dokuwiki

在浏览器中输入localhost/dokuwiki/install.php安装

二.软件配置

 vi /etc/apache2/sites-available/000-default.conf

将DocumentRoot改为dokuwiki解压目录:

DocumentRoot /var/www/dokuwiki

在000-default.conf文件中追加以下内容:

<Directory /var/www/dokuwiki>
            order deny,allow
            allow from all
</Directory>

<LocationMatch "/(data|conf|bin|inc)/">
            order allow,deny
            deny from all
            satisfy all
</LocationMatch>

a)在dokuwiki/conf/dokuwiki.php中设置1)

$conf[‘userewrite’] = 1;

b)Apache服务器开启Rewrite功能:

1)vi /etc/apache2/sites-enabled/000-default将其中的:AllowOverride None 修改为:AllowOverride All
2)在000-default中追加:
   <Directory /path/to/dokuwiki>
      AllowOverride AuthConfig FileInfo Limit
   </Directory>
3)ln -s /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/rewrite.load

c)使用dokuwiki默认.htaccess.dist文件:2)

RewriteEngine on
#RewriteBase /dokuwiki
RewriteRule ^_media/(.*) lib/exe/fetch.php?media=$1 [QSA,L]
RewriteRule ^_detail/(.*) lib/exe/detail.php?media=$1 [QSA,L]
RewriteRule ^_export/([^/]+)/(.*) doku.php?do=export_$1&id=$2 [QSA,L]
RewriteRule ^$ doku.php [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) doku.php?id=$1 [QSA,L]

1)
htaccess服务器处理
2)
RewriteBase /dokuwiki根据实际情况修改