2013年9月6日 星期五

Install Mantis on Windows

Reference:
http://chiangchingchi.pixnet.net/blog/post/93063290-%E8%9E%B3%E8%9E%82-mantis-bug-tracker
http://www.mantisbt.org/wiki/doku.php/mantisbt:active_directory

Software required:
1. Windows 2003 with IIS (因為我的電腦太舊,裝 2008 會太慢)
2. Microsoft .Net Framework 4.0
3. MySQL
4. PHP 5 (我用Non Thread Safe)
5. Mantis



Installation:
1. Enable IIS
2. install .Net Framework 4.0
3. install MySQL
4. unzip PHP to c:\php
5. unzip Mantis to C:\Inetpub\wwwroot\mantisbt

新增 index.php 到 IIS default content page。

modify C:\php\php.ini
include_path = ".;C:\Inetpub\wwwroot"
extension_dir = c:\php\ext
extension=php_mysql.dll
extension=php_snmp.dll
extension=php_sockets.dll
date.timezone = "Asia/Taipei"

將 Internet Explorer Enhanced Security Configuration 移除。

新增環境變數
PATH = C:\php
PHPRC = C:\php

用指令修改 C:\WINDOWS\system32\inetsrv\fcgiext.ini
cscript %windir%\system32\inetsrv\fcgiconfig.js -add -section:"PHP" -extension:php -path:"C:\PHP\php-cgi.exe"

開 IE 連 http://localhost/mantisbt/admin/install.php,照指示就可完成安裝。
PS. 用 PHP 5.5.3 在 install.php 一直出現錯誤訊息,改用 PHP 5.4.8 才行。

modify C:\Inetpub\wwwroot\mantisbt\config_inc.php
<?php
     $g_hostname = 'localhost';
     $g_db_type = 'mysql';
     $g_database_name = 'mantisbt';
     $g_db_username = 'root';
     $g_db_password = 'password';  
     $g_default_language = 'auto';
     $g_default_home_page = 'main_page.php';
     $g_administrator_email = 'admin@example.com.tw';
     $g_webmaster_email = 'admin@example.com.tw';
     $g_from_email = 'mantis@example.com.tw';
     $g_from_name = 'mantis';
     $g_window_title    = 'Bug tracking Service System';
     $g_logo_image = 'images/logo.jpg';
     $g_page_title = 'Bug tracking Service System';
     $g_reauthentication    = OFF;
     $g_status_percentage_legend = ON;
     $g_default_bug_view_status = VS_PRIVATE;
     $g_default_bugnote_view_status = VS_PRIVATE;
     $g_file_upload_max_num = 2;
     $g_max_file_size = 10485760;
?>

copy logo.jpg to C:\Inetpub\wwwroot\mantisbt\images

modify C:\Inetpub\wwwroot\mantisbt\plugins\MantisGraph\MantisGraph.php
'font' => 'arialuni',

modify C:\Inetpub\wwwroot\mantisbt\plugins\MantisGraph\core\graph_api.php
$t_font = plugin_config_get( 'font', 'arialuni' );
$t_font = 'arialuni.ttf';

login http://localhost/mantisbt/
account: administrator
password: root

change administrator password
remove C:\Inetpub\wwwroot\mantisbt\admin

和 AD 整合認證
modify C:\php\php.ini
extension=php_ldap.dll 
(如果沒有這一行會有錯誤訊息 ERROR #1404. LDAP Extension Not Loaded.)
restart IIS admin service

modify C:\Inetpub\wwwroot\mantisbt\config_inc.php
      $g_login_method = LDAP;
      $g_ldap_server = 'ldap://yourservername:389';
      $g_ldap_root_dn = 'ou=your_organization_RDN,DC=your_organization_RDN,DC=your_organization_RDN'; # The root DN where to search users e.g. 'ou=people,dc=example,dc=com'
      $g_ldap_bind_dn = 'domain\LDAPadmin'; # A system account to login to AD
      $g_ldap_bind_passwd = 'password';
      $g_ldap_organization = 'domain';
      $g_use_ldap_email = ON;
      $g_ldap_protocol_version = 3;
      $g_ldap_uid_field= 'sAMAccountName';

2013/10/9 update:
mantis 發送 mail 的設定:
1. modify C:\Inetpub\wwwroot\mantisbt\config_defaults_inc.php
$g_smtp_host= 'mail.example.com.tw';
2. modify C:\php\php.ini
SMTP = mail.example.com.tw

2014/12/29 update:
upload file size 擴充修改

reference:
http://become.wei-ting.net/2011/09/mantis.html
http://phorum.study-area.org/index.php?topic=62350.0

沒有留言:

張貼留言