Bernie Yu » mantis http://bernieyu.com 复刻生活 Tue, 17 May 2016 09:03:15 +0000 zh-CN hourly 1 https://wordpress.org/?v=4.2.38 在群晖NAS上搭建MantisBT Bug跟踪系统 http://bernieyu.com/2015/07/install-mantis-bug-tracking-on-synology-nas/ http://bernieyu.com/2015/07/install-mantis-bug-tracking-on-synology-nas/#comments Fri, 10 Jul 2015 04:01:48 +0000 http://bernieyu.com/?p=256   >>阅读全文<<]]>
  • 启用WEB服务
    进入群晖的管理后台,打开控制页面,在里面打开WEB服务
    201506261549467
  • 安装MariaDB数据库,配置好root账户的密码
  • 安装MantisBT
    打开套件中心,找到MantisBT,进行安装。安装过程中要输入Mysql (MariaDB)的root账号和密码,安装过程中会自动创建MantisBT所需要的库表
    20150710110313
  • 配置MantisBT
    • 打开http://synology_address/mantisbt,默认用户名:adminstrator,初始密码:root
    • 现在数据库是用root登录的,为了数据库安全,在数据库里新建mantis用户,仅拥有对mantis库的权限。然后修改config_inc.php:
      $g_hostname = 'localhost';
      $g_db_type = 'mysql';
      $g_database_name = 'mantis';
      $g_db_username = 'mantis';
      $g_db_password = 'mantis';
      
    • 修改默认语言为简体中文:在config_inc.php中添加:
      $g_default_language= 'chinese_simplified';
    • mantis默认新用户都是要邮件激活的,因此还需要添加邮件支持。修改config_defaults_inc.php,把发信人修改为真正使用的发件邮箱地址(有些邮箱服务器会校验发件人地址和真实发件地址,不匹配有可能造成发信失败)
      $g_administrator_email	= 'mantis@host.com';
      $g_webmaster_email	= 'mantis@host.com';
      $g_from_email			= 'mantis@host.com';
      $g_return_path_email	= 'mantis@host.com';

      继续修改发件的smtp信息

      $g_phpMailer_method		= PHPMAILER_METHOD_SMTP;
      $g_smtp_host			= 'smtp.exmail.qq.com';
      $g_smtp_username = 'mantis@host.com';
      $g_smtp_password = 'password';
      $g_smtp_connection_mode = 'ssl';
      $g_smtp_port = 465;
    • 登录到mantis里,新建管理员用户。然后以新建用户登录后,就可以禁用administrator,以保证安全。
    • Tips:
      • 在library\phpmailer下是邮件发送组件,可以新建一个mailtest.php,然后在浏览器打开这个页面测试邮件发送是否正常:
        <?php
        /**
         * @author [pooy] <[pooy@pooy.net]>
         * @blog  http://www.pooy.net
         */
        require 'class.phpmailer.php';
         
        $mail = new PHPMailer;
        $mail->SMTPDebug = 1;
        $mail->IsSMTP();                                      // Set mailer to use SMTP
         
        $mail->Host = 'smtp.exmail.qq.com';  // Specify main and backup server
        $mail->SMTPAuth = true;                               // Enable SMTP authentication
        $mail->Username = 'mantis@host.com';                            // SMTP username
        $mail->Port = 465;
        $mail->Password = 'password';                           // SMTP password
        $mail->SMTPSecure = 'ssl';                            // Enable encryption, 'ssl' also accepted
        $mail->From = 'mantis@host.com';
         
        $mail->FromName = 'Mailer Testing';
        $mail->AddAddress('reciver@host.com');   
        $mail->WordWrap = 50;                                 // Set word wrap to 50 characters
        $mail->IsHTML(true);                                  // Set email format to HTML
         
        $mail->Subject = 'Here is the subject';
        $mail->Body    = 'This is the HTML message body <b>in bold!</b>';
        $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
         
        if(!$mail->Send()) {
           echo 'Message could not be sent.';
           echo 'Mailer Error: ' . $mail->ErrorInfo;
           exit;
        }
         
        echo 'Message has been sent';
        // To load the Chinese version
        $mail->SetLanguage('cn', '/path_to_mantisbt/library/phpmailer/language');
        ?>
      • 在scripts下的send_eamils.php,可以在控制台执行,测试在config_defaults_inc.php里的邮件配置是否能正常发送邮件
        php -q /path_to_mantisbt/scripts/send_emails.php
  • ]]>
    http://bernieyu.com/2015/07/install-mantis-bug-tracking-on-synology-nas/feed/ 0