$ diff lib/LocalSite.cfg.txt lib/LocalSite.cfg
1,55c1,78
< # Example site-specific configuration file for TWiki, held in 'lib' directory.
< #
< # This is distributed as LocalSite.cfg.txt - if for some reason you can't,
< # or don't want to, use =configure= to manage your site configuration, you can
< # copy this file to LocalSite.cfg edit it manually.
< #
< # LocalSite.cfg overrides TWiki.cfg, so there is no risk of your settings
< # being overwritten when you upgrade.
< #
< # Only the most commonly used settings are listed in LocalSite.cfg.txt
< # See TWiki.cfg to copy across the other (seldom changed) settings
< #
< # Use 'LocalLib.cfg' in the 'bin' directory to configure non-standard
< # locations for the 'lib' directory or Perl modules.
< #
<
< # NOTE: If your server is running Microsoft Windows, paths should
< # normally be written as "c:/foo" not "c:\foo" (which doesn't do what
< # you may think it does). You can use '\' without problems inside
< # single quotes, e.g. 'c:\foo'.
<
< # If LocalSite.cfg is used (and it _should_ be), then _all_ the
< # following paths muct be defined.
<
< # URL for TWiki host e.g. http://myhost.com:123
< $TWiki::cfg{DefaultUrlHost} = 'http://your.domain.com';
<
< # cgi-bin URL path for TWiki e.g. /twiki/bin
< $TWiki::cfg{ScriptUrlPath} = '/twiki/bin';
<
< # Attachments URL path e.g. /twiki/pub
< $TWiki::cfg{PubUrlPath} = '/twiki/pub';
<
< # Attachments store file path (not URL), must match /twiki/pub e.g.
< # /usr/local/twiki/pub
< $TWiki::cfg{PubDir} = '/home/httpd/twiki/pub';
<
< # SECURITY NOTE: Directories =twiki/data= , =twiki/templates= and all their
< # subdirectories should be set so that they are _not_ visible through
< # URLs. (Alternatively, move the directories to a place where they are
< # not visible, and set the paths here as appropriate)
<
< # Template directory e.g. /usr/local/twiki/templates
< $TWiki::cfg{TemplateDir} = '/home/httpd/twiki/templates';
<
< # Topic files store (file path not URL) e.g. /usr/local/twiki/data
< # TWiki will use this path to base other defaults, such as the location
< # of password files.
< $TWiki::cfg{DataDir} = '/home/httpd/twiki/data';
<
< # TWiki.cfg will use this path to default where to put log files, unless
< # you override individual paths here.
< $TWiki::cfg{LogDir} = $TWiki::cfg{DataDir};
<
< 1;
---
> # Example site-specific configuration file for TWiki, held in 'lib' directory.
> #
> # This is distributed as LocalSite.cfg.txt - if for some reason you can't,
> # or don't want to, use =configure= to manage your site configuration, you can
> # copy this file to LocalSite.cfg edit it manually.
> #
> # LocalSite.cfg overrides TWiki.cfg, so there is no risk of your settings
> # being overwritten when you upgrade.
> #
> # Only the most commonly used settings are listed in LocalSite.cfg.txt
> # See TWiki.cfg to copy across the other (seldom changed) settings
> #
> # Use 'LocalLib.cfg' in the 'bin' directory to configure non-standard
> # locations for the 'lib' directory or Perl modules.
> #
>
> # NOTE: If your server is running Microsoft Windows, paths should
> # normally be written as "c:/foo" not "c:\foo" (which doesn't do what
> # you may think it does). You can use '\' without problems inside
> # single quotes, e.g. 'c:\foo'.
>
> # If LocalSite.cfg is used (and it _should_ be), then _all_ the
> # following paths muct be defined.
>
> # URL for TWiki host e.g. http://myhost.com:123
> $TWiki::cfg{DefaultUrlHost} = 'http://wiki.os-drive.com';
>
> # cgi-bin URL path for TWiki e.g. /twiki/bin
> $TWiki::cfg{ScriptUrlPath} = '/bin';
>
> # Attachments URL path e.g. /twiki/pub
> $TWiki::cfg{PubUrlPath} = '/pub';
>
> # Attachments store file path (not URL), must match /twiki/pub e.g.
> # /usr/local/twiki/pub
> $TWiki::cfg{PubDir} = '/home/zhigang/wiki.os-drive.com/pub';
>
> # SECURITY NOTE: Directories =twiki/data= , =twiki/templates= and all their
> # subdirectories should be set so that they are _not_ visible through
> # URLs. (Alternatively, move the directories to a place where they are
> # not visible, and set the paths here as appropriate)
>
> # Template directory e.g. /usr/local/twiki/templates
> $TWiki::cfg{TemplateDir} = '/home/zhigang/wiki.os-drive.com/templates';
>
> # Topic files store (file path not URL) e.g. /usr/local/twiki/data
> # TWiki will use this path to base other defaults, such as the location
> # of password files.
> $TWiki::cfg{DataDir} = '/home/zhigang/wiki.os-drive.com/data';
>
> # TWiki.cfg will use this path to default where to put log files, unless
> # you override individual paths here.
> $TWiki::cfg{LogDir} = $TWiki::cfg{DataDir};
> $TWiki::cfg{Languages}{fr}{Enabled} = 0;
> $TWiki::cfg{Languages}{pl}{Enabled} = 0;
> $TWiki::cfg{Site}{Lang} = 'zh';
> $TWiki::cfg{DisplayTimeValues} = 'servertime';
> $TWiki::cfg{Languages}{da}{Enabled} = 0;
> $TWiki::cfg{Languages}{de}{Enabled} = 0;
> $TWiki::cfg{Languages}{'zh-tw'}{Enabled} = 0;
> $TWiki::cfg{UserInterfaceInternationalisation} = 1;
> $TWiki::cfg{Site}{Locale} = 'zh_CN.UTF-8';
> $TWiki::cfg{Password} = 'XXXXXXXXXXXX';
> $TWiki::cfg{Languages}{es}{Enabled} = 0;
> $TWiki::cfg{Languages}{pt}{Enabled} = 0;
> $TWiki::cfg{UseLocale} = 1;
> $TWiki::cfg{LocalesDir} = '/home/zhigang/wiki.os-drive.com/locale';
> $TWiki::cfg{Languages}{sv}{Enabled} = 0;
> $TWiki::cfg{Languages}{it}{Enabled} = 0;
> $TWiki::cfg{Languages}{nl}{Enabled} = 0;
> $TWiki::cfg{Site}{FullLang} = 'zh-cn';
> $TWiki::cfg{Site}{CharSet} = 'UTF-8';
> $TWiki::cfg{LoginManager} = 'TWiki::Client::TemplateLogin';
> $TWiki::cfg{Register}{AllowLoginName} = 1;
> $TWiki::cfg{Plugins}{WysiwygPlugin}{Enabled} = 1;
> $TWiki::cfg{Plugins}{RenderListPlugin}{Enabled} = 1;
> $TWiki::cfg{Plugins}{EmptyPlugin}{Enabled} = 1;
> 1;
这样一个TWiki的初始配置就算完成了。当然如果你想要它正常工作,还需要启动sendmail:
# service sendmail start
注:Redhat Enterprise Linux 4 中sendmail的缺省配置是没有SMTP认证的,所以别人可以随便使用你的sendmail来转发邮件,一不小心就会成为别人的垃圾邮件转发站。如果没有时间学习sendmail的配置(像我 :) ),可以只在测试TWiki某些功能(如用户注册、布告等)时才启动该服务。
TWiki安装配置指南
在选择和比较了众多Wiki系统之后,最后锁定了TWiki。该系统的主要优点:
通过部署和实验,发现TWiki的不足:
每个人使用Wiki系统的目的不同,所以对于各系统的好坏自有评判。本人搭建该系统是得到了不少网友的帮助,也参考了许多很好的网上中文资料。尤其感谢车东,他不但翻译了TWiki,让大家有很好的中文系统可用,还写了一篇很好的安装指南。
下面我就将自己搭建本站Wiki系统的过程记录一下,希望对后面使用该系统的朋友有所帮助。下面的操作使用TWiki 4.0.2 在Redhat Enterprise Linux 4 update 3 系统上配置通过,本人使用的个人帐户是zhigang,如果你想在自己的计算机上实验,要考虑到版本和用户之间的不同。
<Directory /> Options FollowSymLinks AllowOverride All </Directory> DocumentRoot "/home/zhigang/wiki.os-drive.com" User zhigang Group zhigang然后重新启动httpd:$ diff bin/.htaccess.txt bin/.htaccess 41c41 < AuthUserFile {DataDir}/.htpasswd --- > AuthUserFile /home/zhigang/wiki.os-drive.com/data/.htpasswd 66c66 < ErrorDocument 401 {ScriptUrlPath}/view/TWiki/TWikiRegistration --- > ErrorDocument 401 /bin/view/TWiki/TWikiRegistration 81,82c81,82 < Allow from 127.0.0.1, 192.168.1.10 < Require user {Administrators} --- > # Allow from 127.0.0.1, 192.168.1.10 > Require user zhigang 94,97c94,96 < < <FilesMatch "(attach|edit|manage|rename|save|upload|mail|logon|.*auth).*"> < require valid-user < </FilesMatch> --- > #<FilesMatch "(attach|edit|manage|rename|save|upload|mail|logon|.*auth).*"> > # require valid-user > #</FilesMatch>上面的: 表示用户认证的文件(即存放用户名和秘密的文件)是/home/zhigang/wiki.os-drive.com/data/.htpasswd; 表示要对configure脚本进行访问,需要认证的用户名是zhigang。现在用户认证文件并不存在,需要我们自己创建:$ diff lib/LocalSite.cfg.txt lib/LocalSite.cfg 1,55c1,78 < # Example site-specific configuration file for TWiki, held in 'lib' directory. < # < # This is distributed as LocalSite.cfg.txt - if for some reason you can't, < # or don't want to, use =configure= to manage your site configuration, you can < # copy this file to LocalSite.cfg edit it manually. < # < # LocalSite.cfg overrides TWiki.cfg, so there is no risk of your settings < # being overwritten when you upgrade. < # < # Only the most commonly used settings are listed in LocalSite.cfg.txt < # See TWiki.cfg to copy across the other (seldom changed) settings < # < # Use 'LocalLib.cfg' in the 'bin' directory to configure non-standard < # locations for the 'lib' directory or Perl modules. < # < < # NOTE: If your server is running Microsoft Windows, paths should < # normally be written as "c:/foo" not "c:\foo" (which doesn't do what < # you may think it does). You can use '\' without problems inside < # single quotes, e.g. 'c:\foo'. < < # If LocalSite.cfg is used (and it _should_ be), then _all_ the < # following paths muct be defined. < < # URL for TWiki host e.g. http://myhost.com:123 < $TWiki::cfg{DefaultUrlHost} = 'http://your.domain.com'; < < # cgi-bin URL path for TWiki e.g. /twiki/bin < $TWiki::cfg{ScriptUrlPath} = '/twiki/bin'; < < # Attachments URL path e.g. /twiki/pub < $TWiki::cfg{PubUrlPath} = '/twiki/pub'; < < # Attachments store file path (not URL), must match /twiki/pub e.g. < # /usr/local/twiki/pub < $TWiki::cfg{PubDir} = '/home/httpd/twiki/pub'; < < # SECURITY NOTE: Directories =twiki/data= , =twiki/templates= and all their < # subdirectories should be set so that they are _not_ visible through < # URLs. (Alternatively, move the directories to a place where they are < # not visible, and set the paths here as appropriate) < < # Template directory e.g. /usr/local/twiki/templates < $TWiki::cfg{TemplateDir} = '/home/httpd/twiki/templates'; < < # Topic files store (file path not URL) e.g. /usr/local/twiki/data < # TWiki will use this path to base other defaults, such as the location < # of password files. < $TWiki::cfg{DataDir} = '/home/httpd/twiki/data'; < < # TWiki.cfg will use this path to default where to put log files, unless < # you override individual paths here. < $TWiki::cfg{LogDir} = $TWiki::cfg{DataDir}; < < 1; --- > # Example site-specific configuration file for TWiki, held in 'lib' directory. > # > # This is distributed as LocalSite.cfg.txt - if for some reason you can't, > # or don't want to, use =configure= to manage your site configuration, you can > # copy this file to LocalSite.cfg edit it manually. > # > # LocalSite.cfg overrides TWiki.cfg, so there is no risk of your settings > # being overwritten when you upgrade. > # > # Only the most commonly used settings are listed in LocalSite.cfg.txt > # See TWiki.cfg to copy across the other (seldom changed) settings > # > # Use 'LocalLib.cfg' in the 'bin' directory to configure non-standard > # locations for the 'lib' directory or Perl modules. > # > > # NOTE: If your server is running Microsoft Windows, paths should > # normally be written as "c:/foo" not "c:\foo" (which doesn't do what > # you may think it does). You can use '\' without problems inside > # single quotes, e.g. 'c:\foo'. > > # If LocalSite.cfg is used (and it _should_ be), then _all_ the > # following paths muct be defined. > > # URL for TWiki host e.g. http://myhost.com:123 > $TWiki::cfg{DefaultUrlHost} = 'http://wiki.os-drive.com'; > > # cgi-bin URL path for TWiki e.g. /twiki/bin > $TWiki::cfg{ScriptUrlPath} = '/bin'; > > # Attachments URL path e.g. /twiki/pub > $TWiki::cfg{PubUrlPath} = '/pub'; > > # Attachments store file path (not URL), must match /twiki/pub e.g. > # /usr/local/twiki/pub > $TWiki::cfg{PubDir} = '/home/zhigang/wiki.os-drive.com/pub'; > > # SECURITY NOTE: Directories =twiki/data= , =twiki/templates= and all their > # subdirectories should be set so that they are _not_ visible through > # URLs. (Alternatively, move the directories to a place where they are > # not visible, and set the paths here as appropriate) > > # Template directory e.g. /usr/local/twiki/templates > $TWiki::cfg{TemplateDir} = '/home/zhigang/wiki.os-drive.com/templates'; > > # Topic files store (file path not URL) e.g. /usr/local/twiki/data > # TWiki will use this path to base other defaults, such as the location > # of password files. > $TWiki::cfg{DataDir} = '/home/zhigang/wiki.os-drive.com/data'; > > # TWiki.cfg will use this path to default where to put log files, unless > # you override individual paths here. > $TWiki::cfg{LogDir} = $TWiki::cfg{DataDir}; > $TWiki::cfg{Languages}{fr}{Enabled} = 0; > $TWiki::cfg{Languages}{pl}{Enabled} = 0; > $TWiki::cfg{Site}{Lang} = 'zh'; > $TWiki::cfg{DisplayTimeValues} = 'servertime'; > $TWiki::cfg{Languages}{da}{Enabled} = 0; > $TWiki::cfg{Languages}{de}{Enabled} = 0; > $TWiki::cfg{Languages}{'zh-tw'}{Enabled} = 0; > $TWiki::cfg{UserInterfaceInternationalisation} = 1; > $TWiki::cfg{Site}{Locale} = 'zh_CN.UTF-8'; > $TWiki::cfg{Password} = 'XXXXXXXXXXXX'; > $TWiki::cfg{Languages}{es}{Enabled} = 0; > $TWiki::cfg{Languages}{pt}{Enabled} = 0; > $TWiki::cfg{UseLocale} = 1; > $TWiki::cfg{LocalesDir} = '/home/zhigang/wiki.os-drive.com/locale'; > $TWiki::cfg{Languages}{sv}{Enabled} = 0; > $TWiki::cfg{Languages}{it}{Enabled} = 0; > $TWiki::cfg{Languages}{nl}{Enabled} = 0; > $TWiki::cfg{Site}{FullLang} = 'zh-cn'; > $TWiki::cfg{Site}{CharSet} = 'UTF-8'; > $TWiki::cfg{LoginManager} = 'TWiki::Client::TemplateLogin'; > $TWiki::cfg{Register}{AllowLoginName} = 1; > $TWiki::cfg{Plugins}{WysiwygPlugin}{Enabled} = 1; > $TWiki::cfg{Plugins}{RenderListPlugin}{Enabled} = 1; > $TWiki::cfg{Plugins}{EmptyPlugin}{Enabled} = 1; > 1;这样一个TWiki的初始配置就算完成了。当然如果你想要它正常工作,还需要启动sendmail:
注:Redhat Enterprise Linux 4 中sendmail的缺省配置是没有SMTP认证的,所以别人可以随便使用你的sendmail来转发邮件,一不小心就会成为别人的垃圾邮件转发站。如果没有时间学习sendmail的配置(像我 :) ),可以只在测试TWiki某些功能(如用户注册、布告等)时才启动该服务。TWiki中的目录管理,权限管理等都角其他Wiki系统复杂一些,但是也强大很多,能够满足很多人的需求。如果有时间,将自己的一些经验一并分享给大家。
参考资料
Feeds
Tags
gtd syslog twiki virtualizaion wiki xenCopyright © 2010 Zhigang Wang. Some right reserved.
The views expressed on this web site are my own and do not necessarily reflect the views of Oracle.