This document describes how to install Kagemai.
Kagemai requires a Web server and Ruby to run; however, their installation is not explained here. Also, this document assumes that you are using Apache as your Web server. Please substitute directions as appropriate for your operating environment.
Quick start
Installing Kagemai with install_en.rb
Creating graphs with GD and GDChart
Using mod_ruby
Using PostgreSQL
Using MySQL
Using SQL Server
Mail interface settings
Manual installation example
This section describes how to get Kagemai up and running quickly.
$ cd /home/fukuoka/public_html $ tar xfvz kagemai-0.8.7.tar.gz $ mv kagemai-0.8.7 kagemai
$ cat html/.htaccess Options +ExecCGI AddHandler cgi-script .cgi
home_url | Home page for the site |
---|---|
project_dir | Location where project data will be saved |
$ cat html/.htaccess <Files "*.conf*"> deny from all </Files> <Files user.cgi> AuthName Kagemai-User AuthType Basic AuthUserFile /etc/kagemai/user.passwd Require valid-user </Files> <Files admin.cgi> AuthName Kagemai-Administrator AuthType Basic AuthUserFile /etc/kagemai/admin.passwd Require valid-user </Files>
This section explains how to install Kagemai using install_en.rb.
# groupadd kagemai
# gpasswd -a apache kagemai
$user | User ID for the data directory |
---|---|
$group | Group ID for the data directory |
$root_dir | Directory containing libraries and resource files for Kagemai |
$html_dir | Web-accessible directory where the CGI scripts are placed |
$data_dir | Directory where project data is store |
$passwd_dir | Directory where passwords used in .htaccess authentication are placed |
# ruby install_en.rb
If you install GD and GDChart, you can display report summary graphs. If you do not need graphs, the steps below are not needed.
(The libraries mentioned below are also available at http://www.daifukuya.com/archive/kagemai/lib/. While the library versions there have been confirmed to work with Kagemai, they are likely not the latest versions.)
$ tar xfvz gd-2.0.15.tar.gz $ cd gd-2.0.15 $ ./configure ...(snip)... ** Configuration summary for gd 2.0.15: Support for PNG library: yes Support for JPEG library: yes Support for Freetype 2.x library: yes Support for Xpm library: yes ...(snip)... $ make $ sudo make install
$ tar xfvz ruby-GD-0.7.4.tar.gz $ cd ruby-GD-0.7.4 $ ruby extconf.rb --with-ttf --with-freetype $ make $ sudo make install
$ tar xfvz ruby-gdchart-0.0.9-beta.tar.gz $ cd ruby-gdchart-0.0.9-beta $ ruby extconf.rb $ make $ sudo make install
You can run Kagemai with mod_ruby. Using dot.htaccess as a guide, configure guest.cgi, user.cgi, and admin.cgi so that they start up through mod_ruby.
If you will change the *.cgi extensions to *.rbx, for example, do the following:
$ cp -p guest.cgi guest.rbx $ cp -p user.cgi user.rbx $ cp -p admin.cgi admin.rbx
guest_mode_cgi : guest.rbx user_mode_cgi : user.rbx admin_mode_cgi : admin.rbx
This section explains the configuration needed to save data using PostgreSQL. (However, it does not explain how to install PostgreSQL itself.) If you are not saving data using PostgreSQL, the configuration below is not necessary.
$ tar xfvz ruby-postgres-0.7.1.tar.gz $ cd ruby-postgres-0.7.1 $ ruby extconf.rb $ make $ su # make install
$ tar xfvz ruby-dbi-all-0.1.0.tar.gz $ cd ruby-dbi-all $ ruby setup.rb config --with=dbi,dbd_pg,dbd_mysql $ ruby setup.rb setup $ su # ruby setup.rb install
$ createuser kagemai Shall the new role be a superuser? (y/n) n Shall the new role be allowed to create databases? (y/n) n Shall the new role be allowed to create more new roles? (y/n) n CREATE ROLE
$ createdb kagemai
postgres_host | Name of the host where PostgreSQL runs. If you are using Unix domain sockets, specify the directory for the socket. The default is /tmp. |
---|---|
postgres_port | Port number (if you are connecting via TCP) |
postgres_user | Username for the PostgreSQL account |
postgres_pass | Password for the PostgreSQL account |
mysql_dbname | Name of the Kagemai database in PostgreSQL |
This section explains the necessary configuration for saving data using MySQL.
$ mysql -u root -p mysql> create database kagemai;
mysql> grant all to on kagemai.* to kagemai@localhost;
mysql_host | Name of the host where MySQL runs. The default is localhost. |
---|---|
mysql_port | Port number for MySQL. The default is 3306. |
mysql_user | Username for the MySQL account |
mysql_pass | Password for the MySQL account |
mysql_dbname | Name of the Kagemai database in MySQL |
To use SQL Server, the configuration steps below are necessary.
To use the mail interface, you will first have to set three variables in mailrf.rb: kagemai_root, config_file, and $LOGFILE. (If you installed Kagemai using install_en.rb, suitable values were already set at the time of installation.)
When you create a project, an include file for that project will be created that can be used by sendmail or other mail programs.
$ cat /var/lib/kagemai/project/test/include "|/usr/bin/ruby /usr/local/kagemai/bin/mailif.rb test"
Here, "test" is the project ID.
If you are using sendmail, edit /etc/aliases to call that file, then update /etc/aliases.db.
# grep 'test-bugs' /etc/aliases test-bugs: :include:/var/lib/kagemai/project/test/include # /usr/bin/newaliases
By default, the include file is placed in a group-writable directory. Move it to another directory and use it there if necessary.
In the default mail template, the URL for the submitted report is inserted. To have the correct URL inserted, set base_url appropriately in "Change global settings." base_url is the URL of the directory containing guest.cgi. For example, if guest.cgi is at 'http://www.example.net/kagemai/guest.cgi', set base_url to 'http://www.example.net/kagemai/'.
Kagemai automatically figures out whether submitted mail is a new report or a reply to an existing report by using the "Subject" and "In-Reply-To" headers.
This section gives an installation example in which all of the configuration is done manually.
Kagemai libraries: /usr/local/kagemai CGI scripts: /var/www/html/kagemai Data directory: /var/lib/kagemai
$ tar xfvz kagemai-0.8.7.tar.gz $ cd kagemai-0.8.7 $ su # mkdir /usr/local/kagemai # mkdir /var/www/html/kagemai # mkdir /var/lib/kagemai # mkdir /var/lib/kagemai/project # cp -pr bin /usr/local/kagemai # cp -pr lib /usr/local/kagemai # cp -pr resource /usr/local/kagemai # cp -p html/* /var/www/html/kagemai
# groupadd kagemai # cd /var/lib # chgrp -R kagemai kagemai # chmod -R 02770 kagemai
# gpasswd -a apache kagemai
project_dir : /var/lib/kagemai base_url : http://www.example.net/kagemai/
And you're done.