Mantis安裝配置手冊

作者:龔雲卿 2006-4-28
MySQL-server-4.1.10-0.i386.rpm
MySQL-client-4.1.10-0.i386.rpm
MySQL-devel-4.1.10-0.i386.rpm
MySQL-shared-4.1.10-0.i386.rpm
MySQL-shared-compat-4.1.10-0.i386.rpm
httpd-2.0.54.tar.gz
php-5.0.4.tar.gz
mantis-1.1.1-bin
jpgraph-1.19.tar.gz
jpegsrc.v6b.tar.gz
zlib-1.1.3.tar.gz
libpng-1.2.8.tar.gz
freetype-2.1.10.tar.gz
t1lib-5.1.0.tar.gz
graphviz-2.4-1.rh73.i386.rpm
graphviz-devel-2.4-1.rh73.i386.rpm
graphviz-doc-2.4-1.rh73.i386.rpm
graphviz-graphs-2.4-1.rh73.i386.rpm
graphviz-tcl-2.4-1.rh73.i386.rpm
 
ZendOptimizer-linuxi386.tar.gz
 
CVSWeb3.0.0.tar.gz
安裝mysql server
# rpm -ivh MySQL-server-4.0.20-0.i386.rpm
 
安裝mysql
# rpm -ivh MySQL-client-4.0.20-0.i386.rpm
 
安裝mysql其他包
# rpm –ivh MySQL-devel-4.1.10-0.i386.rpm
# rpm –ivh MySQL-shared-4.1.10-0.i386.rpm
# rpm –ivh MySQL-shared-compat-4.1.10-0.i386.rpm
 
運行mysql 客戶端,並開放root用戶的遠程訪問權限。以便調試
# mysql
> use mysql
> update user set host = `%` where user = `root` and host <> `localhost`;
> exit
 
Mysql安裝完畢。
 
# tar -zxvf httpd-2.0.54.tar.gz
# cd httpd-2.0.54
# ./configure --prefix=/web/apache --enable-module=so
# make
# make install
Apache安裝完畢。
 
說明:apachelinux下的默認最大進程數爲256,無論如何修改httpd.conf都不能超過這個限制。如果想加大這個限制,在編譯apache前編輯/home/tmp/apache/src/include/httpd.h,將其中#define HARD_SERVER_LIMIT 256 一行改爲#define HARD_SERVER_LIMIT 2048後再編譯apache
2.3.1 jpeg-6b 的安裝
# tar -xf jpegsrc.v6b.tar
# cd jpeg-6b
# ./configure
# make
# make install
 
2.3.2 zlib 的安裝
# tar –zxvf zlib-1.1.3.tar.gz
# cd zlib-1.1.3
# ./configure
# make
# make install
 
2.3.3 libpng 的安裝
# tar –zxvf libpng-1.2.8.tar.gz
# cd libpng-1.2.8
# ./configure
# make
# make install
 
2.3.4 freetype 的安裝
# tar –zxvf freetype-2.1.10.tar.gz
# cd freetype-2.1.10
# ./configure
# make
# make install
 
2.3.5 T1lib 的安裝
# tar –zxvf t1lib-5.1.0.tar.gz
# cd t1lib-5.1.0
# ./configure
# make
# make install
 
2.3.6 gd 的安裝
# tar –zxvf gd-2.0.33.tar.gz
# cd gd-2.0.33
# ./configure
# vi Makefile
(編輯 Makefile文件
改 CFLAGS=-O 爲 CFLAGS=-O -DHAVE_XPM -DHAVE_JPEG -DHAVE_LIBTTF
改 LIBS=-lm -lgd -lpng -lz 爲 LIBS=-lm -lgd -lpng -lz -ljpeg -lttf -lXpm -lX11
改 INCLUDEDIRS=-I. -I/usr/local/include -I/usr/include/X11 -I/usr/X11R6/include/X11
爲 INCLUDEDIRS=-I. -I/usr/local/include -I/usr/include/X11 -I/usr/X11R6/include/X11 -I/usr/local/include/freetype)
# make
# make install
 
# tar zxvf php-5.0.4.tar.gz
# cd php-5.0.4
#./configure --prefix=/web/php /
 --with-apxs2=/web/apache/bin/apxs /
 --with-config-file-path=/usr/local/lib /
--enable-track-vars /
--with-xml /
--with-mysql /
--with-libxml-dir=/usr/local/lib /
--with-gd=/usr/local /
--with-t1lib=/usr/local /
--with-tiff-dir=/usr/local /
--with-jpeg-dir=/usr/include /
--with-ttf=/usr/include/freetype /
--with-zlib-dir=/usr/include /
--with-png-dir=/usr/include /
--with-mbstring --enable-mbstring=all
 
# make
# make install
# cp php.ini-dist /usr/local/lib/php.ini
 
修改php.ini中的下列行
extension_dir = "./"
extension_dir = "/web/php/include/php/ext"
 
安裝完畢後用<? phpinfo(); ?>查看結果如下:
gd
GD Support enabled
GD Version 1.6.2 or higher
FreeType Support enabled
FreeType Linkage with TTF library
T1Lib Support enabled
GIF Support enabled
JPG Support enabled
PNG Support enabled
WBMP Support enabled
# mv mantis-1.1.1 /var/www/mantis
$mysqladmin -u root -p create bugtracker
//輸入MySQL的root密碼即可完成創建數據庫bugtracker的操作
$mysql -u root -p
mysql>grant all privileges on bugtracker.* to 'mantis'@'localhost' identified by '你指定的mantis用戶密碼';
mysql>FLUSH PRIVILEGES;
mysql>/q
#tar -zxvf ZendOptimizer-linuxi386.tar.gz
#cd ZendOptimizer-2.6.0-linux-glibc21-i386
#./install.sh
//重啓Apache
#/web/apache/bin/apachectl –k restart
# cd /var/www/mantis
# vi config_inc.php
 
//修改以下幾行
$g_db_username = "mantis";
$g_db_password = "你在建立用戶時指定的密碼";
$g_database_name = "bugtracker";
 
//增加以下幾行
$g_path = "http://www.yourdomain.com/mantis/";
$g_icon_path = $g_path."images/";
$g_absolute_path = "/var/www/mantis/";
$g_use_iis = OFF;
$g_show_version = ON;
 
//以下是配置郵件的,Mantis使用郵件來進行註冊和通知,所以必須配置好
$g_enable_email_notification = ON; # 開通郵件通知
$g_smtp_host = 'mail.softbrain.com.cn';   # SMTP 服務器
$g_smtp_username = '[email protected]'; # 郵箱登錄用戶名                      
$g_smtp_password = '對應用戶郵箱的密碼'; # 郵箱登錄密碼                         
$g_use_phpMailer = ON;   # 使用 PHPMailer 發送郵件                               
$g_phpMailer_path = '/usr/local/php/includes/PHPMailer/'; # PHPMailer 的存放路徑     
$g_phpMailer_method = 2;   # PHPMailer 以 SMTP
 
$g_show_version = OFF;                  # 不在頁面下部顯示 Mantis的版本號
$g_default_language = ’english’;              # 默認語言爲英語
$g_default_new_account_access_level = DEVELOPER; # 默認用戶級別
$g_use_jpgraph= ON;                             # 使用圖形報表
$g_jpgraph_path = ’/web/php/include/jpgraph/src/’;    # JPGraph路徑  
$g_window_title = ’Software Quality Manager’;     # 瀏覽器標題
$g_page_title   = ’ Software Quality Manager’;     # 頁面標題欄
 
#cd /var/www/mantis
#mysql -u mantis -p bugtracker<sql/db_generate.sql
//輸入數據庫密碼即可創建
編輯apache的httpd.conf
#vi /web/apache/conf/httpd.conf
//增加以下幾行
LoadModule php5_module        modules/libphp5.so
AddType application/x-httpd-php .php .phtml .php3 .inc
 
Alias /mantis/ "/var/www/mantis/"
<Directory “/var/www/mantis/”>
Options Indexes MultiViews Includes FollowSymLinks +ExecCGI
AllowOverride None
Order allow, deny
Allow from all
</Directory>
 
找到DirectoryIndex index.html index.html.var,將其改爲
DirectoryIndex index.html index.html.var index.php
 
# /web/apache/bin/apachectl –k restart
 
通過瀏覽器訪問:http://www.yourdomain.com/mantis/
如果出現登錄頁面,則一切Ok!
升級數據庫
點擊“Upgrade your installation”,升級其中的“Basic upgrade set (required)”和“String escaping fixes (recommended)”。
然後,
#mysql –u mantis –p bugtracker<sql/db_update.sql
並初始化數據庫
#mysql –u mantis –p bugtracker<sql/db_insert_data.sql
 
Mantis目錄下有一個admin目錄,如果你在IE中打開這個目錄下的index.php查看,你就會知道這個目錄是進行Mantis Administration的,使用這個模塊可以檢查你的Mantis是否安裝完全,對舊版本的Mantis進行升級,對Mantis的頁面CSS文件進行修改;使用這個管理模塊是不需要用戶名和密碼的,因此任何人都可以通過這個管理模塊查看你的Mantis系統信息,而且由於有升級模塊,在這裏還可以直接對數據庫進行修改;因此,在配置完成後將這個admin目錄刪除。
在添加一個管理員用戶後,刪除系統默認的administrator用戶。
3 CVS集成配置
如果需要建立Mantis 和 CVS集成,需要將Mantis與CVS服務安裝在同一臺服務器上。
CVSWEB就是CVS的WEB界面,可以大大提高程序員定位修改的效率。
解包
tar -zxvf  CVSWeb3.0.0.tar.gz
 
把配置文件cvsweb.conf複製到apache的配置目錄下
cp cvsweb.conf /path/to/apache/conf
轉到/path/to/apache/conf下並修改cvsweb.conf:
修改CVSROOT路徑設置:
%CVSROOT = (
'Development' => '/path/to/cvsroot/dev', #<==修改指向本地的CVSROOT
'test' => '/path/to/cvsroot/test', #<==修改指向本地的CVSROOT
);
如果有多個cvsroot,這定缺省的cvsroot
$cvstreedefault = 'test';
 
其它個性化設置
cvsweb.conf還有許多其它個性化設置,常見的有這些變量:
$logo 圖標設置
$defaulttitle 標題設施
$address 管理員email地址設置
$long_intro 介紹文字
$short_instruction 說明文字
 
把文件cvsweb.cgi複製到apache的cgi目錄
cp cvsweb.cgi /path/to/apache/cgi-bin
轉到/path/to/apache/cgi-bin修改cvsweb.cgi
修改cvsweb.cgi讓CGI找到配置文件:
$config = $ENV{'CVSWEB_CONFIG'} || '/path/to/apache/conf/cvsweb.conf';
 
中文支持
讓cvsweb正確顯示中文,找到sub html_header($)函數,
然後在<html>和<title>之間插入一行,修改如下
<html>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>$title</title>
複製所有的gif,png文件到apache的icons目錄
 
增加訪問控制
CVSWEB可不能隨便開放給所有用戶,因此需要使用WEB用戶認證:
先生成 passwd:
/path/to/apache/bin/htpasswd -c cvsweb.passwd user
 
修改httpd.conf,增加
<Directory "/path/to/apache/cgi-bin/cvsweb/">
AuthName "CVS Authorization"
AuthType Basic
AuthUserFile /path/to/cvsweb.passwd
require valid-user
</Directory>
設置mantis配置文件config_inc.php
//添加下面一行
$g_cvs_web = 'http://192.168.100.17/cgi-bin/cvsweb.cgi/';     #CVSWeb鏈接地址
$g_source_control_account’cvsuser’; #必須是mantis的有效帳戶;
在cvs倉庫的配置文件loginfo中添加一行:
DEFAULT /usr/local/bin/php /var/www/mantis/core/checkin.php %{,sVv} $USER
這樣,在提交cvs文件時,在log message中輸入包含有“issue #nnnn”的內容,就會將提交的版本信息,添加在該issue的note中。
添加下面內容:
       # --- Relationship Graphs -----------
       # Show issue relationships using graphs.
       #
       # In order to use this feature, you must first install either GraphViz
       # (all OSs except Windows) or WinGraphviz (only Windows).
       #
       # Graphviz homepage:    http://www.research.att.com/sw/tools/graphviz/
       # WinGraphviz homepage: http://home.so-net.net.tw/oodtsen/wingraphviz/
       #
       # Refer to the notes near the top of core/graphviz_api.php and
       # core/relationship_graph_api.php for more information.
 
       # Enable relationship graphs support.
       $g_relationship_graph_enable              = ON;
 
       # Font name and size, as required by Graphviz. If Graphviz fails to run
       # for you, you are probably using a font name that gd can't find. On
       # Linux, try the name of the font file without the extension.
       $g_relationship_graph_fontname          = 'Arial';
       $g_relationship_graph_fontsize            = 10;
 
       # Local path where the above font is found on your system for Relationship Graphs
       # You shouldn't care about this on Windows since there is only one system
       # folder where fonts are installed and Graphviz already knows where it
       # is. On Linux and other unices, the default font search path is defined
       # during Graphviz compilation. If you are using a pre-compiled Graphviz
       # package provided by your distribution, probably the font search path was
       # already configured by the packager.
       #
       # If for any reason, the font file you want to use is not in any directory
       # listed on the default font search path list, you can either: (1) export
       # the DOTFONTPATH environment variable in your webserver startup script
       # or (2) use this config option conveniently available here. If you need
       # to list more than one directory, use colons to separate them.
 
       # Since 0.19.3 we use the $g_system_font_folder variable to define the font folder
 
       # Default dependency orientation. If you have issues with lots of childs
       # or parents, leave as 'horizontal', otherwise, if you have lots of
       # "chained" issue dependencies, change to 'vertical'.
       $g_relationship_graph_orientation = 'horizontal';
 
       # Max depth for relation graphs. This only affects relation graphs,
       # dependency graphs are drawn to the full depth. A value of 3 is already
       # enough to show issues really unrelated to the one you are currently
       # viewing.
       $g_relationship_graph_max_depth              = 10;
 
       # If set to ON, clicking on an issue on the relationship graph will open
       # the bug view page for that issue, otherwise, will navigate to the
       # relationship graph for that issue.
       $g_relationship_graph_view_on_click = OFF;
 
       # Complete path to dot and neato tools. Your webserver must have execute
       # permission to these programs in order to generate relationship graphs.
       # NOTE: These are meaningless under Windows! Just ignore them!
       $g_dot_tool                                              = '/usr/bin/dot';
       $g_neato_tool                                    = '/usr/bin/neato';
 
# rpm –ivh graphviz-2.4-1.rh73.i386.rpm
# rpm –ivh graphviz-devel-2.4-1.rh73.i386.rpm
# rpm –ivh graphviz-doc-2.4-1.rh73.i386.rpm
# rpm –ivh graphviz-graphs-2.4-1.rh73.i386.rpm
# rpm –ivh graphviz-tcl-2.4-1.rh73.i386.rpm
 
發佈了25 篇原創文章 · 獲贊 2 · 訪問量 7萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章