xiaoou

Wednesday, July 15, 2009

Steps to install Bugzilla with Oracle on Windows (XP above) X86

Steps to install Bugzilla with Oracle on Windows (XP above) X86
Steps to install Bugzilla with Oracle on Windows (XP above) X86
1. Preparation
1) Oracle Database. You need Oracle version 10.02.0 or higher
2) ActivePerl-5.10.0.1005-MSWin32-x86-290470.msi (Recommanded)
3) Get Instant Client Package - Basic ( instantclient-basic-win32-11.1.0.7.0.zip)
4) Apache HTTP Server from http://httpd.apache.org/download.cgi
The latest will be fine.

2. Install Oracle Database(The Oracle Database can be on another server too), ActivePerl, Apache HTTP Server.

3. Add a User to Oracle.

login to Oracle as 'system' user, and run:
-- Create the user
create user BUGs
identified by "bugs"
default tablespace USERS
temporary tablespace TEMP
profile DEFAULT;
-- Grant/Revoke role privileges
grant connect to BUGs;
grant resource to BUGs;
-- Grant/Revoke system privileges
grant unlimited tablespace to BUGs;
grant execute on ctxsys.ctx_ddl to bugs;

5. unzip instantclient-basic-win32-11.1.0.7.0.zip and copy oci.dll and oraociei11.dll to c:\bugzilla

6. cd to c:\bugzilla, and run perl checksetup.pl

7. install the required packages:
ppm install TimeDate
ppm install Template-Toolkit
ppm install Email-Send
ppm install Email-MIME
ppm install Email-MIME-Modifier
ppm install Chart
ppm install Template-GD
ppm install XML-Twig
ppm install MIME-tools
ppm install PatchReader
ppm install PerlMagick
ppm install perl-ldap
ppm install Authen-SASL
ppm install RadiusPerl
ppm install SOAP-Lite
ppm install HTML-Scrubber
ppm install Email-MIME-Attachment-Stripper
ppm install Email-Reply

8. run perl checksetup.pl again to generate localconfig

9. edit localconfig like this and save:
# What SQL database to use. Default is mysql. List of supported databases
# can be obtained by listing Bugzilla/DB directory - every module corresponds
# to one supported database and the name corresponds to a driver name.
$db_driver = 'oracle';
# The DNS name of the host that the database server runs on.
$db_host = '139.185.51.53';
# The name of the database
# The SID name
$db_name = 'orcl';
# Who we connect to the database as.
$db_user = 'bugs';
# Enter your database password here. It's normally advisable to specify
# a password for your bugzilla database user.
# If you use apostrophe (') or a backslash (\) in your password, you'll
# need to escape it by preceding it with a '\' character. (\') or (\)
# (Far simpler just not to use those characters.)
$db_pass = 'bugs';

10. run perl checksetup.pl again to install bugzilla.

12. save the following text as perl.reg, and double click to import it:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\.cgi\Shell\ExecCGI\Command]
@="C:\\Perl\\bin\\perl.exe -T"

13. Restart Apache HTTP Server, and the installation is done.

Sunday, November 30, 2008

An Example To Setup Bugzilla 3.2 with Oracle

An Example To Setup Bugzilla 3.2 with Oracle
The following Example shows you how to install Bugzilla with Oracle on Linux. For details, see the Bugzilla Installation Guide.

Preparation

Software requirement:

Perl 5.81 or above
Oracle v10.02.0 or above
Apache(httpd),sendmail etc.


Oracle Configuration

You need Oracle v10.02.0 or above,either Enterprise or XE edition,depending on the real need.

Create Tablespace(Optional):

Login sqlplus as sys or system, and execute:

CREATE TABLESPACE bugs
DATAFILE '/u01/oradata/bugzilla.dbf' SIZE 500M
AUTOEXTEND ON NEXT 30M MAXSIZE UNLIMITED;


Create Database User For Bugzilla:

Login sqlplus as sys or system, and execute(username: bugs, password: bugs):
CREATE USER bugs
IDENTIFIED BY "bugs"
DEFAULT TABLESPACE bugs
TEMPORARY TABLESPACE TEMP
PROFILE DEFAULT;
-- GRANT/REVOKE ROLE PRIVILEGES
GRANT CONNECT TO bugs;
GRANT RESOURCE TO bugs;
-- GRANT/REVOKE SYSTEM PRIVILEGES
GRANT UNLIMITED TABLESPACE TO bugs;
GRANT EXECUTE ON CTXSYS.CTX_DDL TO bugs;

Apache Configuration for Oracle

Config ORACLE_HOME and LD_LIBRARY_PATH, like:
vi /etc/httpd/conf.d/bugzilla.conf
Enter below and save:
# Set ORACLE_HOME and LD_LIBRARY_PATH
SetEnv ORACLE_HOME /usr/lib/oracle/xe/app/oracle/product/10.2.0/server
SetEnv LD_LIBRARY_PATH /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/lib


Install Bugzilla 3.2

Download and untar
Download Bugzilla3.2

cd /var/www/html/
wget http://ftp.mozilla.org/pub/mozilla.org/webtools/bugzilla-3.2.tar.gz
tar zxvf bugzilla-3.2.tar.gz
mv bugzilla-3.2 bugzilla


checksetup.pl

Then run checksetup.pl cd bugzilla
./checksetup.pl

Install all the perl modules needed, before that you need to install perl-CPAN if you don't have it:
yum install perl-CPAN

The simplest way to install all the modules on Linux is to run:
/usr/bin/perl install-module.pl --all

You can leave all things to default

Install DBD::Oracle

export ORACLE_HOME="/usr/lib/oracle/xe/app/oracle/product/10.2.0/server"
export LD_LIBRARY_PATH="/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/lib"
/usr/bin/perl install-module.pl DBD::Oracle


Note: If the Oracle Database is on a remote server,you need to install Oracle Instant Client or Oracle Client, then set the ORACLE_HOME and LD_LIBRARY_PATH to the right value

run checksetup.pl again to generate localconfig:
./checksetup.pl

Edit localconfig:
$db_driver = 'oracle';
$db_host = '10.182.120.189'; # IP or hostname

$db_name = 'XE'; # SID
$db_user = 'bugs'; # Database Username
$db_pass = 'bugs' # DataBase Password

After that,run checksetup.pl again:
./checksetup.pl

Enter the information for the administrator user:

Enter the e-mail address of the administrator: admin@my.company
Enter the real name of the administrator:Admin
Enter a password for the administrator account:
Please retype the password to verify:


Apache for Bugzilla

edit /etc/httpd/conf.d/bugzilla.conf, append:

AddHandler cgi-script .cgi
Options +Indexes +ExecCGI
DirectoryIndex index.cgi
AllowOverride Limit


restart Apache
service httpd restart

login Bugzilla as Admin (http://yourip/bugzilla/), and config the urlbase

Installation Finish!

Note:if you run into message like below, disable the selinux,and restart your OS:
'oracle' is not a valid choice for $db_driver in localconfig: Can't load 'lib/i386-linux-thread-
multi/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle:
libclntsh.so.10.1: cannot enable executable stack as shared object requires: Permission denied at /usr/lib/perl5/5.10.0 /i386-linux-thread-multi/DynaLoader.pm line 203.
at Bugzilla/DB/Oracle.pm line 41
Compilation failed in require at Bugzilla/DB/Oracle.pm line 41.
BEGIN failed--compilation aborted at Bugzilla/DB/Oracle.pm line 41.
Compilation failed in require at (eval 30) line 3.

Followers