Debian下mysql5+php5+apache2+mantis服務器升級

 

Debian下mysql5+php5+apache2+mantis服務器升級
Ø         安裝所需軟件:apt-get install xxx
mysql
libdbd-mysql-perl                               install
libmysqlclient15off                             install
mysql-client-5.0                                install
mysql-common                                    install
mysql-server-5.0                                install
php5-mysql                                      install
 
php
php5                                            install
php5-common                                     install
php5-mysql                                      install
phpmyadmin                                      install
 
apache2
apache2                                         install
apache2-mpm-prefork                             install
apache2-utils                                   install
apache2.2-common                                install
libapache2-mod-php5                             install
 
Ø         到如下地址下載最新版MANTIS
tar -xzf mantis-1.1.2.tar.gz    將文件解壓到/var/www/
 
Ø         配置Mysql ,
/etc/mysql# vi my.cf
 
[client]
port            = 3306
socket          = /var/run/mysqld/mysqld.sock
default-character-set=utf8 #neo    解決中文顯示問題
 
#
# * Basic Settings
#
user            = mysql
pid-file        = /var/run/mysqld/mysqld.pid
socket          = /var/run/mysqld/mysqld.sock
port            = 3306
basedir         = /usr
datadir         = /var/lib/mysql
tmpdir          = /tmp
language        = /usr/share/mysql/english
skip-external-locking
character-set-server=utf8 #neo        解決中文顯示問題
collation-server=utf8_general_ci #neo 解決中文顯示問題
 
Ø         創建Mantis數據庫
/var/lib/mysql# mysql -u root
Mysql > create database bugtracker;
Mysql >exit
 
Ø         原Mantis服務器mysql數據導出:(mantis-0.91)
Mantis old#   舊的服務器
/var/lib/mysql# mysqldump -u root -x --databases bugtracker > xxxxx.sql
/var/lib/mysql# scp –r xxx.sql root@new_mantis_IPaddress:/var/lib/mysql/   將備份好的數據考進新的服務器
 
Ø         將備份好的數據導入新的數據庫;
Mantis new#
/var/lib/mysql# mysql –u root < xxxx.sql
 
Ø         安裝Mantis
http://server-ip/mantis/index.php
運行其中的
upgrade your installation
再運行
upgrade now
再運行
basic upgrade set(required)
再運行
Execute All
 
Ø         配置mantis郵件
# --- database variables ---------
 
        # set these values to match your setup
        $g_hostname      = "localhost";
        $g_db_username   = "root";
        $g_db_password   = "";
        $g_database_name = "bugtracker";
        $g_db_type       = "mysql";
 
        # --- email variables -------------
        $g_administrator_email = '[email protected]';
        $g_webmaster_email      = '[email protected]';
 
        # the "From: " field in emails
        $g_from_email           = '[email protected]';
 
        # the return address for bounced mail
        $g_return_path_email    = '[email protected]';
 
        # --- file upload settings --------
        # This is the master setting to disable *all* file uploading functionality
        #
        # The default value is ON but you must make sure file uploading is enabled
        # in PHP as well. You may need to add "file_uploads = TRUE" to your php.ini.
        $g_allow_file_upload    = ON;
        $g_file_upload_method   = DISK;   #附件存放到硬盤
?>
 
Ø         配置Mantis 附件存放位置
在config_inc.php中添加
 $g_allow_file_upload=ON;
 $g_file_upload_method=
DISK;
 
並且在mantis下面新建一個upload目錄
Mantis new# cd /var/www/mantis
Mantis new# mkdir upload
Mantis new# chomd –R 775 upload/
Mantis new# chown –R www-data.www-data upload
當你以管理員身份登錄,新建項目時,在上傳文件路徑那一項填上upload路徑即可,如果要爲每一個項目指定不同的目錄,可以先在upload下建一個projectname,在上傳文件路徑那一項填上upload\projectname
 注意最好不要用中文目錄名,目錄名中間也不要帶空格.
Ø         附件瀏覽功能
修改config_defaults_inc.php這個文件的如下地方:
############################
        # Bug Attachments Settings
        ############################
 
        # Specifies the maximum size below which an attachment is previewed in the bug
        # view pages. To disable this feature, set max size to 0.
        # This feature applies to: bmp, png, gif, jpg
        $g_preview_attachments_inline_max_size = 20000000;
 
Mantis服務器升級完成
 
mantis中增加參數值的方法

比如:問題狀態增加一個,< VERIFIED>
mantis根目錄下創建一個custom_contant_inc.php文件,在裏面加上如下語句;
manits:/var/www/mantis# vi custom_constant_inc.php
<?php
define ( 'VERIFIED', 60 );
?>
 
mantis根目錄下創建custom_strings_inc.php文件,裏面添加以下語句;
manits:/var/www/mantis# cat custom_strings_inc.php
<?php
$s_status_enum_string = '10:new,20:feedback,30:acknowledged,40:confirmed,50:assigned,60:to_be_verified,80:resolved,90:closed';
$s_to_be_verified_bug_button = "Change Issue";
$s_to_be_verified_bug_title = "Change Issue";
$s_email_notification_title_for_status_bug_to_be_verified ="The following issue is ready TO_BE_VERIFIED";
?>
 
修改你的config_inc.php, 用於適配自定義狀態,添加以下語句,爲了防止混亂,可添加至文件最後
manits:/var/www/mantis# vi config_inc.php
# new to be verified
        $g_status_enum_string = '10:new,20:feedback,30:acknowledged,40:confirmed,50:assigned,60:to_be_verified,80:resolved,90:closed';
        # Status color additions
        $g_status_colors['to_be_verified'] = '#ACE7AE';
 
        $g_status_enum_workflow[NEW_] = '20:feedback,30:acknowledged,40:confirmed,50:assigned,60:to_be_verified,80:resolved';
        $g_status_enum_workflow[FEEDBACK] = '10:new,30:acknowledged,40:confirmed,50:assigned,60:to_be_verified,80:resolved';
        $g_status_enum_workflow[ACKNOWLEDGED] = '20:feedback,40:confirmed,50:assigned,60:to_be_verified,80:resolved';
        $g_status_enum_workflow[CONFIRMED] = '20:feedback,50:assigned,60:to_be_verified,80:resolved';
        $g_status_enum_workflow[ASSIGNED] = '20:feedback,60:to_be_verified,80:resolved,90:closed';
        $g_status_enum_workflow[VERIFIED] = '10:new,20:feedback,50:assigned,80:resolved,90:closed';
        $g_status_enum_workflow[RESOLVED] = '50:assigned,90:closed';
        $g_status_enum_workflow[CLOSED] = '50:assigned';
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章