How To Install A Fresh MantisBT – OpenSource Bug Tracker

Assumptions:

  1. You know how to setup your LAMP stack and any related Apache setups to run a website
  2. You know how to use phpMyAdmin or any other MySql query browser
  3. We are setting this up in a LOCAL environment and we are not bothering about any security or good practice scenarios

Step by Step Of How To Install A New Mantis Bug Tracking System

STEP 1) Download the latest copy from MantisBT’s Home pageclick here

STEP 2) Extract mantis to your LAMP’s www folder, we’ll assume you have set mantis to run under the local url “mantis.local” hereon..

STEP 3) Using phpMyAdmin, create a database. We’ll call it mantis
I will assume you have the following info handy and that you know how to set them up:

  • The hostname of your local server == localhost
  • The database name in which you plan to install your new mantis’ data/records == mantis (you can give it any name)
  • The username of the database mantis you created == root (this is the default username for any bundled LAMP stack like WAMP or XAMPP)
  • The password of the database mantis you created = [empty, it’s an empty string] (this is the default password for any bundled LAMP stack like WAMP or XAMPP is always a blank password)

Now lets briefly list how mantis’ code interprets each of the above mentioned terms:

In mantis jargon:

  • hostname is represented by the variable $g_hostname
  • database name is represented by the variable $g_database_name
  • database username is represented by the variable $g_db_username
  • database password is represented by the variable $g_db_password

Just keep this in mind, since we will refer to this in the famous PHP file config_inc.php somewhere below.. (Keep reading)

STEP 4) Browse http://mantis.local, you’ll be redirected to: http://mantis.local/admin/install.php

At this point, if your environment meets all the requirements, you should see a screen with GREEN colored squares saying GOOD (as shown below)

Installation

STEP 5) Now fill in all the data required, as shown below:

Enter Installation data

NOTES:
What is the difference between the Username and Admin Username as shown in the screenshot above?
=> Username is the actual username that has ‘privilege‘ specially on the database (mantis in our case)
=> Admin Username is the username which has ‘supreme privilege’ on the WHOLE MySql database. It is the one which was created FIRST and BEFORE any other username on that database. Mantis system asked us to provide it in case you have not yet created any database and ‘the‘ mantis system will need a username with high privilege on the MySQL to create a database for you..

So, technically Admin Username can create another instance of a username (Username) and also grant it supreme privileges just as itself..etc In my case, both the Admin Username and Username is the default root

STEP 6) Click Install button.. You should see most check in a big GREEN square. But for my example, I had TWO issues/warnings:

ISSUE 1:
For Setting Database Password, it says: POSSIBLE PROBLEM => database password is blank
CONCERNS: well, this one is FINE for our example since we are working locally

ISSUE 2:
Creating Configuration File (config_inc.php), it says: POSSIBLE PROBLEM => cannot write ~/www/sites/mantis/config_inc.php

The system also suggests us to:

(if this file is not created, create it manually with the contents below)
Please add the following lines to ~/www/sites/mantis/config_inc.php before continuing to the database upgrade check:

CONCERNS: BUT we will not do like this. We will do something better. If you browse your mantis root folder, you will find a file named as config_inc.php.sample
=> Rename that file to config_inc.php
=> Open config_inc.php and find the line # — Database Configuration —
=> Replace the values for that block of code with our values as mentioned above

Your full code should look something like the file below:


<?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 - kenito@300baud.org
* @copyright Copyright (C) 2002 - 2011  MantisBT Team - mantisbt-dev@lists.sourceforge.net
* @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 assigning new values 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 = 'localhost';
$g_db_type = 'mysql';
$g_database_name = 'mantis';
$g_db_username = 'root';
$g_db_password = '';

# --- 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_administrator_email  = 'administrator@example.com';
$g_webmaster_email      = 'webmaster@example.com';
$g_from_name			= 'Mantis Bug Tracker';
$g_from_email           = 'noreply@example.com';	# the "From: " field in emails
$g_return_path_email    = 'admin@example.com';	# the return address for bounced mail
$g_email_receive_own	= OFF;
$g_email_send_using_cronjob = OFF;

# --- Attachments / File Uploads ---
$g_allow_file_upload	= ON;
$g_file_upload_method	= DATABASE; # or DISK
$g_absolute_path_default_upload_folder = ''; # 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.gif';
$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

7) After everything is now setup fine, you can login. But what is the Default Login?
The default Login for a fresh mantis install is administrator / root as shown in the screenshot below:

default mantis login

NOTES:
As mentioned in red in the screenshot,
=> Make sure you delete or rename the admin folder in your mantis root folder
=> Change the administrator password, you can do this in your mantis My Account section as ease..

If You Appreciate What I Do Here On Seven PHP :: 7PHP, You Could Consider:

  1. Following me on Twitter | @7php
  2. LIKE-ing my FaceBook page
  3. Subscribe to my Email List - see top-right subscription box
  4. Help diffuse this interview to the PHP ecosystem - Share & Spread the word as far as you can ==> That would be a FREE way to thank me
  5. Use my DigitalOcean referral link if you plan to use it as your VPS (it starts at only $5/month btw) or if you can refer it to your friends, highly appreciated.
  6. Support via Paypal donate - my Paypal ID is w@7php.com

{I'm thankful to your response(s)!}

Valuable Feedback / Comment / Review From People Like You

  1. webdesigner says:

    pretty basic stuff but very well explained. keep on posting useful info!

    {Pay webdesigner a visit at: http://ftswebmedia.com}

  2. Hey there! Do you use Twitter? I’d like to follow you if that would be okay. I’m definitely enjoying
    your blog and look forward to new updates.

  3. my twitter handle is: @7php
    Thanks!

  4. Hi,
    I created a database called mantis using phpMyAdmin, and added a new user ‘mroot’ with password ‘mroot’. I am stuck at step 4 though. When I try going to localhost/mantis, it asks me for a username and password. I have tried the following combinations: administrator/root, root/{empty}, mroot/mroot. I have also edited the config_inc.php file under mantis with all these settings, but none of these passwords is working. What should I do?

  5. Hi Arvind,
    When you added a new user, did you also associate that user with your database mantis?

  6. Thanks Brother for such a easy and wonderful explaination…

Speak Your Mind

*