luobo2ni 发表于 2018-5-15 11:59:01

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
http://sourceforge.net/project/showfiles.php?group_id=14963&package_id=166159
tar -xzf mantis-1.1.2.tar.gz    将文件解压到/var/www/

Ø         配置Mysql ,
/etc/mysql# vi my.cf


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

&Oslash;         安装Mantis
http://server-ip/mantis/index.php
运行其中的
upgrade your installation
再运行
upgrade now
再运行
basic upgrade set(required)
再运行
Execute All

&Oslash;         配置mantis邮件
# --- database variables ---------

      # set these values to match your setup
      $g_hostname      = &quot;localhost&quot;;
      $g_db_username   = &quot;root&quot;;
      $g_db_password   = &quot;&quot;;
      $g_database_name = &quot;bugtracker&quot;;
      $g_db_type       = &quot;mysql&quot;;

      # --- email variables -------------
      $g_administrator_email = 'mis@xtera-ip.com.cn';
      $g_webmaster_email      = 'mis@xtera-ip.com.cn';

      # the &quot;From: &quot; field in emails
      $g_from_email         = 'mantis@xtera-ip.com.cn';

      # the return address for bounced mail
      $g_return_path_email    = 'mis@xtera-ip.com.cn';

      # --- 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 &quot;file_uploads = TRUE&quot; to your php.ini.
      $g_allow_file_upload    = ON;
      $g_file_upload_method   = DISK;   #附件存放到硬盘
?>

&Oslash;         配置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
注意最好不要用中文目录名,目录名中间也不要带空格.
&Oslash;         附件浏览功能
修改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 = &quot;Change Issue&quot;;
$s_to_be_verified_bug_title = &quot;Change Issue&quot;;
$s_email_notification_title_for_status_bug_to_be_verified =&quot;The following issue is ready TO_BE_VERIFIED&quot;;
?>

修改你的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 = '20:feedback,30:acknowledged,40:confirmed,50:assigned,60:to_be_verified,80:resolved';
      $g_status_enum_workflow = '10:new,30:acknowledged,40:confirmed,50:assigned,60:to_be_verified,80:resolved';
      $g_status_enum_workflow = '20:feedback,40:confirmed,50:assigned,60:to_be_verified,80:resolved';
      $g_status_enum_workflow = '20:feedback,50:assigned,60:to_be_verified,80:resolved';
      $g_status_enum_workflow = '20:feedback,60:to_be_verified,80:resolved,90:closed';
      $g_status_enum_workflow = '10:new,20:feedback,50:assigned,80:resolved,90:closed';
      $g_status_enum_workflow = '50:assigned,90:closed';
      $g_status_enum_workflow = '50:assigned';
页: [1]
查看完整版本: Debian下mysql5+php5+apache2+mantis服务器升级