Wednesday, January 22, 2014

Neat TFS enhancements


http://gillesperon.blogspot.com/2011/10/tips-useful-commands-for-tfs-in-visual.html
This is nice example for more useful shorcuts -vietsoft

This post is a short remember of 2 TFS command lines I use a lot.
Because of that, I like to have them defined as "External Tools" in Visual Studio.

Command 1: Preview of a get latest

I like to know exactly what I will get before getting it [therefore I can know when a merge will be required before starting it... No need to have a bad surprise when it can be avoided!]

This first command is in fact the classic "get", with the option "/preview".
Which gives:
c:\program files (x86)\microsoft visual studio 10.0\Common7\IDE\TF.exe get /preview /recursive

Here how you can integrate it in Visual Studio.
Select "Tools" > "External Tools…", and then create a new entry:

Creation of the command "TFS Test Get"
Values should be:

  • A meaningful title ☺
  • Command:     c:\program files (x86)\microsoft visual studio 10.0\Common7\IDE\TF.exe
  • Arguments:     get /preview /recursive
  • Initial directory:     $(SolutionDir)
  • Select the option "Use Output window"

Observation: this command is interesting to know which files will be updated, and if some merges will be required, however I strongly advise any TFS user to use Team Foundation Sidekicks.


Command 2: Undo unchanged checked out files

In TFS a file must be checked out before being modified.
The "check out" operation can be automated (no prompt will appear), but very often some files are checked out without being modified... (because you did a modification but canceled it after, or because a whole group of files have been checked out at the same time, or those annoying "*.vspscc" files...)

This second command is available in the power tools and allows to cancel the check out of all the files that don't contain any modification.
Here is the command:
C:\Program Files (x86)\Microsoft Team Foundation Server 2010 Power Tools\TFPT.EXE uu /noget /recursive

Here again how you can integrate it in Visual Studio.
Select "Tools" > "External Tools…", and then create a new entry:

Creation of the command "TFS uu" ("uu" standing for "undo unchanged")
Values should be:


  • A meaningful title ☺
  • Command:     C:\Program Files (x86)\Microsoft Team Foundation Server 2010 Power Tools\TFPT.EXE
  • Arguments:     uu /noget /recursive
  • Initial directory:     $(SolutionDir)
  • Select the option "Use Output window"

Observations:
  • I always run this command before any commit or any shelve, therefore I know exactly what I will commit,
  • If you are in a situation in which some files have been modified in your workspace without having been checked out (meaning that TFS does not know there are some modifications), you can quickly find them by doing a recursive checked out of all the files, and then calling this command.

Last advice: Create some shortcuts

Because I am using those commands before each get latest and before each commit, I usually like to define some shortcuts to call them quickly.
Those commands are among a few ones I even put in the main menu bar.
To do so, you can do a right click on the main menu bar, and select "Customize…".

Add your external commands
Notice that you will not see the name of your commands in the "Customize" panel. You will see "External Command #". However the names will be ok (and you can even put some icons if you prefer).

That's it for those 2 basic but useful commands.
G

Tuesday, January 21, 2014

ClearCase CheatSheets

1. ClearCase CheatSheet


ct help <command>                       Usage statement for command
ct man <command>                        Manual page for command

ct lsvob                                List VOBs
ct mount <vob-tag>                      Mount VOB
ct umount <vob-tag>                     Unmount VOB

ct lsview                               List views
ct startview <view-tag>                 Start view
ct setview <view-tag>                   Set view (UNIX)
ct endview <view-tag>                   Stop view
ct endview -server <view-tag>           Stop view and kill view server process
net use <drive:> \\view\<view-tag>      Map drive to view
net use <drive:> /d                     Disconnect drive from view

ct lsvtree <pname>                      Version tree browser
ct lsvtree -gra <pname>                 Version tree browser (graphical)

ct pwd                                  Print working directory
ct pwv                                  Print working view
ct ls                                   List contents of directory with ClearCase info
ct ls -view                             List only private files in directory
ct ls -vob                              List only vob elements in directory

ct lsprivate                            List private files in the view
ct lsco [-all] [-cview] [-s]            Find checkouts

ct mkview -tag <view-tag> <stg-dir>                     Create view
ct mkview -tag <view-tag> -stream <stream> <stg-dir>    Create view (UCM)
ct rmview -tag <view-tag>                               Remove view

ct mkstream <stream>                    Create stream (UCM)

ct lsact                                List activities at current stream (UCM)
ct setact <act-id> | [-none]            Set activities (UCM)
ct mkact -headline <headline>           Create activity (UCM)
ct rmact <act-id>                       Remove activity (UCM)

ct co [-unres] <pname>                  Checkout
ct ci <pname>                           Checkin
ct unco <pname>                         Uncheckout
ct reserve <pname>                      Change unreserved to reserved checkout
ct unreserve <pname>                    Change reserved to unreserved checkout

ct mkelem <pname>                       Make new file element
ct mkdir <pname>                        Make new directory element

ct mv <src-pname> <dest-pname>          Move an element
ct rmname <pname>                       Logical delete of element
ct ln [-s]                              Create link

------------------------------------------------------------------------------------------

<cmd> <pname>                           Operate on version selected by view
<cmd> <pname@@\version-id>              Operate on version given the version-id

ct diff [-gra] [-pred] <pname>          Diff tool
ct merge [-gra]                         Merge
ct findmerge                            Batch merge

ct mklbtype <label-type-name>           Create label type
ct mklabel <label-type-name> <pname>    Attach label
ct lock lbtype:<label-type-name>        Lock label

ct mkbl [-incremental | -full] <baseline-root-name>                Make baseline (UCM)
ct chbl [-level <promotion-level>]                                 Promote baseline (UCM)
ct chstream [-recommended <baseline-selector>] <stream-selector>   Recommend baseline (UCM)

ct rebase -gmerge -recommended          Rebase stream (UCM)
ct rebase -complete                     Complete rebase (UCM)

ct deliver                              Deliver activities (UCM)
ct deliver -complete                    Complete deliver (UCM)
ct deliver -activites <act-selectors>   Deliver specific activities (UCM)

ct setcs -stream                        Synchronize view

ct catcs                                View config spec
ct edcs                                 Edit config spec
ct setcs                                Set config spec

ct find                                 Search/Reporting utility

------------------------------------------------------------------------------------------

ct lsstgloc                             List all storage locations
ct mkstgloc                             Create storage location
ct rmstgloc                             Remove a storage location

ct mkvob -tag <vob-tag> <stg-dir>       Create VOB
ct rmvob <stg-dir>                      Remove VOB
ct describe vob:<vob-tag>               Display owner and group of VOB
ct protectvob                           Change owner and group of VOB

clearfsimport <src-path> <target>       Import files and directory structures
clearexport_*                           Export versioned files from another tool
clearimport                             Import versioned files

ct rmver                                Physically remove a version from VOB
ct rmbranch                             Physically remove an entire branch from VOB
ct rmelem                               Physically remove an entire element from VOB

ct relocate                             Relocate elements from one VOB to another

ct protect [-chown] [-chgrp] [-chmod]   Change element permission, owner, group
ct describe <element-path@@>            Display element permission, owner, group

mvfsstorage                             Display location of data container
ct dump                                 Display location of source and cleartext container

ct getlog                               Display error logs

ct mktrtype                             Create trigger type
ct mktrigger                            Attach/apply trigger
ct rmtrigger                            Remove a single instance of trigger
ct rmtype [-rmall] trtype:<trig-type>   Remove trigger type

ct mkattype <type-name>                 Create attribute type
ct mkattr <attype> <value> <pname>      Attach/apply attribute
ct rmattr                               Remove a single instance of attribute
ct rmtype [-rmall] attype:<att-type>    Remove attribute type

------------------------------------------------------------------------------------------

site_prep                               Prepare the ClearCase release area
setup / install_release                 Install ClearCase on client or server
clearlicense [-hostid]                  Display license information
rgy_passwd                              Set the registry password
ct hostinfo -l                          Display host ClearCase information

net stop albd                           Stop ClearCase services (Windows)
net start albd                          Start ClearCase services (Windows)
/etc/init.d/clearcase stop              Stop ClearCase services (UNIX)
/etc/init.d/clearcase start             Start ClearCase services (UNIX)

ct lsregion                             Display ClearCase regions
ct mkregion -tag <name>                 Create ClearCase region
ct rmregion [-rmall] -tag <name>        Remove ClearCase region

ct register (-vob|-view) <stg-path>     Register a VOB or view
ct unregister (-vob|-view) <stg-path>   Unregister a VOB or view
ct mktag (-vob|-view) -tag <tag> <stg>  Create a VOB or view tag
ct rmtag (-vob|-view) <tag>             Remote a VOB or view tag

rgy_check [-vobs] [-views] [-storage]   Verify registry integrity

ct lock vob:<vob-tag>                   Lock VOB
ct unlock vob:<vob-tag>                 Unlock VOB

ct recoverview -syn -tag <view-tag>     Recover stranded view private files

fix_prot                                Fix protection problems
dbcheck -a -k <vob_db>                  Scan RAIMA db for corruption
ct checkvob [-fix] -pool <vob-stg-dir>  Scan db/storage pools for consisten
---------------------------------------------------------------------------
more links:
http://www.yolinux.com/TUTORIALS/ClearcaseCommands.html


--------------------------------------------------------------------------------------------

2. http://www.ibm.com/developerworks/rational/library/836.html

Use this "cheat sheet" as a quick reference and practical aid to efficent use of IBM Rational® ClearCase®. Tips, reminders, and expert advice from one of Rational's in-house ClearCase pros answer the most common user needs.

Views


How many Views do I need?

Generally, one per discrete task is a good idea, though this is not a requirement. Views should be regarded as "cheap" entities that are easily created and destroyed. Create one for each task you need to do and when that task is done, delete the view.

Dynamic versus Snapshot Views

ClearCase and ClearCase LT offer snapshot views as workspaces. Snapshot views work by copying versions of elements from VOBs to your computer. To see the latest versions of elements, you need to update your snapshot view periodically. An update operation copies the latest versions of elements from the VOB to your view.
ClearCase (but not ClearCase LT) also offers dynamic views. A dynamic view uses the Multiversion File System (MVFS) to provide immediate, transparent access to data stored in VOBs. When you work in a dynamic view, you do not need to copy data fromVOBs to your view; you always see the latest versions of elements. Dynamic views also provide advanced functionality such as build auditing and binary sharing.

How to create a Dynamic View

cleartool mkview -tag atag  storage-location
Where atag is the view-tag (the "name" of the view which should be a name that you can easily remember) and storage-location is the location of a place on a disk where the view can store information.
Alternatively, there is a simplified command:
cleartool mkview -tag atag -stgloc -auto
In this example, you don't need to specify a storage location, but rather this command enables you to use a storage location that has been set up by your ClearCase admin.

How to delete a Dynamic View

cleartool rmview -tag atag
Where atag is the view-tag of the view you want to remove.

How to create a Snapshot View

cleartool mkview -snapshot -tag atag -stgloc -auto apathname
Where apathname is the path to which you want your source code (work area) to reside. The -tag atag is optional - if you omit it, ClearCase will make one up based on your username and the workspace you specify in apathname.

How to delete a Snapshot View

cleartool rmview apathname
Where apathname is the path to where your source code (work area) resides.

Modifying files


Checkout

To modify an element you need to check it out. Do this with the following command:
cleartool co anelement
where anelement is the name of the file or directory you want to check out.

Checkin

Once you are happy with the changes you have made to a checked-out element, you can check it in with the following command:
cleartool ci anelement
where anelement is the name of the file or directory you want to check in. Once you check-in an element, the changes you made to that element are usable by everyone on your project.

Uncheckout

If you want to cancel a checkout, you can do so with the following command:
cleartool unco anelement
where anelement is the name of the file or directory you want to check in.

Creating new files


Creation

To create a new file, you can use whatever editor or command you would normally use to create the file. The new file will be a view-private entity until you take the next step to put it under ClearCase control.

Putting a file under version control

To put a file under ClearCase control you must first check-out the directory that will be containing the file, issue the command to tell ClearCase to put the file under version control, and then check-in the directory containing the new file. Here are commands to perform these steps:
cleartool co thedirectory 
cleartool mkelem thefile 
cleartool ci thedirectory
After this sequence is performed, the file thefile is still checked-out and can be modified further before you check it in.

Deleting elements

To remove an element you should use the cleartool rmname command. This command removes the name of the specified element from the directory in which it is contained. Similar to placing an element under ClearCase control, you must first check-out the directory containing the element to be removed, do the cleartool rmname of the element, and then check-in the new version of the directory. Here is an example:
cleartool co thedirectory 
cleartool rmname anelement 
cleartool ci thedirectory
After this sequence, anelement is no longer listed in subsequent versions of thedirectory. It is, however, still listed in previous versions of the directory. If, at a later date you want to re-add anelement to a new version of thedirectory (or any other directory), you can do so easily.

Renaming elements

Renaming an element is similar to deleting it. First you check-out the old directory containing the element, and you also check-out the new directory to which the element is to be moved. Then you use the cleartool mv command to perform the move operation. Be sure to check-in the old and new directories when you are done.
cleartool co . 
cleartool co newdirectory 
cleartool mv anelement newdirectory 
cleartool ci . 
cleartool ci newdirectory
Renaming an element is also accomplished using the cleartool mv command except the old directory and the new directory are the same.
cleartool co . 
cleartool mv anelement anewname 
cleartool ci .
In subsequent versions of the directory, the name anelement will not appear, having been replaced by anewname but the name anelement will still appear in prior versions of the directory. Both the names anewname and anelement will still refer to the same element; only the name associated with the element in the directory will have changed.

Getting information


More about Views

What View am I in?
At any given time you can tell what view you are in by issuing the following command:
cleartool pwv
pwv means "print working view" in the tradition of the UNIX command pwd for "print working directory"

What is my "config-spec"?

Recall that a configuration specification (config-spec) is the set of rules that tells ClearCase what configuration of elements you want to work with. You can see that set of rules by issuing the following command:
cleartool  catcs

How do I change my config-spec?

You can edit your config-spec by issuing the following command:
cleartool edcs
Your favorite editor , as specified by the environment variable WINEDITOR (first choice), VISUAL (second choice), or EDITOR (third choice) will be invoked for the editing operation. If none of these environment variables is set then vi will be invoked for the editing operation on UNIX systems and Notepad will be invoked for the editing operation on Windows systems.

About files/directories


What is checked-out and to whom?

If you want to see who has what checked-out, you can use the cleartool lsco command. This command has a number of possible arguments to use depending on the specific information you want. Here are some common ones:
cleartool lsco
Lists all checkouts of elements in the current directory.
cleartool lsco anelement
List checkout information about the element anelement.
cleartool lsco -recurse
Lists all checkouts of elements in the current directory and below.
cleartool lsco -cview
Lists checkouts of elements in the current directory that are checked-out to the current view.
cleartool lsco -cview -recurse
Lists checkouts of elements in the current directory and below that are checked-out to the current view.
cleartool lsco -me
Lists checkouts of elements in the current directory that the current user has checked-out.
cleartool lsco -user fred
Lists checkouts of elements in the current directory that the user with login id "fred" has checked-out.
Please refer to the ClearCase Reference Manual for more detailed information about the cleartool lsco command.

What is the change history of this file/directory?

If you want to see the change history associated with a particular element, you can use the cleartool lsh command.
cleartool lsh anelement
Where anelement is the name of an element under ClearCase control

What versions of what files/directories am I looking at?

To see exactly what versions of elements are being projected to you by your view and why, you can use the cleartool ls command.
cleartool ls

What are the differences between this version of a file/directory and a different version?

To view the differences between the versions of an element visible in your view and another version of the element you can use the cleartool diffcommand.
cleartool diff -g -pred anelement
Graphically presents the differences between the version of anelement selected by your view and it's immediate predecessor version.
cleartool diff -g anelement anelement@@/main/5
Graphically presents the differences between the version of anelement selected by your view and version 5 on the main branch of anelement.
You can also use this command without the -g option to present the difference information to you textually rather than graphically.
See the cleartool diff entry in the ClearCase Reference Manual for more detailed information on these commands.

What does the version tree look like for this file/directory?

To view a graphical representation of the version tree associated with an element you can use the xlsvtree command.
cleartool lsvtree -g anelement
You can view a textual representation of the version tree associated with an element with the cleartool lsvtree command.
cleartool lsvtree anelement

I want more information about this element?

You can get more detailed information about a particular element with the cleartool describe command.
cleartool describe anelement
Lists information about anelement such as the version selected by your view, who created it and when, the comment associated with the version, the element type and the predecessor version.

Saturday, October 19, 2013

Step-by-Step Bugzilla Installation Guide for Linux

http://www.thegeekstuff.com/2010/05/install-bugzilla-on-linux/

Bugzilla is the best open source bug tracking system. Very simple to use with lot of features. Bugzilla allows you to track the bugs and collaborate with developers and other teams in your organization effectively.
This is a detailed step-by-step bugzilla installation guide for Linux.

1. Verify Perl Version

Make sure your perl version is >= 5.8.1 as shown below.
# perl -v

This is perl, v5.8.8 built for i386-linux-thread-multi
Most Linux distributions comes with perl. If you don’t have it on yours, download and install it from corresponding distribution website.

2. Install MySQL Database

Make sure your MySQL version is >= 4.1.2 as shown below.
# mysql -V
mysql  Ver 14.12 Distrib 5.0.77, for redhat-linux-gnu (i686) using readline 5.1
If you don’t have mysql, install it as using yum groupinstall, or based on LAMP install article, or based on mysql rpm article.

3. Install Apache

If you already have apache installed, make sure you are able to access it by using http://{your-ip-address}.
If you don’t have apache, install is using yum based on LAMP install article, or install apache from source.

4. Download latest Bugzilla tar ball

Download the latest stable release from bugzilla download page. Extract the bugzilla*.tar.gz file to the apache document root directory as shown below.
# cd ~

# wget http://ftp.mozilla.org/pub/mozilla.org/webtools/bugzilla-3.6.tar.gz

# cd /var/www/html

# tar xvfz /usr/save/bugzilla-3.4.6.tar.gz

5. Execute the bugzilla checksetup.pl

Bugzilla checksetup.pl program will verify whether all the required perl modules are installed. This will also display a list of all missing bugzilla modules that needs to be installed.
You can run the checksetup.pl program as many times as you like until you’ve verified all the required perl modules are installed.
Following is the output of 1st run of checksetup.pl, where is has listed all the missing optional and required modules.
# cd /var/www/html/bugzilla-3.4.6

# ./checksetup.pl --check-modules

COMMANDS TO INSTALL OPTIONAL MODULES:

             GD: /usr/bin/perl install-module.pl GD
          Chart: /usr/bin/perl install-module.pl Chart::Base
    Template-GD: /usr/bin/perl install-module.pl Template::Plugin::GD::Image
     GDTextUtil: /usr/bin/perl install-module.pl GD::Text
        GDGraph: /usr/bin/perl install-module.pl GD::Graph
       XML-Twig: /usr/bin/perl install-module.pl XML::Twig
     MIME-tools: /usr/bin/perl install-module.pl MIME::Parser
    libwww-perl: /usr/bin/perl install-module.pl LWP::UserAgent
    PatchReader: /usr/bin/perl install-module.pl PatchReader
     PerlMagick: /usr/bin/perl install-module.pl Image::Magick
      perl-ldap: /usr/bin/perl install-module.pl Net::LDAP
    Authen-SASL: /usr/bin/perl install-module.pl Authen::SASL
     RadiusPerl: /usr/bin/perl install-module.pl Authen::Radius
      SOAP-Lite: /usr/bin/perl install-module.pl SOAP::Lite
    HTML-Parser: /usr/bin/perl install-module.pl HTML::Parser
  HTML-Scrubber: /usr/bin/perl install-module.pl HTML::Scrubber
Email-MIME-Attachment-Stripper: /usr/bin/perl install-module.pl Email::MIME::Attachment::Stripper
    Email-Reply: /usr/bin/perl install-module.pl Email::Reply
    TheSchwartz: /usr/bin/perl install-module.pl TheSchwartz
 Daemon-Generic: /usr/bin/perl install-module.pl Daemon::Generic
       mod_perl: /usr/bin/perl install-module.pl mod_perl2

YOU MUST RUN ONE OF THE FOLLOWING COMMANDS (depending on which database you use):

PostgreSQL: /usr/bin/perl install-module.pl DBD::Pg
     MySQL: /usr/bin/perl install-module.pl DBD::mysql
    Oracle: /usr/bin/perl install-module.pl DBD::Oracle

COMMANDS TO INSTALL REQUIRED MODULES (You *must* run all these commands and then re-run checksetup.pl):

    /usr/bin/perl install-module.pl CGI
    /usr/bin/perl install-module.pl Digest::SHA
    /usr/bin/perl install-module.pl Date::Format
    /usr/bin/perl install-module.pl DateTime
    /usr/bin/perl install-module.pl DateTime::TimeZone
    /usr/bin/perl install-module.pl Template
    /usr/bin/perl install-module.pl Email::Send
    /usr/bin/perl install-module.pl Email::MIME
    /usr/bin/perl install-module.pl Email::MIME::Encodings
    /usr/bin/perl install-module.pl Email::MIME::Modifier
    /usr/bin/perl install-module.pl URI

To attempt an automatic install of every required and optional module with one command, do:

  /usr/bin/perl install-module.pl --all

6. Execute bugzilla install-module.pl

As suggested by the output of the checksetup.pl, you can execute the install-module.pl to install all bugzilla required and optional perl modules.
# /usr/bin/perl install-module.pl --all
Please review the output of the above install-module.pl to make sure everything got install properly. There is a possibility that some of the modules failed to install (may be because some required OS packages were missing).
Execute the checksetup.pl to verify whether all the modules got installed properly.
Following is the output of 2nd run of the checksetup.pl:
# ./checksetup.pl --check-modules
COMMANDS TO INSTALL OPTIONAL MODULES:

             GD: /usr/bin/perl install-module.pl GD
          Chart: /usr/bin/perl install-module.pl Chart::Base
    Template-GD: /usr/bin/perl install-module.pl Template::Plugin::GD::Image
     GDTextUtil: /usr/bin/perl install-module.pl GD::Text
        GDGraph: /usr/bin/perl install-module.pl GD::Graph
       XML-Twig: /usr/bin/perl install-module.pl XML::Twig
     PerlMagick: /usr/bin/perl install-module.pl Image::Magick
      SOAP-Lite: /usr/bin/perl install-module.pl SOAP::Lite
       mod_perl: /usr/bin/perl install-module.pl mod_perl2

YOU MUST RUN ONE OF THE FOLLOWING COMMANDS (depending on which database
you use):

PostgreSQL: /usr/bin/perl install-module.pl DBD::Pg
     MySQL: /usr/bin/perl install-module.pl DBD::mysql
    Oracle: /usr/bin/perl install-module.pl DBD::Oracle

7. Install missing Perl Modules

As we see from the above checksetup.pl output, some of the optional modules and required module installed was not completed when we ran the install-module.pl.
So, we have to install the missing modules manually one-by-one to figure out the issues and fix it one-by-one.
Refer to the “Troubleshooting Section” at the end for list of all the issues that I faced while installing the perl modules required for bugzilla (along with the solution on how to fix those issues).

8. Final checksetup.pl –check-modules verification

Execute checksetup.pl –check-modules again as shown below as final verification to make sure all the modules got installed successfully.
# ./checksetup.pl --check-modules
* This is Bugzilla 3.4.6 on perl 5.8.8
* Running on Linux 2.6.18-164.el5PAE #1 SMP Thu Sep 3 04:10:44 EDT 2009

Checking perl modules...
Checking for              CGI.pm (v3.21)   ok: found v3.49
Checking for          Digest-SHA (any)     ok: found v5.48
Checking for            TimeDate (v2.21)   ok: found v2.24
Checking for            DateTime (v0.28)   ok: found v0.55
Checking for   DateTime-TimeZone (v0.71)   ok: found v1.17
Checking for                 DBI (v1.41)   ok: found v1.52
Checking for    Template-Toolkit (v2.22)   ok: found v2.22
Checking for          Email-Send (v2.00)   ok: found v2.198
Checking for          Email-MIME (v1.861)  ok: found v1.903
Checking for Email-MIME-Encodings (v1.313)  ok: found v1.313
Checking for Email-MIME-Modifier (v1.442)  ok: found v1.903
Checking for                 URI (any)     ok: found v1.54 

Checking available perl DBD modules...
Checking for              DBD-Pg (v1.45)    not found
Checking for           DBD-mysql (v4.00)   ok: found v4.013
Checking for          DBD-Oracle (v1.19)    not found 

The following Perl modules are optional:
Checking for                  GD (v1.20)   ok: found v2.44
Checking for               Chart (v1.0)    ok: found v2.4.1
Checking for         Template-GD (any)     ok: found v1.56
Checking for          GDTextUtil (any)     ok: found v0.86
Checking for             GDGraph (any)     ok: found v1.44
Checking for            XML-Twig (any)     ok: found v3.34
Checking for          MIME-tools (v5.406)  ok: found v5.427
Checking for         libwww-perl (any)     ok: found v5.834
Checking for         PatchReader (v0.9.4)  ok: found v0.9.5
Checking for          PerlMagick (any)     ok: found v6.2.8
Checking for           perl-ldap (any)     ok: found v0.4001
Checking for         Authen-SASL (any)     ok: found v2.1401
Checking for          RadiusPerl (any)     ok: found v0.17
Checking for           SOAP-Lite (v0.710.06) ok: found v0.711
Checking for         HTML-Parser (v3.40)   ok: found v3.65
Checking for       HTML-Scrubber (any)     ok: found v0.08
Checking for Email-MIME-Attachment-Stripper (any)     ok: found v1.316
Checking for         Email-Reply (any)     ok: found v1.202
Checking for         TheSchwartz (any)     ok: found v1.10
Checking for      Daemon-Generic (any)     ok: found v0.61
Checking for            mod_perl (v1.999022) ok: found v2.000004

9. Create localconfig file using checksetup.pl

Execute checksetup.pl without any argument, which will create a localconfig file in the current directory. The localconfig file contains the key configuration parameters used by the bugzilla (for example, mysql db username and password).
# ./checksetup.pl
Reading ./localconfig...

This version of Bugzilla contains some variables that you may want to
change and adapt to your local settings. Please edit the file
./localconfig and rerun checksetup.pl.

The following variables are new to ./localconfig since you last ran
checksetup.pl:  create_htaccess, webservergroup, db_driver, db_host, db_name, db_user, db_pass, db_port, db_sock, db_check, index_html, cvsbin, interdiffbin, diffpath, site_wide_secret

10. Modify the localconfig file.

The only thing you need to modify the localconfig file is MySQL database db password by changing the $db_pass variable as shown below.
# vi ./localconfig
$db_pass = 'Bugs4All';

11. Modify /etc/my.cnf to increase bugzilla attachment size

Set the max_allowed_packet to 4M in the /etc/my.cnf to increase bugzilla attachment size.
# cat /etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1

# Disabling symbolic-links is recommended to prevent assorted security risks;
# to do so, uncomment this line:
# symbolic-links=0

# Allow packets up to 4MB
max_allowed_packet=4M

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
Restart the mysqld after this change.
# service mysqld restart

12. Create bugs mysql user

Add bugzilla user (bugs) to the mysql database as shown below.
# mysql -u root -p

mysql> GRANT SELECT, INSERT,
UPDATE, DELETE, INDEX, ALTER, CREATE, LOCK TABLES,
CREATE TEMPORARY TABLES, DROP, REFERENCES ON bugs.*
TO bugs@localhost IDENTIFIED BY 'Bugs4All';

mysql> FLUSH PRIVILEGES;

13. Create the bugzilla database

Execute the checksetup.pl (without any arguments) again to create the mysql bugzilla database. Since the localconfig file already exist, the second time when you execute the checksetup.pl, it will create the mysql database based on the information from localconfig file.
# ./checksetup.pl 

Creating database bugs...

Building Schema object from database...
Adding new table bz_schema ...
Initializing the new Schema storage...
Adding new table attach_data ...
Adding new table attachments ...
Adding new table bug_group_map ...
Adding new table bug_see_also ...
Adding new table bug_severity ...
Adding new table bug_status ...

Inserting values into the 'priority' table:
Inserting values into the 'bug_status' table:
Inserting values into the 'rep_platform' table:

Creating ./data directory...
Creating ./data/attachments directory...
Creating ./data/duplicates directory...

Adding foreign key: attachments.bug_id -> bugs.bug_id...
Adding foreign key: attachments.submitter_id -> profiles.userid...
Adding foreign key: bug_group_map.bug_id -> bugs.bug_id...

14. Create bugzilla administrator account.

At the end of the ./checksetup.pl execution, it will detect that you don’t have an adminsitrator account and request you to enter administration login information as shown below.
Looks like we don't have an administrator set up yet. Either this is
your first time using Bugzilla, or your administrator's privileges
might have accidentally been deleted.

Enter the e-mail address of the administrator: ramesh@thegeekstuff.com
Enter the real name of the administrator: Ramesh Natarajan
Enter a password for the administrator account: NotRealPwd
Please retype the password to verify: welcome
ramesh@thegeekstuff.com is now set up as an administrator.
Creating default classification 'Unclassified'...
Creating initial dummy product 'TestProduct'...

Now that you have installed Bugzilla, you should visit the 'Parameters'
page (linked in the footer of the Administrator account) to ensure it
is set up as you wish - this includes setting the 'urlbase' option to
the correct URL.

15. Configure apache for mod_perl

Rename the bugzilla directory. (i.e remove the version number in it)
# cd /var/www/html

# mv bugzilla-3.4.6/ bugzilla
Add the following two lines to httpd.conf
# tail -2 /etc/httpd/conf/httpd.conf
PerlSwitches -I/var/www/html/bugzilla -I/var/www/html/bugzilla/lib -w -T
PerlConfigRequire /var/www/html/bugzilla/mod_perl.pl
Verify the Group in httpd.conf matches the webservergroup in localconfig
# cd /var/www/html/bugzilla/

# grep webservergroup localconfig
$webservergroup = 'apache';

# grep Group /etc/httpd/conf/httpd.conf
Group apache

16. Final checksetup.pl execution

Execute the checksetup.pl again.
# ./checksetup.pl
Reading ./localconfig...

Removing existing compiled templates...
Precompiling templates...done.
Fixing file permissions...

Now that you have installed Bugzilla, you should visit the 'Parameters'
page (linked in the footer of the Administrator account) to ensure it
is set up as you wish - this includes setting the 'urlbase' option to
the correct URL.

17. Login to bugzilla and complete one time setup.

Start the apache, go to http://{your-ip-address}/bugzilla and login using the administrator account you created above.
From the bugzilla UI, at the footer -> Administration -> Parameters -> ‘Required Settings’ section -> Fill-out following information:
maintainer: ramesh@thegeekstuff.com
urlbase: http://{your-ip-address}/
Note: Depending on your setup, go to -> User Authentication -> and you might want to change requiredlogin and emailregexp parameter.

Troubleshooting Bugzilla Install Issues

Issue1: DBD::mysql module failed

The DBD:mysql perl module failed with the “mysql.h: No such file or directory” error message as shown below.
# /usr/bin/perl install-module.pl DBD::mysql

dbdimp.h:22:49: error: mysql.h: No such file or directory
dbdimp.h:23:45: error: mysqld_error.h: No such file or directory
dbdimp.h:25:49: error: errmsg.h: No such file or directory
In file included from dbdimp.c:20:
dbdimp.h:144: error: expected specifier-qualifier-list before âMYSQLâ
dbdimp.h:236: error: expected specifier-qualifier-list before âMYSQL_RESâ

Solution1: install mysql-devel

Error message “mysql.h: No such file or directory” is because mysql-devel package was missing as shown below.
# rpm -qa | grep -i mysql
MySQL-python-1.2.1-1
mysql-5.0.77-4.el5_4.2
mysql-connector-odbc-3.51.26r1127-1.el5
mysql-server-5.0.77-4.el5_4.2
libdbi-dbd-mysql-0.8.1a-1.2.2
perl-DBD-MySQL-3.0007-2.el5
Install the mysql-devel package as shown below.
# yum install mysql-devel

# rpm -qa | grep -i "mysql-devel"
mysql-devel-5.0.77-4.el5_4.2
DBD::mysql installation will go through without any issues now.
# /usr/bin/perl install-module.pl DBD::mysql

Issue2: GD failed with missing gdlib-config / libgd

Installing GD module failed with the following error message.
# /usr/bin/perl install-module.pl GD

**UNRECOVERABLE ERROR**
Could not find gdlib-config in the search path. Please install libgd 2.0.28 or higher.
If you want to try to compile anyway, please rerun this script with the option --ignore_missing_gd.
Running make test
  Make had some problems, maybe interrupted? Won't test
Running make install
  Make had some problems, maybe interrupted? Won't install

Solution2: Install gd-devel package

Install libgd (i.e gd-devel package) as shown below to fix the GD module issue.
# yum install gd-devel

# rpm -qa | grep gd
gd-2.0.33-9.4.el5_4.2
gd-devel-2.0.33-9.4.el5_4.2
GD got installed without any issues after insingalling gd-devel package.
# /usr/bin/perl install-module.pl GD

Issue3: Twig Failed with expat.h error

Twig module failed to install with the error message “expat.h: No such file or directory” as shown below.
# /usr/bin/perl install-module.pl XML::Twig

Expat.xs:12:19: error: expat.h: No such file or directory
Expat.xs:60: error: expected specifier-qualifier-list before XML_Parser

Solution3: Install expat and expat-devel for Twig

Install expat and expat-devel package as shown below.
# yum install expat

# yum install expat-devel
Now install Twig without any issues.
# /usr/bin/perl install-module.pl XML::Twig

Issue4: Image::Magick failed to install

Image::Magick installation failed with “magick/MagickCore.h: No such file or directory” error message as shown below.
# /usr/bin/perl install-module.pl Image::Magick

Note (probably harmless): No library found for -lMagickCore
Magick.xs:64:31: error: magick/MagickCore.h: No such file or directory
Magick.xs:171: error: expected specifier-qualifier-list before ‘MagickRealType’
Magick.xs:192: error: expected specifier-qualifier-list before ‘ImageInfo’
Magick.xs:214: error: ‘MagickNoiseOptions’ undeclared here (not in a function)
Magick.xs:214: warning: missing initializer

Solution4: Image::Magick failed to install

Make sure following ImageMagic related packages are present.
# rpm -qa | grep -i Image
ImageMagick-6.2.8.0-4.el5_1.1
ImageMagick-c++-devel-6.2.8.0-4.el5_1.1
ImageMagick-devel-6.2.8.0-4.el5_1.1
ImageMagick-c++-6.2.8.0-4.el5_1.1
ImageMagick-perl-6.2.8.0-4.el5_1.1
In my case, ImageMagic-devel was missing. So, installed it as shown below. After that, Image::Magick perl module got installed successfully.
# yum install ImageMagick-devel

# /usr/bin/perl install-module.pl Image::Magick

Issue5: SOAP::Lite failed to install

SOAP::Lite module failed to install with “Cannot locate version.pm in @INC” message as shown below.
#/usr/bin/perl install-module.pl SOAP::Lite

Failed test 'use SOAP::Lite;' at t/SOAP/Data.t line 5.
Tried to use 'SOAP::Lite'.
Error:  Can't locate version.pm in @INC

Solution5: Install version.pm required for SOAP::Lite

Installed version.pm as shown below. After this, SOAP::Lite got installed without any issue.
# perl -MCPAN -e 'install version' 

# /usr/bin/perl install-module.pl SOAP::Lite

Issue6 (and Solution6): mod_perl was missing

Don’t install mod_perl using /usr/bin/perl install-module.pl mod_perl2 . Insetad, use yum to install mod_perl as shown below.
# yum install mod_perl

Issue7: Apache start failed

Starting apache failed with “Cannot locate Template/Config.pm in @INC” error message.
# service httpd restart
Stopping httpd:                                            [  OK  ]

Starting httpd: Syntax error on line 994 of /etc/httpd/conf/httpd.conf:
Can't locate Template/Config.pm in @INC

Solution7: Install Template-Tool Kit as shown below

Install Template-Tool kit to fix the above apache error message
# cpan
cpan> i /Template-Toolkit/
Distribution    A/AB/ABEL/Eidolon-Driver-Template-Toolkit-0.01.tar.gz
Distribution    A/AB/ABW/Template-Toolkit-1.07.tar.gz
Distribution    A/AB/ABW/Template-Toolkit-2.22.tar.gz
Distribution    I/IN/INGY/Template-Toolkit-Simple-0.03.tar.gz
4 items found

cpan> install A/AB/ABW/Template-Toolkit-2.22.tar.gz

Issue8: Apache start failed again

Starting apache failed with “Cannot locate DateTime/Locale.pm in @INC” error message.
# service httpd restart
Stopping httpd:                                            [  OK  ]

Starting httpd: Syntax error on line 994 of /etc/httpd/conf/httpd.conf:
Can't locate DateTime/Locale.pm in @INC

Solution8: Install DateTime/Locale.pm as shown below

Install DateTime/Locale.pm to fix the above apache error message
# cpan

cpan> install DateTime:Locale
Also, in your apache error_log if you see Digest/SHA.pm issue, you should install it as shown below.
# tail -f /etc/httpd/logs/error_log
Can't locate Digest/SHA.pm in @INC (@INC contains: 

# cpan
cpan> install Digest::SHA
 
 
 
------------------------------------------
 

If you enjoyed this article, you might also like..

  1. 50 Linux Sysadmin Tutorials
  2. 50 Most Frequently Used Linux Commands (With Examples)
  3. Top 25 Best Linux Performance Monitoring and Debugging Tools
  4. Mommy, I found it! – 15 Practical Linux Find Command Examples
  5. Linux 101 Hacks 2nd Edition eBook Linux 101 Hacks Book