配置Twiki(一)

一、先学习apache2的安装和配置

二、安装和配置Twiki

安装环境:虚拟机ubuntu 10.04 (Linux ubuntu 2.6.32-25-generic #45-Ubuntu SMP i686 GNU/Linux)

1. 把twiki作为apache2的默认配置,将twiki解压后放在/var/www/下,创建并修改相关文件(在twiki下都有副本,可以直接拷贝,稍加改动即可用),需要修改的文件:

 

bin/LocalLib.cfg (bin/LocalLib.cfg.txt) 

$twikiLibPath = "/var/www/twiki/lib";

 

lib/LocalSite.cfg (lib/LocalSite.cfg.txt)

# URL for TWiki host e.g. http://myhost.com:123 $cfg{DefaultUrlHost} = 'http://www.mytwiki.com'; # cgi-bin URL path for TWiki e.g. /twiki/bin $cfg{ScriptUrlPath} = '/twiki/bin'; # Attachments URL path e.g. /twiki/pub $cfg{PubUrlPath} = '/twiki/pub'; # Attachments store file path (not URL), must match /twiki/pub e.g. # /usr/local/twiki/pub $cfg{PubDir} = '/var/www/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 $cfg{TemplateDir} = '/var/www/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. $cfg{DataDir} = '/var/www/twiki/data';

 

httpd.conf (twiki_httpd_conf.txt),修改之后将内容附加到/etc/apache2/httpd.conf文件

# Example httpd.conf file for TWiki. # # You are recommended to take a copy of this file and edit # the paths to match your installation. Then add: # include "/home/httpd/twiki/twiki_httpd.conf" # to the end of your main httpd.conf file. # # The first parameter will be part of the URL to your installation e.g. # http://my.co.uk/twiki/bin/view/... # The second parameter must point to the physical path on your disk. Be # careful not to lose any trailing /'s. #### Change the _second_ path to match your local installation ScriptAlias /twiki/bin/ "/var/www/twiki/bin/" # This defines a url that points to the root of the twiki installation. It is # used to access files in the pub directory (attachments etc) # It must come _after_ the ScriptAlias. #### Change the path to match your local installation Alias /twiki/ "/var/www/twiki/" # This specifies the options on the TWiki scripts directory. The ExecCGI # and SetHandler tell apache that it contains scripts. "Allow from all" # lets any IP address access this URL. ### Change the path to match your local installation <Directory "/var/www/twiki/bin"> Options +ExecCGI FollowSymLinks SetHandler cgi-script Allow from all </Directory> #<Directory "/var/www/twiki/bin"> # AllowOverride None # Options None # Order allow,deny # Allow from all #</Directory> # # This sets the options on the pub directory, which contains attachments and # other files like CSS stylesheets and icons. AllowOverride None stops a # user installing a .htaccess file that overrides these options. # Note that files in pub are *not* protected by TWiki Access Controls, # so if you want to control access to files attached to topics, you may # need to add your own .htaccess files to subdirectories of pub. See the # Apache documentation on .htaccess for more info. #### Change the path to match your local installation <Directory "/var/www/twiki/pub"> Options FollowSymLinks +Includes Allowoverride All Allow from all </Directory> # Security note: All other directories should be set so # that they are *not* visible as URLs, so we set them as =deny from all=. #### Change the paths to match your local installation <Directory "/var/www/twiki/data"> deny from all </Directory> <Directory "/var/www/twiki/templates"> deny from all </Directory> <Directory "/var/www/twiki/lib"> deny from all </Directory>

 

index.html (修改index文件中的超链接是为了与httpd.conf中的ScriptAlias /twiki/bin/ "/var/www/twiki/bin/"保持一致)

<li> <a href="twiki/bin/configure" mce_href="twiki/bin/configure">Configure TWiki</a>  

2. 在浏览器中输入http://localhost/,可以浏览twiki的首页,点击Configure TWiki,进入配置界面

 

三、配置当中遇到的问题

在http.conf中,

ScriptAlias /twiki/bin/ "/var/www/twiki/bin/"

/twiki/bin是相对于/localhost/来讲的

也就是说在不修改上述index.html的情况下,需要输入http://localhost/twiki/bin/configure 才可以执行配置

 

参考资料:http://man.chinaunix.net/newsoft/ApacheMenual_CN_2.2new/index.html

posted on 2010-11-09 10:39  SunBo 阅读( ...) 评论( ...) 编辑 收藏

转载于:https://www.cnblogs.com/sunyubo/archive/2010/11/09/2282095.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值