How to TWiki install

System: fedora11 fedora12

1.            Install apache

If your system has installed apache, go to step 2

            #tar -xvf apache_1.3.42.tar.gz

            #cd apache_1.3.42

            #./configure --prefix=/usr/local/apache

            #make

Note:  when run make, it shows below error

            htpasswd.c:145: error: conflicting types for 'getline'

            /usr/include/sys/stdio.h:31: error: previous declaration of 'getline' was here

Run below command and then run make again

            #perl -pi -e 's|getline|my_getline|' src/support/*.c

            #make

            #make install

            #/usr/local/apache/bin/apachectl start

Input  “http://127.0.0.1” in web brower, if  you can see a test page, apache is working

 

2.            Install TWiki

Note: that TWiki does not allow spaces in the directory names. Especially on Windows make sure to use a directory path without spaces.

            #mkdir /var/www/cgi-bin/twiki

Note: It seems only put under cgi-bin fold, the apache will use CGI, maybe you can modify configure file if you want to put in other fold. I have tested that, but not success

            #cd /var/www/cgi-bin/twiki

            #tar -xvf yourpath/TWiki-4.3.2.tgz

3.            Configuration TWiki

                #cp twiki/bin/LocalLib.cfg.txt twiki/bin/LocalLib.cfg

            #vim twiki/bin/LocalLib.cfg

Modify $twikiLibPath = "/absolute/path/to/your/lib"; as below

            $twikiLibPath = "/var/www/cgi-bin/twiki/lib";

Write twiki.conf file

            #sed 's:/home/httpd/:/var/www/cgi-bin/:g' twiki_httpd_conf.txt > twiki.conf

Create password for configure

            #htpasswd -c /var/www/cgi-bin/twiki/data/.htpasswd root

            Edit /var/www/cgi-bin/twiki/twiki.conf <FilesMatch "^configure.*"> tag, modify IP and user information

             <FilesMatch "^configure.*">

              SetHandler cgi-script

             Order Deny,Allow

             Deny from all

             Allow from 127.0.0.1 192.168.1.10

            Require user root

            Satisfy Any

             </FilesMatch>

Modify "Allow from" add the IP address which allow to access

Modify "Require user" add the user who can access

4.            Modify apache configuration file

Modify apache configuration file, add below line in the end of /usr/local/apache/conf/httpd.conf, maybe your configuration file is in /etc/httpd/conf/httpd.conf

include "/var/www/cgi-bin/twiki/twiki.conf"

5.            Close SELINUX

This is not a good way but a easy way to let TWiki configure work

            #vim /etc/selinux/config

            Modify SELINUX= to SELINUX=disable

            Restart system

6.            Configure TWiki

Make sure your apache is working

#service httpd restart

Note: If you see below error, just comment php_admin_flag line in twiki.conf

Invalid command 'php_admin_flag', perhaps mis-spelled or defined by a module not included in the server configuration

Input http://yourdomain/cgi-bin/twiki/bin/configure in web browser click next to change password and save configure. If you use 127.0.0.1, it does not ask you to input user name and password, but if you use other ip, it will ask you input user name and password before open the configure page. After configure finish, you can click return to TWiki WebHome page to open the home page, maybe you will see below error:

TWiki detected an internal error - please check your TWiki logs and webserver logs for more information.

Can't locate Unicodepath in @INC (@INC contains: path . path-linux-thread-multi path-linux-thread-multi path-linux-thread-multi path-linux-thread-multi path

You can modify as below

            #chmod +w twiki/lib/TWiki/Render.pm

            #vim twiki/lib/TWiki/Render.pm

Remove this line:

            use Unicode::String qw(utf8 latin1 utf16be);

Replace the following two lines in “sub makeAnchorName”:

                my $utf8AnchorName = Unicode::String->new($anchorName);   

                $anchorName = $utf8AnchorName->substr(0, 32);

with this line:

                $anchorName =~ s/^(.{32})(.*)$/$1/; # limit to 32 chars

 

7.            Useful link:

http://doxfer.com/TWiki/TWikiInstallationGuide#Preparing_to_install_TWiki

http://blog.sina.com.cn/s/blog_53a9381b0100fxay.html

http://hi.baidu.com/%CD%BE%D6%D0%B5%C4%BE%B5%D7%D3/blog/item/54453200d9dbe408728da544.html

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章