
! Table of contents

* [[Installing as CGI|#Installing as CGI]]
* [[Installing as a server|#Installing as a server]]

! Installing as CGI

!! Preparation

It is necessary to install the following software.

* [[Ruby]] version 1.6 or later
* template engine [[misen]]
* parser generator [[Racc]]

!! Determination of Target Directories

Please determine following directories.
* <CGI Directory>
* <Theme Directory>
* <Data Directory>

<CGI Directory> : It is necessary to be CGI executable directory. 

<Theme Directory> : It is readable by CGI process, and accessable from web browser.

<Data Directory> : This directory requires write permission for CGI process.

!! Extract Source Packages

 # tar xvfz KakiWiki-x.x.x.tar.gz
or
 # gzip -d -c KakiWiki-x.x.x.tar.gz | tar xvf -


!! Copy Files

# Copy the following files and directories to <CGI Directory>.
** kaki.cgi 
** config.rb
** sample.htaccess
** src/ 
** template/ 
# Copy the theme directory to <Theme Directory>.
# Copy the data directory to <Data Directory>.


!! Edit Configuration File
<CGI Directory>/config.rb is configuration file.

Please set up the following variables.

* $data_dir : Set <Data Directory> path. It is an absolute path, or a relative path from <CGI Directory>.
* $theme_dir : Set <Theme Directory> path.
* $theme_base_url : Set URL which can refer to <Theme Directory>.

* $use_cache : Set true, if you want to enable DOM tree cache.
* $use_memory_cache : Set true, if you want to enable memory cache.

If you install KakiWiki as CGI, following setup will be good.

 $use_cache = true
 $use_memory_cache = false

!! Example of Installing as CGI

It is a procedure in the case of the following conditions.
* HTML directory : /home/www/htdocs/
* CGI executable directory : /home/www/cgi-bin/
* user name of httpd process : www
* group name of httpd process : www

Each directory is determined as follows.
* <CGI Directory>  : /home/www/cgi-bin/
* <Theme Directory> : /home/www/htdocs/theme/
* <Data Directory> : /home/www/kaki_data/

Copy each file.
 # gzip -d -c KakiWiki-x.x.x.tar.gz | tar xvf -
 # cd KakiWiki-x.x.x
 # cp kaki.cgi config.rb /home/www/cgi-bin/
 # cp sample.htaccess /home/www/cgi-bin/.htaccess
 # cp -r src/ template/ /home/www/cgi-bin/
 # mkdir /home/www/htdocs/theme
 # cp -r theme/* /home/www/htdocs/theme/
 # mkdir /home/www/kaki_data
 # cp -r data/* /home/www/htdocs/kaki_data/
 # su -
 # chown -R www.www /home/www/htdocs/kaki_data/
 # chmod -R o-rwx /home/www/htdocs/kaki_data/

Edit config.rb file.
 # data and conig file directory
 $data_dir  = '../kaki_data/'
 
 $theme_dir  = '../htdocs/theme/'
 $theme_base_url  = '/theme/'
 
 $use_cache = true
 $use_memory_cache = false


----
! Installing as a server

!! Preparation
It is necessary to install the following software.

* [[Ruby]] version 1.6 or later
* template engine [[misen]]
* parser generator [[Racc]]
* web server [[WEBRick]]


!! Extract source packages

 # tar xvfz KakiWiki-x.x.x.tar.gz
or
 # gzip -d -c KakiWiki-x.x.x.tar.gz | tar xvf -


!! Edit Configuration File
KakiWiki-x.x.x/config.rb is configuration file.
Probably, it will be satisfactory at a default setup.


Setup of cash Probably, If you install KakiWiki as a server, following setup will be good.

 $use_cache = true
 $use_memory_cache = true

Setup port number of http server in KakiServ_config.rb file.

 # port number
 $port_number = 8888

!! Run KakiServ.rb

 $ ./KakiServ.rb 


!! Example of Installing as a server

It is a procedure in the case of the following conditions.
* KakiWiki home directory : /home/hoge/KakiWiki
* port number : 80

The example of config.rb
 # data and conig file directory
 $data_dir  = '/home/hoge/KakiWiki/data/'
 
 $theme_dir  = '/home/hoge/KakiWiki/theme/'
 $theme_base_url  = 'theme/'
 
 $use_cache = true
 $use_memory_cache = true

The example of KakiServ_config.rb.
 # port number
 $port_number = 80

