r3 - 17 Dec 2007 - 06:49:58 - Main.yfangYou are here: YWiki >  Ywiki Web > Twiki安装攻略

Twiki安装攻略

0. 环境准备

  • CentOS4
  • 已经安装好的Apache2
 
yum install httpd
  • Perl5.8及所需模块
    • CGI::Session
 
perl -MCPAN -e 'install CGI::Session'
  • 一个安装好的邮件服务,最好带有SMTP
    • 比如Qmail或者PostFix等,当然,如果没有smtp,给你带来的麻烦可能仅仅是多修改一个warning

1. 准备安装目录

# 建立wiki主目录
mkdir -p /var/www/ywiki
cd /var/www/ywiki/

2. 获得TWiki源码并解压

# 下载最新的Twiki源码包
wget http://twiki.org/p/pub/Codev/Release/TWiki-4.1.2.tgz  
tar zxvf TWiki-4.1.2.tgz

3. 重新部署.htaccess文件

    cp root-htaccess.txt .htaccess
    cp pub-htaccess.txt pub/.htaccess
    cp subdir-htaccess.txt lib/.htaccess
    cp subdir-htaccess.txt data/.htaccess
    cp subdir-htaccess.txt locale/.htaccess
    cp subdir-htaccess.txt templates/.htaccess
    cp bin/.htaccess.txt bin/.htaccess

4. 编辑配置文件

cp bin/LocalLib.cfg.txt bin/LocalLib.cfg

#修改 bin/LocalLib.cfg,将 $twikiLibPath 改为合适的路径
  $twikiLibPath = "/var/www/ywiki/lib";
    
#修改 bin/.htaccess
    #将{DataDir}和{Administrators} 修改为合适的内容
    AuthUserFile /var/www/ywiki/data/.htpasswd
    AuthType Basic
    <FilesMatch "configure.*">
        SetHandler cgi-script
        Order Deny,Allow
        Deny from all
        Allow from 127.0.0.1, 192.168.2.57
        Require user yfang
        Satisfy Any
    </FilesMatch>

    #将ErrorDocument 改为适当的位置,当然这个位置可能也没有这个文件
    ErrorDocument 401 /var/www/ywiki/bin/view/TWiki/TWikiRegistration
    
#建立系统管理员帐户
/usr/local/httpd/bin/htpasswd -c data/.htpasswd yfang
#输入密码,确认,这样你得到了一个叫做yfang的管理员

5. 配置apache

# 由于我的apache是include hosts/*.conf的,所以我只需要把当前的默认配置文件链接到apache能找到的地方即可
ln -s /var/www/ywiki/twiki_httpd_conf.txt /usr/local/httpd/conf/hosts/twiki_httpd_conf.conf
# 当然,建议你在更改之前先对默认配置文件做一个副本

因为我的apache使用虚拟主机管理apache,你需要稍微更改一下默认的twiki_httpd_conf.txt 在文件最开头和结尾添加标签,根据需求写好你要监听的端口,或者你根据ServerName访问,不必再单独开端口 养成良好的习惯,添加ServerAdmin,DocumentRoot,ErrorLog,CustomLog等配置,如果有ServerName也需要写,这里需要一些apache配置知识 将所有默认目录改为真是目录 注释掉php_admin_flag engine off,否则apache会报错 其他配置根据需求设定

这里提供一个我的配置作为参考,其中我监听了7777端口,这个是可选的。

6. 更改目录访问权限

# 假设你使用apache用户作为Apache的用户
chown -R apache /var/www/ywiki

# 为了以后操作方便,将所有.htaccess文件赋予写权限,默认只读
find ./ -name ".htaccess" -exec chmod u+w {} \;

7. 重启Apache

#很可能是
apachectl restart
#或是
/etc/init.d/httpd restart
如果apache正常运行,尝试访问http://serverip:port/bin/configure 如果页面根本没有打开,请检查你的apache errorlog然后修正问题. 这些问题可能是:
  • 你的apache.conf文件目录没有配置正确
  • Options/AddType not allowed in some .htaccess
你需要做的是把有问题的部分注释掉通常即可。 页面正常打开之后,你会看到一些配置行为,对于默认的情况,通常会有一些错误和警告,分别是红色和橙色 你可以打开他们并修正问题。

到此为止,你的Twiki已经安装完成,坐下来喝杯茶吧,放松一点。接下来我们要定制和优化我们的Twiki.

-- Main.yfang - 14 Dec 2007

Topic attachments
I Attachment Action Size Date Who Comment
elseEXT ywiki_httpd_conf manage 5.5 K 14 Dec 2007 - 09:41 Main.yfang Ywiki的apache配置文件
Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r3 < r2 < r1 | More topic actions
Ywiki.Twiki安装攻略 moved from Ywiki.Twiki安装笔记 on 17 Dec 2007 - 06:49 by Main.yfang - put it back
 
Powered by YWiki
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding YWiki? Send feedback