使用Wiki来管理文档是一种不错的方法,这里记录一下安装和配置TWiki的过程,参考材料http://wiki.yfang.cn/bin/view/Ywiki/Twiki%E5%AE%89%E8%A3%85%E6%94%BB%E7%95%A5
http://www.twiki.org/cgi-bin/view/TWiki/TWikiInstallationGuide#Basic_Installation
1,下载安装包(当前版本已经是TWiki-5.1.1.tgz),在/data目录下解开,得道/data/twiki目录
2,重新部署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
3,配置LocalLib.cfg文件
cp bin/LocalLib.cfg.txt bin/LocalLib.cfg
根据实际lib路径修改
$twikiLibPath = "/data/twiki/lib";
cp lib/TWiki.spec lib/LocalSite.cfg
4,配置bin/.htaccess文件
AuthUserFile /data/twiki/data/.htpasswd
cp twiki_httpd_conf.txt twiki.conf
<FilesMatch "configure.*">
SetHandler cgi-script
Order Deny,Allow
Deny from all
Allow from 127.0.0.1, 192.168.1.10
Require user admin
Satisfy Any
</FilesMatch>
5,建立系统管理账户
htpasswd -c data/.htpasswd admin
6,配置apache服务
cp twiki_httpd_conf.txt twiki.conf
cd /etc/httpd/conf.d
ln -s /data/twiki/twiki.conf twiki.conf
根据实际路径修改twiki.conf文件,例如:
ScriptAlias /twiki/bin "/data/twiki/bin"
Alias /twiki/pub "/data/twiki/pub"
<Directory "/data/twiki/bin">
AuthUserFile /data/twiki/data/.htpasswd
<Directory "/data/twiki/pub">
#php_admin_flag engine off
7,修改文件宿主和权限
chown -R apache:apache /data/twiki
参考http://twiki.org/cgi-bin/view/TWiki/SettingFileAccessRightsLinuxUnix提供的脚本,在twiki目录下新建access.sh文件
#! /bin/tcsh -f set VERBOSE=-v # Uncomment the following line to silence the output. # set VERBOSE= # These are the settings for Ubuntu. set APACHE_RUN_USER=apache set APACHE_RUN_GROUP=apache chown -R ${VERBOSE} ${APACHE_RUN_USER}.${APACHE_RUN_GROUP} . find . -type d -print0 | xargs -0 chmod ${VERBOSE} 755 find data -name '*.txt' -type f -print0 | xargs -0 chmod ${VERBOSE} 644 find data pub -name '*,v' -type f -print0 | xargs -0 chmod ${VERBOSE} 444 find lib locale -type f -print0 | xargs -0 chmod ${VERBOSE} 444 find pub -type f -print0 | xargs -0 chmod ${VERBOSE} 644 find bin -type f -print0 | xargs -0 chmod ${VERBOSE} 555 find templates bin/logos -type f -print0 | xargs -0 chmod ${VERBOSE} 444 find tools -type f -print0 | xargs -0 chmod ${VERBOSE} 555 chmod ${VERBOSE} 644 lib/LocalSite.cfg chmod ${VERBOSE} 644 data/.htpasswd chmod ${VERBOSE} 644 data/mime.types chmod ${VERBOSE} 644 bin/LocalLib.cfg.txt bin/.htaccess.txt chmod ${VERBOSE} 444 bin/setlib.cfg chmod ${VERBOSE} 444 tools/extender.pl chmod ${VERBOSE} 444 working/tmp/README working/README working/registration_approvals/README working/work_areas/README chmod ${VERBOSE} 660 working/.htaccess foreach file (AUTHORS COPYING COPYRIGHT index.html INSTALL.html LICENSE pub-htaccess.txt readme.txt robots.txt root-htaccess.txt subdir-htaccess.txt twiki_httpd_conf.txt) if (-e $file) chmod ${VERBOSE} 444 $file end
8,启动Apache
service httpd start
访问http://localhost/twiki/bin/configure 检查是否成功