1、安装PHP环境
yum install php php-json php-xml
#设置php开机启动
systemctl enable php-fpm
#启动php
systemctl start php-fpm
2、安装httpd(apache)
yum install httpd
#设置开机启动
systemctl enable httpd
#启动httpd
systemctl start httpd
3、上传解压后的dokuwiki到/usr/share/,目录可以随意, 名字随意,如 cwiki
设置dokuwiki的权限
cd /usr/share/
chown -R apache:apache cwiki
4、配置httpd
访问: https://www.dokuwiki.org/install:apache
复制 /etc/dokuwiki/apache.conf 的文件内容
vim /etc/httpd/conf.d/cwiki.conf
然后把复制的内容贴进去,修改里面dokuwiki的目录为当前cwiki的目录,且把dokuwiki修改为cwiki
AliasMatch ^/cwiki/sites/[^/]+$ /usr/share/cwiki/
AliasMatch ^/cwiki/sites/[^/]+/(.*)$ /usr/share/cwiki/$1
Alias /cwiki /usr/share/cwiki/
<Directory /usr/share/cwiki/>
Options +FollowSymLinks
require all granted
##VER APACHE2.4
#Allow from localhost 127.0.0.1 ::1
<IfModule mod_rewrite.c>
# Uncomment to implement server-side URL rewriting
# (cf. <http://www.dokuwiki.org/config:userewrite>).
# Do *not* mix that with multisite!
#RewriteEngine on
#RewriteBase /dokuwiki
#RewriteRule ^lib - [L]
#RewriteRule ^doku.php - [L]
#RewriteRule ^feed.php - [L]
#RewriteRule ^install.php - [L]
#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]
#RewriteRule (.*) doku.php?id=$1 [QSA,L]
</IfModule>
</Directory>
<Directory /usr/share/cwiki/bin>
Require all denied
##FOR VER APACHE2.4
</Directory>
<Directory /usr/share/cwiki/data>
Require all denied
##FOR VER APACHE2.4
</Directory>
5、重启httpd, systemctl restart httpd
打开访问: http://ip/cwiki/
第一次 http://ip/cwiki/install.php
填完之后删掉 install.php
centos8 安装dokuwiki(apache环境)
最新推荐文章于 2024-08-03 15:32:20 发布