version:4.2.4
必要套件:Apache22、Perl5.10
安裝 cd /usr/ports/www/twiki make install clean
設定各目錄訪問權限(bin與pub的設定在twiki.conf內而不使用.htaccess) cd /usr/local/www/twiki cp root-htaccess.txt .htaccess cp subdir-htaccess.txt data/.htaccess cp subdir-htaccess.txt locale/.htaccess cp subdir-htaccess.txt templates/.htaccess cp subdir-htaccess.txt tools/.htaccess cp subdir-htaccess.txt working/.htaccess
設定twikiLibPath cd /usr/local/www/twiki/bin cp LocalLib.cfg.txt LocalLib.cfg //先copy example config vi LocalLib.cfg 找到$twikiLibPath,並修改成實際路徑 $twikiLibPath = “/usr/local/www/twiki/lib”
加入/usr/local/etc/apache22/twiki.conf ScriptAlias /twiki/bin “/usr/local/www/twiki/bin” Alias /twiki/pub “/usr/local/www/twiki/pub”
BrowserMatchNoCase ^$ blockAccess
<Directory “/usr/local/www/twiki/bin”> AllowOverride None Order Allow,Deny Allow from all Deny from env=blockAccess
Options ExecCGI FollowSymLinks SetHandler cgi-script
Password file for TWiki users
AuthUserFile /usr/local/www/twiki/data/.htpasswd AuthName ‘Enter your WikiName: (First name and last name, no space, no dots, capitalized, e.g. JohnSmith)’ AuthType Basic
<FilesMatch “^configure.*"> SetHandler cgi-script Order Deny,Allow Deny from all Allow from 127.0.0.1 192.168.1.10 <–在這裡加入自己的IP(不然進不去configure) Require user JohnDoe Satisfy Any
<Directory “/usr/local/www/twiki/pub”> Options None AllowOverride Limit Allow from all
AddType text/plain .shtml .php .php3 .phtml .phtm .pl .py .cgi
編輯http.conf,在最底下加入一行 include “etc/apache22/twiki.conf”
打開瀏覽器進入Configure http://(hostname)/twiki/bin/configure
若噴出Error.pm,將p5-Error砍掉重裝 cd /usr/ports/lang/p5-Error make deinstall clean make install clean ※不知道為什麼reinstall系統會噴錯誤,所以才下兩行指令
這時候應該就沒有error了,可以點選next 然後設定密碼後保存 twiki/lib底下就會出現LocalSite.cfg(用來保存網站設定)
若{RCS}{EgrepCmd}與{RCS}{fgrepCmd}出現 Error:"/BIN/grep” does not meet the current Path. 因為FreeBSD的grep在/usr/bin底下 所以只要把/bin/grep改成/usr/bin/grep(後面的參數不動)即可
User Mapping的部分: 預射是Twiki::Users::TwikiUserMapping 如果想先試跑首頁就先改成Twiki::Users::BaseUserMapping 保存後就可進入WebHome了 網址 http://(hostname)/twiki/bin/view/Main/WebHome
認證:
CGI::Session Install shell> perl -MCPAN -e shell cpan> install CGI::Session Reference:http://cpan.uwinnipeg.ca/htdocs/CGI-Session/INSTALL.html