Bug Managment

Bug Management Introduction

Mantis

mysql installation

install with source

download mysql-5.0.51b.tar.gz source from mysql home page

./configure --prefix=/usr/local \
           --localstatedir=/usr/local/mysql/data
make install

install with compiled binary

download binary from mysql homepage

[http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-5.0.51a-linux-i686-icc-glibc23.tar.gz/from/http://mirror.mysql-partners-jp.biz/]

#download from official site

rpm -Uvh MySQL-server-5.5.24-1.linux2.6.x86_64.rpm
Preparing...                ########################################### [100%]
   1:MySQL-server           ########################################### [100%]

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h td-hcom01 password 'new-password'

Alternatively you can run:
/usr/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

Please report any problems with the /usr/bin/mysqlbug script!

Notes regarding SELinux on this platform:
=========================================

The default policy might cause server startup to fail because it is
not allowed to access critical files.  In this case, please update
your installation.

The default policy might also cause inavailability of SSL related
features because the server is not allowed to access /dev/random
and /dev/urandom. If this is a problem, please do the following:

  1) install selinux-policy-targeted-sources from your OS vendor
  2) add the following two lines to /etc/selinux/targeted/src/policy/domains/program/mysqld.te:
       allow mysqld_t random_device_t:chr_file read;
       allow mysqld_t urandom_device_t:chr_file read;
  3) cd to /etc/selinux/targeted/src/policy and issue the following command:
       make load

[root@td-hcom01 altspkgs]# rpm -Uvh MySQL-client-5.5.24-1.linux2.6.x86_64.rpm
Preparing...                ########################################### [100%]
   1:MySQL-client           ########################################### [100%]
Preparing...                ########################################### [100%]
   1:MySQL-devel            ########################################### [100%]
[root@td-hcom01 altspkgs]# rpm -Uvh MySQL-shared-5.5.24-1.linux2.6.x86_64.rpm
Preparing...                ########################################### [100%]
   1:MySQL-shared           ########################################### [100%]
[root@td-hcom01 altspkgs]# rpm -Uvh MySQL-test-5.5.24-1.linux2.6.x86_64.rpm
Preparing...                ########################################### [100%]
   1:MySQL-test             ########################################### [100%]
[root@td-hcom01 altspkgs]# rpm -Uvh MySQL-embedded-5.5.24-1.linux2.6.x86_64.rpm
Preparing...                ########################################### [100%]
   1:MySQL-embedded         ########################################### [100%]
extract and setup
    shell> groupadd mysql
    shell> useradd -g mysql mysql
    shell> cd /usr/local
    shell> gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf -
    shell> ln -s full-path-to-mysql-VERSION-OS mysql
    shell> cd mysql
    shell> scripts/mysql_install_db --user=mysql
    shell> chown -R root  .
    shell> chown -R mysql data
    shell> chgrp -R mysql .
start the server
    shell> bin/mysqld_safe --user=mysql &
test
    shell> bin/mysqladmin version
    shell> bin/mysqladmin variables
    bin/mysqlshow
shutdown
    bin/mysqladmin -u root shutdown
set root password
    shell> mysql -u root
    mysql> SET PASSWORD FOR ''@'localhost' = PASSWORD('the password');
    mysql> SET PASSWORD FOR ''@'host_name' = PASSWORD('the password');

apache installation

download tag.gz

./configure
make install

php installation

download source package php-5.2.3.tar.gz

[http://downloads.php.net/ilia/]

install with both oracle and mysql support

   ./configure \
      --with-oci8-instant-client \
      --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs \
      --with-config-file-path=/usr/local/apache/conf \
      --with-oci8=$ORACLE_HOME \
      --with-mysql=/usr/local/mysql \
      --with-zlib-dir=/usr
make install

ps. make sure apache startup user can access oracle
(add the user to oracle group and setup the variables)

configure with apache

configure php.ini
configure apache

AddType application/x-httpd-php        .php
AddType application/x-httpd-php-source .phps

LoadModule php5_module        modules/libphp5.so

<VirtualHost *:1500>
ServerName <servername>
DocumentRoot "/var/httpd/htdocs/virtualhost"
</VirtualHost>

put a test page phpinfo.php on virtual host and test it

<?php phpinfo() ?>

http://localhost:1500/phpinfo.php

log
[root@td-hcom01 php-5.3.13]# make install
Installing PHP SAPI module:       apache2handler
/usr/local/apache2/build/instdso.sh SH_LIBTOOL='/usr/local/apache2/build/libtool' libphp5.la /usr/local/apache2/modules
/usr/local/apache2/build/libtool --mode=install cp libphp5.la /usr/local/apache2/modules/
cp .libs/libphp5.so /usr/local/apache2/modules/libphp5.so
cp .libs/libphp5.lai /usr/local/apache2/modules/libphp5.la
libtool: install: warning: remember to run `libtool --finish /u01/oracle/altspkgs/php-5.3.13/libs'
chmod 755 /usr/local/apache2/modules/libphp5.so
[activating module `php5' in /usr/local/apache2/conf/httpd.conf]
Installing PHP CLI binary:        /usr/local/bin/
Installing PHP CLI man page:      /usr/local/man/man1/
Installing shared extensions:     /usr/local/lib/php/extensions/no-debug-non-zts-20090626/
Installing build environment:     /usr/local/lib/php/build/
Installing header files:          /usr/local/include/php/
Installing helper programs:       /usr/local/bin/
  program: phpize
  program: php-config
Installing man pages:             /usr/local/man/man1/
  page: phpize.1
  page: php-config.1
Installing PEAR environment:      /usr/local/lib/php/
[PEAR] Archive_Tar    - already installed: 1.3.7
[PEAR] Console_Getopt - already installed: 1.3.0
[PEAR] Structures_Graph- already installed: 1.0.4
[PEAR] XML_Util       - already installed: 1.2.1
[PEAR] PEAR           - already installed: 1.9.4
Wrote PEAR system config file at: /usr/local/etc/pear.conf
You may want to add: /usr/local/lib/php to your php.ini include_path
/u01/oracle/altspkgs/php-5.3.13/build/shtool install -c ext/phar/phar.phar /usr/local/bin
ln -s -f /usr/local/bin/phar.phar /usr/local/bin/phar
Installing PDO headers:          /usr/local/include/php/ext/pdo/

Mantis installation

download mantis-1.2.0a1.tar.gz from mantis homepage

extract mantis-1.2.0a1.tar.gz

tar -zxvf mantis-1.2.0a1.tar.gz

alter mysql root password.

open browser
http://localhost/mantis-1.2.0a1/admin/index.php
http://localhost/mantis-1.2.0a1/admin/install.php

enter all the information.

OK. you can just open http://localhost/mantis-1.2.0a1/index.php and login with Administrator/root

Advanced configuration

open config_inc.php mantis home dir, you will found the following text.

<?php
        $g_hostname = false;
        $g_db_type = 'mysql';
        $g_database_name = 'mantis';
        $g_db_username = 'mantisuser';
        $g_db_password = 'mantispassword';
        $g_default_language= 'japanese';
?>

Bug and Problem

mantis based on php adodb and supports many databases including the best production database oracle and db2.
but I found they hadn't run test on oracle at all!

I resolved several problems and found several tables name are over 30 chars, so the system cannot run on oracle at all just for this small mistake! I hope mantis team fix the problem.

I did the following modification to make mantis installation support oracle.

#config_inc.php
<?php
        $g_hostname = false;
        $g_db_type = 'oci8';
        $g_database_name = 'orclptm';
        $g_db_username = 'mantis';
        $g_db_password = 'hikari';
        $g_default_language= 'japanese';
?>
 
#admin/install.php part 1
<?php
 
        $t_config_filename = $g_absolute_path . 'config_inc.php';
        $t_config_exists = file_exists ( $t_config_filename );
        $f_hostname = null; $f_db_type = null; $f_database_name = null; $f_db_username = null; $f_db_password = null;
        if ( $t_config_exists ) {
                if ( 0 == $t_install_state ) {
                        print_test("Config File Exists - Upgrade", true);
                }
                #config already exists - probably an upgrade
 
                $f_dsn = config_get( 'dsn', '' );
                # 2008/06/17 f.yang
                $f_hostname = config_get( 'hostname', false );
                # the original line: $f_hostname = config_get( 'hostname', '' );
                $f_db_type = config_get( 'db_type', '' );
                $f_database_name = config_get( 'database_name', '');
                $f_db_username = config_get( 'db_username', '' );
                $f_db_password = config_get( 'db_password', '' );
 
#admin/install.php part 2
<!-- connect to db -->
<tr>
        <td bgcolor="#ffffff">
                Attempting to connect to database as admin
        </td>
        <?php
        $t_db_open = false;
                $g_db = ADONewConnection($f_db_type);
                # 2008/06/17 f.yang
                if ($f_db_type == 'oci8') {
                        $t_result = @$g_db->Connect($f_hostname, $f_admin_username, $f_admin_password, $f_database_name);
                } else {
                        $t_result = @$g_db->Connect($f_hostname, $f_admin_username, $f_admin_password);
                }
 
                if ( $t_result ) {
                        # check if db exists for the admin
                        $t_result = @$g_db->Connect($f_hostname, $f_admin_username, $f_admin_password, $f_database_name);
                        if ( $t_result ) {
                        $t_db_open = true;
                                $f_db_exists = true;
                        }