The Bug Genie
The Bug Genie
star_faded.png
Please log in to subscribe to updates for this article
The Bug Genie:Windows IIS6
Last updated at Mon Aug 12 12:08, by kanto501

Installing Bug Genie on Windows IIS6  ⇑ top

1. Install IIS 6
2. Install PHP I installed PHP version 5.4.1 and followed the steps described in the PHP manual regarding the installation on Windows. They are quite clear and complete and should be of no problem. Some of the extension you will probably need to enable are (all configuration is done in the php.ini file):
extension=php_curl.dll
extension=php_fileinfo.dll
extension=php_gd2.dll
extension=php_ldap.dll
extension=php_mbstring.dll
extension=php_mysql.dll
extension=php_pdo_mysql.dll
3. Install FastCGI I also installed the fastCGI extension for IIS 5.1 and 6.0.
4. Mod Rewrite
TBG uses URL rewrite capabilities and for that I used the free tool from Ionic's IIRF. It works with IIS 6 it supports regular expressions and it is very similar to Mod Rewrite from Apache. Which proved to be both good and bad, since those minor differences sometimes are hard to know of, spot and correct. To configure it you have both a global ini file and a local file per folder/website. I just used the rules generated from TBG installation (the .htaccess file) but this was causing me problems, later i found out the RewriteBase has a slightly different behavior that was causing all sorts of evil in my TBG installation... this is the file you should use:
Select all
      RewriteBase /thebuggenie/thebuggenie/
    # skip all hidden files (starting with a .)
      RewriteCond %{REQUEST_URI} \..+$
      RewriteCond %{REQUEST_URI} !\.(html|wsdl|json|xml)$
      RewriteRule .* - [L]
    # redirect to front controller
      RewriteRule ^(.*)$ /index.php?url=$1 [NC,QSA,L]     
    # Stop people accessing directories they shouldn't have access to
    RedirectMatch 403 ^/\.svn(/|$)


5. install MySQL Installed MySQL version 5.5.23, also with good manual regarding windows installation. TBG mentions you need to grant to the database user the SELECT,INSERT,UPDATE,DELETE for normal usage and CREATE,INDEX,ALTER during installation but they forget to mention you also require the DROP for the installation only (I assume).
6. install TBG
Before starting installation you need to do some changes in TBG code. On file
Select all
    thebuggenie\thebuggenie\core\classes\TBGResponse.class.php
and line 164 replace
Select all
    if (!empty($ob_status) && $ob_status['status'] != PHP_OUTPUT_HANDLER_END)
for
Select all
    if (!empty($ob_status) && isset($ob_status['status']) && $ob_status['status'] != PHP_OUTPUT_HANDLER_END)
This was preventing my installation from completing. Then in order to enable the hooking with SVN you also need to add the following line of code in file
Select all
    thebuggenie\thebuggenie\core\classes\TBGContext.class.php
and line 2405
Select all
     self::$_redirect_login = false;
I've added it at the top of the function inside the try statement. now you can install TBG by using the web installer
7. install SVN Now you can install subversion and set up a repository. You will also need to download the WGET application and place it in a place accessible from the VBS script, please be aware that when SVN calls the script the complete environment is clean, meaning you have no access to such things as the PATH variable. Then to link with TBG you can use the following hook script combo, made of both a BAT file and a VBS script file. Previously I was trying to use someone else's BAT only file but the changed files was not being processed correctly due to multiple spaces issue: post-commit.bat
Select all
    @ECHO OFF
    SETLOCAL
    SET PATH=C:\Windows;C:\Windows\system32;
    cscript.exe //NoLogo C:\SVN\repository\hooks\post-commit.vbs %1 %2
    IF ERRORLEVEL 1 GOTO fail
    :success
    REM EXIT 0
    :fail
    REM EXIT 1
post-commit.vbs
Select all
    TRIGGER_URL = "http://127.0.0.1/thebuggenie/thebuggenie/vcs_integration/report/1/"
    PASSKEY = "12345"
    PROJECT = 1
    PHP = "C:\PHP\php.exe "
    SVNLOOK = "C:\SVN\bin\svnlook.exe "
    CMDLOG = "C:\SVN\repository_COMMAND.log"
    WGET = "C:\SVN\repository\hooks\wget.exe --no-check-certificate "
    WGETLOG = "C:\Inetpub\temp\wget.log"
    WGETOUT = "C:\Inetpub\temp\wget.html"

    pRepository = WScript.Arguments.Item(0)
    pRevision = WScript.Arguments.Item(1)

    dq = chr(34)
    set SHELL = CreateObject( "WScript.Shell" )

    set Result = SHELL.Exec( SVNLOOK & "changed -r " & pRevision & " " & pRepository )
    ChangedFiles = Result.StdOut.ReadAll
    set Result = SHELL.Exec( PHP & "-r " & dq & "echo urlencode($argv[1]);" & dq & " " & dq & ChangedFiles & dq )
    ChangedFiles = Result.StdOut.ReadAll

    set Result = SHELL.Exec( SVNLOOK & "author -r " & pRevision & " " & pRepository )
    Author = Replace(Result.StdOut.ReadAll,vbCrLf,"")
    set Result = SHELL.Exec( PHP & "-r " & dq & "echo urlencode($argv[1]);" & dq & " " & dq & Author & dq )
    Author = Result.StdOut.ReadAll

    set Result = SHELL.Exec( SVNLOOK & "log -r " & pRevision & " " & pRepository)
    CommitMsg = Result.StdOut.ReadAll
    set Result = SHELL.Exec( PHP & "-r " & dq & "echo urlencode($argv[1]);" & dq & " " & dq & CommitMsg & dq )
    CommitMsg = Result.StdOut.ReadAll

    WScript.Echo WGET & dq & TRIGGER_URL & dq & " --post-data=" & dq & "passkey=" & PASSKEY & "&author=" & Author & "&rev=" & pRevision & "&commit_msg=" & dq & CommitMsg & dq & "&changed=" & dq & ChangedFiles & dq & dq & " -o " & WGETLOG & " -O " & WGETOUT
    set Result = SHELL.Exec( WGET & dq & TRIGGER_URL & dq & " --post-data=" & "passkey=" & PASSKEY & "&author=" & Author & "&rev=" & pRevision & "&commit_msg=" & dq & CommitMsg & dq & "&changed=" & dq & ChangedFiles & dq & " -o " & WGETLOG & " -O " & WGETOUT )


now on the VBS script don't forget to replace the passkey by your project's passkey and also the correct project number retrieved from TBG project settings page.
8. final remarks My setup also assumes an installation directory of
Select all
    C:\SVN
for SVN ...
Select all
    C:\PHP
for PHP and that the buggenie was extracted into
Select all
    C:\Inetpub\wwwroot\
meaning you can find the file index.php in
Select all
    C:\Inetpub\wwwroot\thebuggenie\thebuggenie\index.php.
Additional Help: IIS Configuration


Article attachments

There are no file attached to this article

Article comments (0)

There are no comments