在错误追踪系统中,Mantis绝对是个轻量级的工具,无论安装还是配置或使用,正如它自己的目标中所宣称的。但是,对一个中小型的项目来言,功能够用。
Mantis是一个基于php/MySQL/web的开源的错误追踪系统,以下安装教程假设系统已经安装好了Apache、PHP、MySQL的运行系统,如何安装这些环境请查看另外的配置文档。
一、下载
从Mantis官方网站下载最新版本。http://www.mantisbt.org/
目前最新版为0.19.1
二、安装
1、解压缩
$tar zxvf mantis-0.19.1.tar.gz
$mv mantis-0.19.1 mantis
2、建立数据库mantis及用户mantis
$mysqladmin -u root -p create mantis
//输入MySQL的root密码即可完成创建数据库mantis的操作
$mysql -u root -p
mysql>grant all privileges on mantis.* to 'mantis'@'localhost' identified by '你指定的mantis用户密码';
mysql>FLUSH PRIVILEGES;
mysql>/q
3、修改配置文件
$cd mantis
$cp config_inc.php.sample config_inc.php
$vi config_inc.php
//修改以下几行
$g_db_username = "mantis";
$g_db_password = "你在建立用户时指定的密码";
$g_database_name = "mantis";
//增加一下几行
$g_path = "http://www.yourdomain.com/mantis/";
$g_icon_path = $g_path."images/";
$g_absolute_path = "/解压缩的目录/mantis/"; #此处的mantis要和第1)步中mv的目标一致
$g_use_iis = OFF; #我们用的是linux
$g_show_version = ON;
//以下是配置邮件的,Mantis使用邮件来进行注册和通知,所以必须配置好
$g_enable_email_notification = ON; # 开通邮件通知
$g_smtp_host = 'mail.any8.com'; # SMTP 服务器
$g_smtp_username = 'sager'; # 邮箱登录用户名
$g_smtp_password = '对应用户邮箱的密码'; # 邮箱登录密码
$g_use_phpMailer = ON; # 使用 PHPMailer 发送邮件
$g_phpMailer_path = '/usr/local/php/includes/PHPMailer/'; # PHPMailer 的存放路径
$g_phpMailer_method = 2; # PHPMailer 以 SMTP
4、汉化
$vi config_inc.php
//修改下面这行为
$g_default_language='chinese_simplified';
$vi sql/db_generate.sql
language varchar(32) NOT NULL default 'chinese_simplified',
5、创建数据库的表结构
$mysql -u mantis -p mantis<sql/db_generate.sql
//输入数据库密码即可创建
6、修改apache的配置文件并重新启动apache
$vi $APACHE_HOME/conf/httpd.conf
//增加以下几行(仅供参考)
Alias /mantis/ "/解压缩目录/mantis/"
Options Indexs MultiViews Includes FollowSymLinks +ExecCGI
AllowOverride None
Order allow, deny
Allow from all
注:此处的 Alias /mantis/中的mantis要和前面设置的$g_path中的mantis保持一致
重启apache
注:此处的修改可以使用另外一种方式来操作,更简单
直接将mantis目录放置到虚拟主机对应的目录下面,这样就不需要设置这么多的配置:)
7、通过浏览器访问:http://www.yourdomain.com/mantis/
如果出现登录页面,则一切Ok!
8、通过浏览器访问:http://www.yourdomain.com/mantis/admin/
可以监测你的配置是否都设置对了,如果有问题,可以很清楚看到哪些地方的问题
三、应用
以administrator用户登录,密码为root,新建一个用户,权限为administrate。以新用户登录,删除administor.同时,将安装目录/mantis下admin目录删除。
剩下的就是注册用户、建立项目,设定项目的权限等操作,以管理员身份登录之后很容易就会操作的,这里就不在多说了。