\\
\\
\\
=====apache2安装和配置=====
# apache2 apt install ------------------------------
sudo apt-get install apache2
sudo 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
# apache2修改用户为bit010 ------------------------------
sudo usermod -a -G www-data bit010
sudo cp /etc/apache2/envvars /etc/apache2/envvars.bak
sudo ne /etc/apache2/envvars
>>>
export APACHE_RUN_USER=bit010
<<<
# apache2修改主页 ------------------------------
sudo cp /etc/apache2/sites-enabled /etc/apache2/sites-enabled.bak
sudo ne /etc/apache2/sites-enabled
>>>
# DocumentRoot /var/www/html
DocumentRoot /var/www/html/dokuwiki
<<<
=====dokuwiki安装=====
# --------- --------- --------- --------- --------- --------- --------- --------- --------- ---------
wget https://download.dokuwiki.org/out/dokuwiki-24117f7f9e0362c4b1782ff29220b0ab.tgz
tar zxvf dokuwiki*.tgz
cd dokuwiki/
#chmod -R 777 data/
#chmod -R 777 lib/
#chmod -R 777 conf/
# --------- --------- --------- --------- --------- --------- --------- --------- --------- ---------
dokuwiki/install.php
=====dokuwiki中文支持=====
**更新了** \\
管理->配置设置->非 ASCII 文件名的编码方法 = utf-8
(1)conf/local.php
$conf['fnencode'] = 'gbk';
(2)inc/pageutils.php
function utf8_encodeFN($file,$safe=true){
global $conf;
if($conf['fnencode'] == 'utf-8') return $file;
if($safe && preg_match('#^[a-zA-Z0-9/_\-\.%]+$#',$file)){
return $file;
}
//新增以下這段
if($conf['fnencode'] == 'gbk'){
return mb_convert_encoding($file,'gbk','UTF-8');
}
if($conf['fnencode'] == 'GB2312'){
return mb_convert_encoding($file,'GB2312','UTF-8');
}
if($conf['fnencode'] == 'safe'){
return SafeFN::encode($file);
}
$file = urlencode($file);
$file = str_replace('%2F','/',$file);
return $file;
}
function utf8_decodeFN($file){
global $conf;
if($conf['fnencode'] == 'utf-8') return $file;
if($conf['fnencode'] == 'safe'){
return SafeFN::decode($file);
}
//新增以下這段
if($conf['fnencode'] == 'gbk'){
return mb_convert_encoding($file,'UTF-8','gbk');
}
if($conf['fnencode'] == 'GB2312'){
return mb_convert_encoding($file,'UTF-8','GB2312');
}
return urldecode($file);
}
=====dokuwiki增强配置=====
(1)侧边栏
管理->配置设置->sidebar: working:x_others:sidebar
(2)indexmenu
管理->扩展管理器->手动安装: indexmenu-master.zip
管理->配置设置->defer_js: disbale