Mantis平台WINDOWS配置手冊 (http://www.mantisbt.org/)
一、需要下載的軟體
下載 xampp-win32-1.6.1.exe(windows) 整合了PHP、Apache、MySql,滿足了Mantis平台對PHP平台、伺服器、資料庫的需求。
mantis-1.1.0a4.tar.gz
二、xampp-win32-1.6.1.exe軟體安裝 這裡就不說了。
解壓 mantis-1.1.0a4.tar.gz 安裝檔案中
執行admin/install.php
暢通無阻。
三、Mantis平台漢化:
修改mantis目錄下面的 config_defaults_inc.php 檔案中 $g_default_language = 'english'; 〉$g_default_language = 'chinese_simplified_utf8';
config_inc.php 中加入 $g_default_language = 'chinese_simplified_utf8';
漢化ok。
這個軟體有多種語言選擇的,你可以選擇中文版的。MyAccount-->Preferences-->Language.
1.中文編碼集
TO:解決瀏覽器訪問Mantis時中文字型亂碼問題
修改Mantis中的預設設定檔config_defaults_inc.php,找到如下內容,對照修改.
如果把以下內容拷到config_inc.php中也可以.
設定檔載入順序:先載入config_defaults_inc.php,後載入config_inc.php。
config_inc.php中的值會覆蓋config_defaults_inc.php.
################################
# Mantis Language Settings
################################
# --- language settings -----------
# If the language is set to 'auto', the actual
# language is determined by the user agent (web browser)
# language preference.
$g_default_language = 'chinese_simplified_gb2312';
# list the choices that the users are allowed to choose
$g_language_choices_arr = array(
'auto',
'bulgarian',
'catalan',
'chinese_simplified_gb2312',
'chinese_traditional',
'croatian',
'czech',
'danish',
'dutch',
'english',
'estonian',
'finnish',
'french',
'german',
'hebrew',
'hungarian',
'icelandic',
'italian',
'japanese',
'korean',
'latvian',
'lithuanian',
'norwegian',
'polish',
'portuguese_brazil',
'portuguese_standard',
'romanian',
'russian',
'serbian',
'slovak',
'slovene',
'spanish',
'swedish',
'turkish',
'ukrainian'
);
# Browser language mapping for 'auto' language selection
$g_language_auto_map = array(
'bg' => 'bulgarian',
'ca' => 'catalan',
'zh-cn, zh-sg, zh' => 'chinese_simplified_gb2312',
'zh-hk, zh-tw' => 'chinese_traditional',
'cs' => 'czech',
'da' => 'danish',
'nl-be, nl' => 'dutch',
'en-us, en-gb, en-au, en' => 'english',
'et' => 'estonian',
'fi' => 'finnish',
'fr-ca, fr-be, fr-ch, fr' => 'french',
'de-de, de-at, de-ch, de' => 'german',
'he' => 'hebrew',
'hu' => 'hungarian',
'hr' => 'croatian',
'is' => 'icelandic',
'it-ch, it' => 'italian',
'ja' => 'japanese',
'ko' => 'korean',
'lt' => 'lithuanian',
'lv' => 'latvian',
'no' => 'norwegian',
'pl' => 'polish',
'pt-br' => 'portugese_brazil',
'pt' => 'portugese_standard',
'ro-mo, ro' => 'romanian',
'ru-mo, ru-ru, ru-ua, ru' => 'russian',
'sr' => 'serbian',
'sk' => 'slovak',
'sl' => 'slovene',
'es-mx, es-co, es-ar, es-cl, es-pr, es' => 'spanish',
'sv-fi, sv' => 'swedish',
'tr' => 'turkish',
'uk' => 'ukrainian'
);
# Fallback for automatic language selection
$g_fallback_language = 'english';
2.郵件配置
TO:解決郵件發送問題
以下內容可以在config_defaults_inc.php中找到。
建議把該內容拷到config_inc.php中.
#############################
# Mantis Email Settings
#############################
# --- email variables -------------
$g_administrator_email = 'testsrv@xxx.com';
$g_webmaster_email = 'testsrv@xxx.com';
# the 'From: ' field in emails
$g_from_email = 'testsrv@xxx.com';
# the return address for bounced mail
$g_return_path_email = 'testsrv@xxx.com';
# allow email notification
# note that if this is disabled, sign-up and password reset messages will
# not be sent.
$g_enable_email_notification = ON;
# select the method to mail by:
# 0 - mail()
# 1 - sendmail
# 2 - SMTP
$g_phpMailer_method = 2;
# This option allows you to use a remote SMTP host. Must use the phpMailer scrīpt
# Name of smtp host, needed for phpMailer, taken from php.ini
$g_smtp_host = 'mail.xxx.com';
# These options allow you to use SMTP Authentication when you use a remote
# SMTP host with phpMailer. If smtp_username is not '' then the username
# and password will be used when logging in to the SMTP server.
$g_smtp_username = 'testsrv';
$g_smtp_password = 'testsrv';
郵件系統的配置建議用smtp方式。一般公司都有自己的郵件伺服器,讓管理員給你開一個mantis的專用信箱。
另:本人配置mantis郵件服務時,也出現過郵件發送成功但收不到的情況,後來讓公司管理員協助,從郵件伺服器的後台日誌查到。原來是把testsrv@xxx.com寫成testesrv@xxx.com。
呵呵,要細心一點哦。
經驗之談。
3.圖形報表
TO:解決圖形報表中文字型輸出問題.
在mantis1.1中,現在稍微簡單一些,只要改個字型就可以。
開啟core/graph_api.php檔案,找到如下內容,並添加一行:
function graph_get_font() {
$t_font_map = array(
'simsun' => FF_SIMSUN,
'arial' => FF_ARIAL,
'verdana' => FF_VERDANA,
'courier' => FF_COURIER,
'comic' => FF_COMIC,
'times' => FF_TIMES,
'georgia' => FF_GEORGIA,
'trebuche' => FF_TREBUCHE,
'vera' => FF_VERA,
'veramono' => FF_VERAMONO,
'veraserif' => FF_VERASERIF );
$t_font = config_get( 'graph_font', '');
if ( isset( $t_font_map[$t_font] ) ) {
return $t_font_map[$t_font];
} else {
return FF_FONT1;
}
另外注意config_inc.php或config_defaults_inc.php中應該有以下配置內容:
############################
# Mantis JPGRAPH Addon
############################
# --- jpgraph settings --- #
# Initial Version from Duncan Lisset
#
# To use the Jpgraph addon you need the JPGRAPH package from
# http://www.aditus.nu/jpgraph/index.php
# You can place the package whereever you want, but you have
# to set the var in jpgraph.php eg.
# (DEFINE('DIR_BASE','/www/mantisbt/jpgraph/');)
$g_use_jpgraph = ON;
$g_jpgraph_path = 'D:/mantis-1.1.0a2/core/jpgraph/src' . DIRECTORY_SEPARATOR . '' . DIRECTORY_SEPARATOR; # dont forget the ending slash!
#注意:這裡需要指定src/jpgraph.php的路徑.頁面出錯時會有提示的.
# what truetype font will the graphs use. Allowed values are 'arial', 'verdana', 'courier', 'book', 'comic', 'times',
# 'georgia', 'trebuche', 'vera', 'veramono', or 'veraserif'. Refer to the jpgraph manual for details.
# NOTE: these fonts need to be installed in the TTF_DIR as specified to jpgraph
$g_graph_font = 'simsun';
# what width is used to scale the graphs.
$g_graph_window_width = 800;
# bar graph aspect ration (height / width)
$g_graph_bar_aspect = 0.9;
# how many graphs to put in each row in the advanced summary page
$g_graph_summary_graphs_per_row = 2;
$g_system_font_folder = 'c:/winnt/fonts/';
$g_font_per_captcha = 'simsun.ttf';
4.時區設定
TO:解決mantis頁面時間顯示問題,預設用的是GMT格林威治時間.與中國時間相差8小時.
在config_inc.php或config_defaults_inc.php中添加以下內容:
#時區設定
putenv("TZ=Asia/Shanghai");
另外網上也有人提到在php.ini中進行如下設定。(如果putenv函數不起作用的話,可以試下)
[Date]
; Defines the default timezone used by the date functions
date.timezone = Asia/shanghai
5.資料庫(Mysql)
版本:MySQL 5.0系列
很多人用phpMyAdmin對mysql進行資料管理。
建議大家用MySQL-Front,我用的是3.2版。
圖形化介面操作挺方便。
mantis中的資料來源串連配置還是比較簡單的,在config_inc.php中設定:
################################
# Mantis Database Settings
################################
# --- database variables ---------
# set these values to match your setup
# hostname should be either a hostname or connection string to supply to adodb.
# For example, if you would like to connect to a mysql server on the local machine,
# set hostname to 'localhost', and db_type to 'mysql'.
# If you need to supply a port to connect to, set hostname as 'localhost:3306'.
$g_hostname = 'localhost';
$g_db_username = 'mantis';
$g_db_password = 'mantis';
$g_database_name = 'mantis';
#這裡資料庫使用者名稱,密碼,和資料庫名稱,全都是用mantis.
#要在myssql中建立一個資料庫使用者mantis,注意給它足夠的許可權。
# Supported types: mysql for MySQL, mysqli for MySQL, pgsql for PostgreSQL, mssql for MS SQL Server, oci8 for Oracle.這裡支援的資料庫類型還真不少。
$g_db_type = 'mysql';
6.web伺服器(Apache Or IIS)
mantis目前常用的服務就是這兩種,這裡推薦用Apache.
Apache現在版本是2.2系列。配置主要是一個應用服務類別目錄的配置,
開啟apache/conf/httpd.conf,在檔案的最後添加以下內容:
Alias /mantis "D:/mantis-1.1.0a2/"
#這是服務訪問的虛擬路徑設定
<Directory "D:/mantis-1.1.0a2/">
Options Indexes
AllowOverride None
Order allow,deny
Allow from all
</Directory>
Apache連接埠修改:
#Listen 12.34.56.78:80
Listen 80
預設應用目錄修改:
DocumentRoot "D:/mantis-1.1.0a2"