环境:Linux AS4、Apache2.2、PHP 4.4.7、DokuWiki-2007-05-24
Apache的安装见前文
PHP
- 下载php-4.4.7.tar.gz,解压
- ./configure --with-apxs2=$APACHE_HOME/bin/apxs
- make & make install
- cp php.ini-dist &PHP_HOME/etc/php.ini
DokuWiki
- 下载dokuwiki-2006-11-06.tgz,解压
- 为apache添加rewrite模块:
cd $APACHE_HOME/modules/mappers
$APACHE_HOME/bin/apxs -i -a -c mod_rewrite.c
- 检查httpd.conf中是否已经加入:LoadModule rewrite_module libexec/mod_rewrite.so
- 配置apache的httpd.conf
Alias /wiki "/local/xsun/servers/dokuwiki"
<Directory "$DokuWiki_HOME">
Allow from all
AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps
RewriteEngine on
RewriteBase /wiki
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]
RewriteRule ^index.php$ doku.php
php_value auto_prepend_file "$DokuWiki_HOME/prepend.php"
</Directory>
- $APACHE_HOME/bin/apachectl start
DokuWiki 安全配置
在$DokuWiki_HOME目录下创建prepend.php,和apache的配置文件对应,在执行会预先加载
<?php
define('DOKU_CONF','$DokuWiki_HOME/conf/');
define('DOKU_INC','$DokuWiki_HOME');
?>
然后将$DokuWiki_HOME目录下的文件夹都移出,例如$Wiki_HOME
ln -s $DokuWiki_HOME/lib $Wiki_HOME/lib
在$DokuWiki_HOME/conf/local.php文件中添加:$conf['savedir'] = '$Wiki_HOME/data';
在浏览器中打开install.php,配置完后将这个文件删除
下面是我配置过的文件:
local.php:
$conf['title'] = 'My Wiki';
$conf['useacl'] = 1;
$conf['superuser'] = '@admin';
$conf['userewrite'] = '1';
$conf['useslash'] = 1;
$conf['sepchar'] = '-';
$conf['openregister'] = '0';
$conf['savedir'] = '/local/xsun/wiki/data';
@include(DOKU_CONF.'local.protected.php');
users.auth.php:
test:61e7250f72098cf2602541ffbaf66e59:LALALA:pepsixp@gmail.com:admin,user
acl.auth.php:
* @ALL 1
* @user 8
posted on 2007-06-14 22:13
阿姆斯壮 阅读(1968)
评论(0) 编辑 收藏 所属分类:
Linux