Mantis installation and configuration and use

Mantis installation and configuration and use

introduce

MantisBT (Mantis bug tracker) makes collaboration with team members and clients easy, fast and professional MantisBT is an open source issue tracker that strikes a delicate balance between simplicity and functionality. Users can get up and running in minutes and start managing their projects while collaborating effectively with their teammates and clients. Once you start using it, you'll never look back!

characteristic

E-mail notification

Keep your team and customers up to date with notifications about issue updates, resolutions, or comments.

Access control

Project role-based access control that puts users in control of your business.

Access control

Project role-based access control that puts users in control of your business.

Why use MantisHub?

Try it for free for 1 minute to get started.

Focus on your business instead of worrying about backups, upgrades and support.

Backed by an experienced team with extensive MantisBT experience, existing users are able to migrate their data.

Exclusive accessories such as MantisTouch

No long-term commitments - cancel anytime and take your data with you.

Try MantisBT now!

Evaluating MantisBT has never been easier. You can start with one or more of the demo options we offer, or go straight to the download page and get the latest release along with the administrator's guide to set it up on your own server.

installation steps

LAMP (Linux Apache MySql Php) environment preparation

1. Install Linux

CentOS 7.8

Two, install apache

Install apache-httpd:

yum install httpd -y  //安装httpd

systemctl start httpd  //启动httpd

systemctl enable httpd  //配置自启动

The default port of httpd is 80. If the server port 80 is occupied, you can change the port of httpd by modifying the /etc/httpd/conf/httpd.conf file.

vim /etc/httpd/conf/httpd.conf  
...
Listen 9900
...

Firewall open ports

## 防火墙设置
firewall-cmd --zone=public --add-port=80/tcp --permanent
## firewall-cmd --zone=public --add-port=9900/tcp --permanent
firewall-cmd --reload


firewall 命令说明:
–-zone #作用域
–-add-port=8081/tcp #添加端口,格式为:端口/通讯协议 --add-port=30060-30090/tcp
-–permanent #永久生效,没有此参数重启后失效
--reload #重启防火墙

restart service

// 启动httpd
systemctl start httpd

Note: Development port 80, or modified other ports

Visit http://ip:port , if the following page appears, the installation is successful

img

3. Install php

First check whether PHP is installed in the server environment. Mantis requires PHP version greater than 5.5, and PHP version 7.1 is selected for the demonstration environment.

1. Preparation

Install EPEL repo, otherwise an exception error will be reported when executing the second step: Failed dependencies: epel-release >= 7 is needed by webtatic-release-7-3.noarch.

yum -y install epel-release

2. By default, PHP 7 is not available in the CentOS repository, you need to install the Webtatic repository first.

rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

3. Install php7.1

yum install php71w php71w-cli php71w-mysqli php71w-mbstring -y

4. php -vConfirm whether the installation is successful

php -v
PHP 7.1.33 (cli) (built: Oct 26 2019 10:16:23) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies

4. Install MySQL

  • First get the mysql source
wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
  • Install the rpm package
rpm -ivh mysql-community-release-el7-5.noarch.rpm
  • install mysql
yum install mysql-community-server
  • start mysql
systemctl start mysqld //启动
systemctl restart mysqld  //重启
systemctl stop mysqld //停止
  • change mysql password
set password for 'root'@'localhost' =password('changeme');
  • Permission to open remote connections
grant all privileges on *.* to root@'%' identified by 'changeme' with grant option;
flush privileges;

Create database and user (bugtracker)

mysql -u root -p
create database bugtracker default character set utf8 collate utf8_general_ci;
create user 'buger'@'%' identified by 'changeme';
grant all on bugtracker.* to buger@'%';
grant all privileges on *.* to 'buger'@'192.168.111.139' identified by 'changeme' with grant option;
flush privileges;

View databases and tables

show databases;
select user,host from mysql.user;

mysql -u root -p

Enter password:

Create database bugtracker

mysql> create database bugtracker default character set utf8mb4 collate utf8mb4_general_ci;

User buger, password: changeme, authorization

mysql> grant all on bugtracker.* to ‘buger’@’%’ identified by ‘changeme’;

Refresh to take effect

mysql>flush privileges;

An error occurred

ERROR 1396 (HY000): Operation CREATE USER failed for 'buger'@'%'

Approach

drop user 'buger'@'%';
drop user 'mantis'@'%';
flush privileges;

Five, Mantis installation and configuration

Download the installation package from the official website: https://www.mantisbt.org/index.php

1. Download address: wget https://pilotfiber.dl.sourceforge.net/project/mantisbt/mantis-stable/2.24.2/mantisbt-2.24.2.zip

2. Unzip the installation package

unzip mantisbt-2.24.2.zip
// 将下载的包解压
tar xvf mantisbt-2.24.2.tar.gz

3. Deploy mantis

Two ways to deploy

## 一种是将解压包移动至 apache 站点目录
mv /opt/mantisbt-2.24.2 /var/www/html/bug

## 第二种是修改 apache 配置,将站点目录指向解压目录

## 使用以下命令更改mantis螳螂目录的所有权:
chown -R apache:apache /var/www/html/bug

Create an apache virtual host file for Mantis. (Note: If there are multiple sites can be created)

This can be done by creating a mantis.conf file in the /etc/httpd/conf.d/ directory:

Add the following lines:

sudo nano /etc/httpd/conf.d/mantis.conf

<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot "/var/www/html/mantis"
ServerName yourdomain.com
<Directory />
Options FollowSymLinks
AllowOverride All
<Directory "/var/www/html/mantis/">
Options MultiViews FollowSymlinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
TransferLog /var/log/httpd/mantis_access.log
ErrorLog /var/log/httpd/mantis_error.log
</VirtualHost>

Save and close the file, then restart the Apache web server with the following command.

4. Restart apache httpd

sudo systemctl restart httpd  

5. Browser access http://ip:port/mantis

The following page appears

[External link image transfer failed, the source site may have an anti-leeching mechanism, it is recommended to save the image and upload it directly (img-zViarC9S-1599828842278)(assets/image-20200905220929169.png)]

Checking Installation
Checking PHP version (your version is 7.1.33)	GOOD
Checking UTF-8 support	GOOD
Checking if safe mode is enabled for install script	GOOD
Checking there is no 'config_inc.php' file in 1.2.x location.	GOOD
Checking there is no 'custom_constants_inc.php' file in 1.2.x location.	GOOD
Checking there is no 'custom_strings_inc.php' file in 1.2.x location.	GOOD
Checking there is no 'custom_functions_inc.php' file in 1.2.x location.	GOOD
Checking there is no 'custom_relationships_inc.php' file in 1.2.x location.	GOOD
Checking there is no 'mc_config_defaults_inc.php' file in 1.2.x location.	GOOD
Checking there is no 'mc_config_inc.php' file in 1.2.x location.	GOOD

Enter Hostname, Username, Password, Database name, and click [Install/Upgrade Database] to initialize the database.

An error occurred: Does the administrative user have permission to access the database?

BAD
Does administrative user have access to the database? ( Can't connect to MySQL server on '192.168.111.136' (13) )

Solution https://www.cnblogs.com/wuling129/p/4692095.html

There was an error of "can't connect to MySQL server using '' (13), and it turned out that SELinux prevented httpd from accessing the external network. At first, I thought it was caused by iptables, but after closing it, I found that it still didn't work. reason:

getsebool -a | grep httpd
httpd_anon_write --> off
httpd_builtin_scripting --> on
httpd_can_check_spam --> off
httpd_can_connect_ftp --> off
httpd_can_connect_ldap --> off
httpd_can_connect_mythtv --> off
httpd_can_connect_zabbix --> off
httpd_can_network_connect --> off
httpd_can_network_connect_cobbler --> off
httpd_can_network_connect_db --> off    #重点在这里
httpd_can_network_memcache --> off
httpd_can_network_relay --> off
httpd_can_sendmail --> off
httpd_dbus_avahi --> off
httpd_dbus_sssd --> off
httpd_dontaudit_search_dirs --> off
httpd_enable_cgi --> on
httpd_enable_ftp_server --> off
httpd_enable_homedirs --> off
httpd_execmem --> off
httpd_graceful_shutdown --> on
httpd_manage_ipa --> off
httpd_mod_auth_ntlm_winbind --> off
httpd_mod_auth_pam --> off
httpd_read_user_content --> off
httpd_run_ipa --> off
httpd_run_preupgrade --> off
httpd_run_stickshift --> off
httpd_serve_cobbler_files --> off
httpd_setrlimit --> off
httpd_ssi_exec --> off
httpd_sys_script_anon_write --> off
httpd_tmp_exec --> off
httpd_tty_comm --> off
httpd_unified --> off
httpd_use_cifs --> off
httpd_use_fusefs --> off
httpd_use_gpg --> off
httpd_use_nfs --> off
httpd_use_openstack --> off
httpd_use_sasl --> off
httpd_verify_dns --> off

# systemctl stop httpd
# /usr/sbin/setsebool -P httpd_can_network_connect_db on
# systemctl restart httpd

Click [Install/Upgrade Database] again to initialize the database.

[External link image transfer failed, the source site may have an anti-leeching mechanism, it is recommended to save the image and upload it directly (img-17EHlxUj-1599828842280)(assets/image-20200906211312118.png)]

[External link image transfer failed, the source site may have an anti-leeching mechanism, it is recommended to save the image and upload it directly (img-Zhp4OWyI-1599828842282)(assets/image-20200906211325302.png)]

[External link image transfer failed, the source site may have an anti-leeching mechanism, it is recommended to save the image and upload it directly (img-4uVvQSds-1599828842284)(assets/image-20200906211335170.png)]

[External link picture transfer failed, the source site may have an anti-theft link mechanism, it is recommended to save the picture and upload it directly (img-jmrHo6sS-1599828842286)(assets/image-20200906211345869.png)]

[External link picture transfer failed, the source site may have an anti-theft link mechanism, it is recommended to save the picture and upload it directly (img-ZbWWoOGc-1599828842289)(assets/image-20200906211357185.png)]

The database table has been successfully created, with a total of 31 tables, the data has been initialized, and then follow the prompts for subsequent installation

Write Configuration File(s)
Creating Configuration File (config/config_inc.php)
POSSIBLE PROBLEM
cannot write /var/www/html/bug/config/config_inc.php
Please add the following lines to '/var/www/html/bug/config/config_inc.php' before continuing:
<?php
$g_hostname               = '192.168.111.136:3306';
$g_db_type                = 'mysqli';
$g_database_name          = 'bugtracker';
$g_db_username            = 'buger';
$g_db_password            = 'changeme';

$g_default_timezone       = 'UTC';

$g_crypto_master_salt     = 'U0eP+fcHO+oEiYegxgEZqyubbqJXr4bFcJXs54tTFkU=';

If the initialization does not generate a configuration file, you need to manually add the configuration file, add according to the provided configuration example:

cd /var/www/html/mantis/config/
cp config_inc.php.sample config_inc.php
vim config_inc.php

Modify the configuration file, mainly the database connection configuration, and the mail can be configured later

vim config_inc.php

<?php
# MantisBT - A PHP based bugtracking system

# MantisBT is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# MantisBT is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with MantisBT.  If not, see <http://www.gnu.org/licenses/>.

/**
 * @package MantisBT
 * @copyright Copyright (C) 2000 - 2002  Kenzaburo Ito - [email protected]
 * @copyright Copyright (C) 2002 MantisBT Team - [email protected]
 * @link http://www.mantisbt.org
 */

# This sample file contains the essential files that you MUST
# configure to your specific settings.  You may override settings
# from config_defaults_inc.php by uncommenting the config option
# and setting its value in this file.

# Rename this file to config_inc.php after configuration.

# In general the value OFF means the feature is disabled and ON means the
# feature is enabled.  Any other cases will have an explanation.

# Look in http://www.mantisbt.org/docs/ or config_defaults_inc.php for more
# detailed comments.

# --- Database Configuration ---
$g_hostname      = '192.168.111.136:3306';
$g_db_username   = 'buger';
$g_db_password   = 'changeme';
$g_database_name = 'bugtracker';
$g_db_type       = 'mysqli';

# --- Security ---
$g_crypto_master_salt = 'U0eP+fcHO+oEiYegxgEZqyubbqJXr4bFcJXs54tTFkU='; #  Random string of at least 16 chars, unique to the installation

# --- Anonymous Access / Signup ---
$g_allow_signup                         = ON;
$g_allow_anonymous_login        = OFF;
$g_anonymous_account            = '';

# Look in http://www.mantisbt.org/docs/ or config_defaults_inc.php for more
# detailed comments.

# --- Database Configuration ---
$g_hostname      = '192.168.111.136:3306';
$g_db_username   = 'buger';
$g_db_password   = 'changeme';
$g_database_name = 'bugtracker';
$g_db_type       = 'mysqli';

# --- Security ---
$g_crypto_master_salt = 'U0eP+fcHO+oEiYegxgEZqyubbqJXr4bFcJXs54tTFkU='; #  Random string of at least 16 chars, unique to the installation

# --- Anonymous Access / Signup ---
$g_allow_signup                         = ON;
$g_allow_anonymous_login        = OFF;
$g_anonymous_account            = '';

# --- Email Configuration ---
$g_phpMailer_method             = PHPMAILER_METHOD_MAIL; # or PHPMAILER_METHOD_SMTP, PHPMAILER_METHOD_SENDMAIL
$g_smtp_host                    = 'localhost';                  # used with PHPMAILER_METHOD_SMTP
$g_smtp_username                = '';                                   # used with PHPMAILER_METHOD_SMTP
$g_smtp_password                = '';                                   # used with PHPMAILER_METHOD_SMTP
$g_webmaster_email      = '[email protected]';
$g_from_email           = '[email protected]';        # the "From: " field in emails
$g_return_path_email    = '[email protected]';  # the return address for bounced mail
# $g_from_name                  = 'Mantis Bug Tracker';
# $g_email_receive_own  = OFF;
# $g_email_send_using_cronjob = OFF;

# --- Attachments / File Uploads ---
$g_allow_file_upload    = ON;
$g_file_upload_method   = DISK; # DATABASE or DISK
$g_absolute_path_default_upload_folder = '/var/www/html/bug/repos/'; # used with DISK, must contain trailing \ or /.
$g_max_file_size                = 5000000;      # in bytes
$g_preview_attachments_inline_max_size = 256 * 1024;
# $g_allowed_files              = '';           # extensions comma separated, e.g. 'php,html,java,exe,pl'
# $g_disallowed_files           = '';           # extensions comma separated

# --- Branding ---
$g_window_title                 = 'MantisBT';
# $g_logo_image                 = 'images/mantis_logo.png';
# $g_favicon_image              = 'images/favicon.ico';

# --- Real names ---
# $g_show_realname = OFF;
# $g_show_user_realname_threshold = NOBODY;     # Set to access level (e.g. VIEWER, REPORTER, DEVELOPER, MANAGER, etc)

# --- Others ---
# $g_default_home_page = 'my_view_page.php';    # Set to name of page to go to after login
$g_default_language = 'chinese_simplified';

If I refresh the page, I get an error

APPLICATION ERROR #400

数据库连接失败。数据库返回的错误信息是:#0: PHP Support for database is not enabled

请使用浏览器的“返回”按钮来返回到上一页,这样您可以找到发生了什么问题或者进行别的操作;您也可以点击导航栏中的其它项。

或下面数据库提示错误
BAD
database is not supported by PHP. Check that it has been compiled into your server.

或下面配置错误
POSSIBLE PROBLEM Bad config_inc.php?

Solution:During the installation process, it was uninstalled before solving the database connection problem, and the database connection installation package was reinstalled

yum install -y php71w-mysqli

Refresh the page, initialize the database, and after the table is built

If no error occurs, click the Back to Administrator button and you will enter the following page

[External link image transfer failed, the source site may have an anti-leeching mechanism, it is recommended to save the image and upload it directly (img-36tokmVw-1599828842290)(assets/image-20200906212953893.png)]

The default account is: administrator/root, after successful login

[External link image transfer failed, the source site may have an anti-leeching mechanism, it is recommended to save the image and upload it directly (img-4KpxP6kT-1599828842292)(assets/image-20200906213124057.png)]

  • For safety reasons, use to rm -rf admin/delete the admin directory under mantis.
  • Disable the default 'administrator' account or change its password.

ps: After creating a user, I found that I don’t know what the initial password is. To reset the password and send an email, you can modify it through the following settings:

// 在/var/www/html/mantis/config/config_inc.php文件中添加:
$g_enable_email_notification = OFF;
// 此时重置密码后密码为空
// 另外,在config_defaults_inc.php文件中修改:
$g_send_reset_password = OFF;
// 此时在新建用户页面会出现密码输入框,就可以自定义密码了

6. References

https://blog.csdn.net/wangpf2011/article/details/85302010

https://www.howtoing.com/how-to-install-mantis-bug-tracker-on-centos-7

https://www.jianshu.com/p/2f897cedd2e9

docker install

4KpxP6kT-1599828842292)]

  • For safety reasons, use to rm -rf admin/delete the admin directory under mantis.
  • Disable the default 'administrator' account or change its password.

ps: After creating a user, I found that I don’t know what the initial password is. To reset the password and send an email, you can modify it through the following settings:

// 在/var/www/html/mantis/config/config_inc.php文件中添加:
$g_enable_email_notification = OFF;
// 此时重置密码后密码为空
// 另外,在config_defaults_inc.php文件中修改:
$g_send_reset_password = OFF;
// 此时在新建用户页面会出现密码输入框,就可以自定义密码了

6. References

https://blog.csdn.net/wangpf2011/article/details/85302010

https://www.howtoing.com/how-to-install-mantis-bug-tracker-on-centos-7

https://www.jianshu.com/p/2f897cedd2e9

docker install

https://github.com/vimagick/dockerfiles/issues/75

Guess you like

Origin blog.csdn.net/pointdew/article/details/108541611