首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 服务器 > Apache >

apache=>DokuWiki 装配

2012-09-22 
apacheDokuWiki 安装checking for APR... noconfigure: error: APR not found.解决办法:1.下载所需软件

apache=>DokuWiki 安装


checking for APR... no

configure: error: APR not found.


解决办法:

1.下载所需软件包:


[code="java"]wget http://archive.apache.org/dist/apr/apr-1.4.5.tar.gz ?

wget http://archive.apache.org/dist/apr/apr-util-1.3.12.tar.gz ?

wget http://jaist.dl.sourceforge.net/project/pcre/pcre/8.10/pcre-8.10.zip ??


2.编译安装:

yum remove apr-util-devel apr apr-util-mysql apr-docs apr-devel apr-util apr-util-docs?

具体步骤如下:


? a:解决apr not found问题

$ test]# tar -zxf apr-1.4.5.tar.gz ?

$ test]# cd ?apr-1.4.5 ?

$ apr-1.4.5]# ./configure --prefix=/usr/local/apr ?

$ apr-1.4.5]# make && make install ??


? b:解决APR-util not found问题

$ test]# tar -zxf apr-util-1.3.12.tar.gz ?

$ test]# cd apr-util-1.3.12 ?

$ apr-util-1.3.12]# ./configure --prefix=/usr/local/apr-util -with- apr=/usr/local/apr/bin/apr-1-config ?

$ apr-util-1.3.12]# make && make install?


? c:解决pcre问题

$ test]#unzip -o pcre-8.10.zip ?

$ test]#cd pcre-8.10 ?

$ pcre-8.10]#./configure --prefix=/usr/local/pcre ?

$ pcre-8.10]#make && make install?


4.最后编译Apache时加上:

--with-apr=/usr/local/apr \

--with-apr-util=/usr/local/apr-util/ \

?--with-pcre=/usr/local/pcre


=============================================================


$ ~]#cd /soft

$ soft]#tar jxvf httpd-2.2.6.tar.bz2 ? ?//解压apache的压缩包

$ soft]#cd httpd-2.2.6 ? ? //定位到httpd-2.2.6 文件夹下

$ httpd-2.2.6]#ls ? ? //查看显示httpd-2.2.6 文件夹下内容

$ httpd-2.2.6]#./configure --help | more ? ?//查看安装apache配置参数

$ httpd-2.2.6]#./configure ?--prefix=/usr/local/apache ?--enable-so ? ?// ?配置apache路径

$ httpd-2.2.6]#make ? ? //编译apache

$ httpd-2.2.6]#make install ? ?//安装apache

$ httpd-2.2.6]#cd /usr/local/apache ? //进入apache的目录 ? ??

$ apache]# ?cd conf/

$ conf]#cp -a httpd.conf httpd.conf- ? ? //备份apache配置文件

$ conf]#chkconfig ?--list httpd ? ? //查看httpd服务是否已存在

$ conf]#chkconfig httpd off ? ?//关闭系统自带了httpd的服务,如果存在httpd服务 ??

$ conf]#service httpd status ? ?//查看自带httpd服务状态

$ conf]#/usr/local/apache/bin/apachectl -k start ? ?//linux启动apache命令 ? ? ? ? ? ? ?

$ conf]#netstat -an | grep :80 ? ?//查看linux80端口是否开启

$ conf]#ps -aux | grep httpd ? ? //linux下查看apache进程

$ conf]#cd ../..

$ local]#cp /usr/local/apache/bin/apachectl /etc/rc.d/init.d/apache //拷贝apache启动脚本

$ local]#vi /etc/rc.d/init.d/apache ? ?// 这里是编辑apache启动脚本

? 在开头的#!/bin/sh ?下面加上

? ? ? ? ? ? ? #chkconfig: 2345 ?85 ?15

$ local]#chkconfig --add apache ? ?//添加apache服务

$ local]#chkconfig --list apache ? ?//列出apache服务

$ local]#service apache stop ? ?//停止apache服务

$ local]#netstat -an | grep :80 ? ? //查看linux的80端口是否关闭

$ local]#ps -aux | grep httpd ? ? //查看是否存在httpd服务,若果之前自带httpd服务启动的话会导致新添加的apache服务启动失败

$ local]#service apache start ? ?//启动apache服务

打开你的服务器ip地址,看看是否出现了tomcat的默认首页,如果出现的话,那么恭喜你

linux下安装apache已经成功了


================================================


下载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"

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"


$APACHE_HOME/bin/apachectl start

DokuWiki 安全配置

在$DokuWiki_HOME目录下创建prepend.php,和apache的配置文件对应,在执行会预先加载


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:

?

热点排行