Bonjour,
Voici comment installer MantisBT.
Installer les dépendances :
yum install -y httpd mariadb-server php php-mysqli php-mbstring php-curl php-json php-soap php-ldap mod_ssl
systemctl enable --now httpd php-fpm mariadb
Pour l'envoie de mail :
dnf install https://rpms.remirepo.net/enterprise/remi-release-8.rpm
yum install -y php-PHPMailer
Configurer MariaDB :
mysql_secure_installation
mysql -u root -p
CREATE DATABASE mantis;
CREATE USER 'mantis'@localhost IDENTIFIED BY 'my_password';
GRANT ALL PRIVILEGES ON mantis.* TO 'mantis'@localhost IDENTIFIED BY 'my_password';
FLUSH PRIVILEGES;
EXIT
Télécharger MantisBT :
wget https://sourceforge.net/projects/mantisbt/files/mantis-stable/2.25.4/mantisbt-2.25.4.tar.gz
Installer MantisBT :
tar -xvf mantisbt-*.tar.gz && rm -f mantisbt-*.tar.gz
mkdir -p /var/www /root/.ssl
mv mantisbt-* /var/www/mantis
chown -R apache: /var/www/mantis
Configurer PHP :
echo "cgi.fix_pathinfo=0" >> /etc/php.ini
Apache avec MantisBT :
rm -f /etc/httpd/conf.d/welcome.conf
nano /etc/httpd/conf.d/mantis.conf
<VirtualHost *:80>
ServerName mantis.my_domain.com
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
</VirtualHost>
<VirtualHost *:443>
ServerName mantis.my_domain.com
DocumentRoot "/var/www/mantis"
#AllowEncodedSlashes On
<Directory "/var/www/mantis">
Require all granted
AllowOverride all
</Directory>
SSLEngine on
SSLCertificateFile /root/.ssl/mantis.my_domain.com.crt
SSLCertificateKeyFile /root/.ssl/mantis.my_domain.com.key
ErrorLog "/var/log/httpd/mantis.my_domain.com-error_log"
CustomLog "/var/log/httpd/mantis.my_domain.com-access_log" common
</VirtualHost>
Configurer Mantis : (Optionnel)
nano /var/www/mantis/config/config_inc.php
<?php
$g_hostname = 'localhost';
$g_db_type = 'mysqli';
$g_database_name = 'mantis';
$g_db_username = 'mantis';
$g_db_password = 'password';
$g_default_timezone = 'UTC';
$g_crypto_master_salt = 'YOUR_KEY';
// # --- My Logo ---
$g_logo_image = 'images/my_log.png';
// # --- Anonymous Access / Signup ---
$g_allow_signup = OFF;
$g_allow_anonymous_login = OFF;
$g_anonymous_account = '';
$g_lost_password_feature = OFF;
// # --- LDAP Configuration ---
$g_login_method = LDAP;
$g_ldap_use_starttls = OFF;
$g_reauthentication = ON;
$g_reauthentication_expiry = 600;
$g_ldap_server = 'ldaps://my_dc.fr:636';
$g_ldap_root_dn = 'ou=Users,dc=my_dc,dc=fr';
$g_ldap_organization = '';
$g_ldap_protocol_version = 3;
$g_ldap_network_timeout = 60;
$g_ldap_follow_referrals = ON;
$g_ldap_bind_dn = 'cn=service_user,ou=App,dc=my_dc,dc=fr';
$g_ldap_bind_passwd = 'password';
$g_ldap_uid_field = 'sAMAccountName';
$g_ldap_email_field = 'mail';
$g_ldap_realname_field = 'cn';
$g_use_ldap_realname = ON;
$g_use_ldap_email = ON;
$g_allow_blank_email = ON;
// # --- Email Configuration ---
$g_phpMailer_method = PHPMAILER_METHOD_SMTP; # PHPMAILER_METHOD_MAIL or PHPMAILER_METHOD_SMTP, PHPMAILER_METHOD_SENDMAIL
$g_smtp_host = 'smtp.my_domain.com'; # used with PHPMAILER_METHOD_SMTP
$g_smtp_username = ''; # used with PHPMAILER_METHOD_SMTP
$g_smtp_password = ''; # used with PHPMAILER_METHOD_SMTP
$g_smtp_port = 25;
$g_administrator_email = 'admin@my_domain.com';
$g_webmaster_email = $g_administrator_email;
$g_from_name = 'Mantis Bug Tracker';
$g_from_email = 'noreply@my_domain.com'; # the "From: " field in emails
$g_return_path_email = 'noreply@my_domain.com'; # the return address for bounced mail
$g_email_receive_own = OFF;
$g_email_send_using_cronjob = OFF;
systemctl restart httpd php-fpm
Après votre installation vous pouvez supprimer le dossier admin.
rm -rf /var/www/mantis/admin
Ce connecter en MD5 avec administrator : (Bonus)
nano /var/www/mantis/core/authentication_api.php
Modifier
function auth_does_password_match( $p_user_id, $p_test_password ) {
$t_configured_login_method = config_get( 'login_method' );
Par
function auth_does_password_match( $p_user_id, $p_test_password ) {
$t_configured_login_method = config_get_global( 'login_method' );
if(user_get_field($p_user_id, "username") == "administrator"){
$t_password = user_get_field( $p_user_id, 'password' );
if(md5($p_test_password) == $t_password){
return true;
}
}
Pour aller plus loin sinon : https://github.com/liberodark/mantisbt
Voilà vous pouvez vous connecter sur votre application.