Subversion Repositories DevTools

Rev

Rev 1293 | Blame | Last modification | View Log | RSS feed

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
<HTML
><HEAD
><TITLE
>Installation</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
REL="HOME"
TITLE="The Codestriker Guide"
HREF="book1.html"><LINK
REL="PREVIOUS"
TITLE="We Want to Hear from You!"
HREF="x44.html"><LINK
REL="NEXT"
TITLE="Configuration"
HREF="x107.html"></HEAD
><BODY
CLASS="CHAPTER"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>The Codestriker Guide: Version 1.9.3</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="x44.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="x107.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="CHAPTER"
><H1
><A
NAME="AEN49"
></A
>Chapter 2. Installation</H1
><DIV
CLASS="TOC"
><DL
><DT
><B
>Table of Contents</B
></DT
><DT
>2.1. <A
HREF="c49.html#CODESTRIKER-DATABASE-CREATION"
>Codestriker database creation</A
></DT
><DT
>2.2. <A
HREF="x107.html"
>Configuration</A
></DT
><DT
>2.3. <A
HREF="x234.html"
>Running install.pl</A
></DT
><DT
>2.4. <A
HREF="x248.html"
>Apache webserver configuration</A
></DT
><DT
>2.5. <A
HREF="x302.html"
>IIS configuration</A
></DT
><DT
>2.6. <A
HREF="x326.html"
>Upgrading Codestriker</A
></DT
></DL
></DIV
><P
>      This chapter is concerned with installing Codestriker on your
      system.  This requires the following steps:
      <P
></P
><UL
><LI
><P
>creating the Codestriker database;</P
></LI
><LI
><P
>configuring the webserver; and</P
></LI
><LI
><P
>unpacking and configuring Codestriker.</P
></LI
></UL
>
    </P
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="CODESTRIKER-DATABASE-CREATION"
>2.1. Codestriker database creation</A
></H1
><P
>        Codestriker stores all code review topics and comments into a
        relational database.  Currently,
        <A
HREF="http://www.mysql.com"
TARGET="_top"
>MySQL</A
>,
        <A
HREF="http://www.postgresql.org"
TARGET="_top"
>PostgreSQL</A
>,
        Oracle and SQL Server are
        supported, but any database system can be used, provided it has
        an implementation of Perl's DBI interface, which is the case
        for all major database implementations.
      </P
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN64"
>2.1.1. Using MySQL</A
></H2
><P
>         MySQL can be used on either UNIX or Window platforms.  It is
          available for download from
          <A
HREF="http://www.mysql.com"
TARGET="_top"
>http://www.mysql.com</A
>.
          Make sure you use at least version 4.1 or above, as this
          supports UTF8 databases.
          <SPAN
CLASS="emphasis"
><I
CLASS="EMPHASIS"
>Note under Solaris, it seems at
          the time of writing that only the 32-bit version of Perl and
          MySQL (and DBD::mysql) can be used, the 64-bit versions
          don't work.</I
></SPAN
>
          For Linux RedHat distributions, the necessary packages
          required are mysql, mysql-devel, mysql-server, which may or
          may not already be present on your system.  Depending on
          your UNIX operating system, starting mysql will be something
          like the following:
          <PRE
CLASS="PROGRAMLISTING"
>/etc/rc.d/init.d/mysql start
          </PRE
>
          For Windows, there will typically be a desktop icon or menu
          shortcut for starting mysqld.
        </P
><P
>         Once mysql is running, it is necessary to create the
          Codestriker database and create the codestriker user.  Under
          UNIX, a command like the following will be required:
          <PRE
CLASS="PROGRAMLISTING"
>% mysql -u root mysql
          </PRE
>
          For Windows, there should be a shortcut available for
          getting a mysql prompt.
        </P
><P
>         At the mysql prompt, issue the following command, but
          substitute a suitable database password instead of cspasswd
          as shown here.
          <PRE
CLASS="PROGRAMLISTING"
>CREATE DATABASE codestrikerdb CHARACTER SET utf8;

GRANT SELECT,INSERT,UPDATE,DELETE,INDEX,ALTER,CREATE,DROP,REFERENCES
 ON codestrikerdb.* TO codestriker@localhost IDENTIFIED BY 'cspasswd';

FLUSH PRIVILEGES;

QUIT
          </PRE
>
         </P
><P
>          You can check the Codestriker database at any time from the
           command line, by issuing the following command, and
           entering the database password:
          <PRE
CLASS="PROGRAMLISTING"
>mysql -u codestriker -D codestrikerdb -p
          </PRE
>
         </P
><P
>          If required, the Codestriker database can be dropped, by
           entering in the following command at the mysql command
           prompt as user root:
          <PRE
CLASS="PROGRAMLISTING"
>DROP DATABASE codestrikerdb;
          </PRE
>
         </P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN78"
>2.1.2. Using PostgreSQL</A
></H2
><P
>         At the time of writing PostgreSQL was only available for
          UNIX platforms, however it is quite possible by the time you
          are reading this that a version for Windows will be available.
          The project page for PostgreSQL is:
          <A
HREF="http://www.postgresql.org"
TARGET="_top"
>http://www.postgresql.org</A
>.
          For Linux RedHat distributions, the postgresql,
          postgresql-server and postgresql-devel packages are
          required.  Make sure you are using at least version 7.1, as
          prior versions had restrictions on the size of "text"
          fields, making it impractical for use with Codestriker.
          PostgreSQL can be started with a command like:
          <PRE
CLASS="PROGRAMLISTING"
>/etc/rc.d/init.d/postgresql start
          </PRE
>
        </P
><P
>         To create the Codestriker database and user, enter the
          following commands:
          <PRE
CLASS="PROGRAMLISTING"
>% createuser --username=postgres -d -A codestriker
% createdb -E UTF8 --username=codestriker codestrikerdb
          </PRE
>
          If the last command claims UTF8 is an unknown encoding, try
          the value UNICODE.  If that still fails, you have a
          distribution which wasn't configured with
          --enable-multibyte.  Try downloading the latest version of
          PostgreSQL.
        </P
><P
>         Make sure your <TT
CLASS="FILENAME"
>pg_hba.conf</TT
> file is
          suitable configured, in particular for authentication.
          This file is often located in
          <TT
CLASS="FILENAME"
>/etc/postgres</TT
>.
        </P
><P
>         You can check the Codestriker database interactively at any
          time with the following command:
          <PRE
CLASS="PROGRAMLISTING"
>% psql -U codestriker codestrikerdb
          </PRE
>
        </P
><P
>          If required, the Codestriker database can be dropped, by
           entering in the following command:
          <PRE
CLASS="PROGRAMLISTING"
>% dropdb --username=codestriker codestrikerdb
          </PRE
>
         </P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN92"
>2.1.3. Using Oracle</A
></H2
><P
>         Codestriker has been deployed under Linux 2.4 using
          Oracle 8i.  If you have Oracle installed, you most likely
          will have somebody that can easily create a new Codestriker
          database for you.  Install the DBD::Oracle Perl module, and
          modify the <CODE
CLASS="VARNAME"
>$db</CODE
> variable in the
          <TT
CLASS="FILENAME"
>codestriker.conf</TT
> file appropriately so
          that Codestriker knows how to connect to its database.  An
          example is given in the configuration file.  For more
          advanced connection strings, please consult the DBD::Oracle
          man page.
        </P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN97"
>2.1.4. Using SQL Server</A
></H2
><P
>          Codestriker has been deployed using SQL Server on Win32, via
          the ODBC interface.  The first step is to create a
          "Codestriker" system data source, by going to "Control
          Panel" -&#62; "Administrative Tools" -&#62; "Data Sources (ODBC)".
          From here, select the "System DSN" tab, and click "Add".
          Select the driver named "SQL Server", then click "Finish".
          Enter in "Codestriker" for the name textfield, "Codestriker
          database" for the description textfield, and select the
          appropriate SQL Server from the server dropdown box, then
          click "Next".  Choose the authentication appropriate for
          your site, and work your way through the final configuration
          options.  Modify the <CODE
CLASS="VARNAME"
>$db</CODE
> variable in the
          <TT
CLASS="FILENAME"
>codestriker.conf</TT
> file appropriately
          (see the example) so that Codestriker knows how to connect
          to this datasource.  For more advanced connection settings,
          please consult the DBD::ODBC man page or online manual.
        </P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="AEN102"
>2.1.5. Other Databases</A
></H2
><P
>         Codestriker uses the Perl DBI package, a portable API that
          supports all the major database systems.  The database
          creation code is abstracted so that it can work on a
          diverse range of database systems.  Support for a new
          database system involves writing a single Perl module in the
          <TT
CLASS="FILENAME"
>Codestriker::DB</TT
> package and registering
          it in the <TT
CLASS="FILENAME"
>Codestriker::DB::Database</TT
>
          module.  There are a number of example database modules
          there.
        </P
></DIV
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="x44.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="book1.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="x107.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>We Want to Hear from You!</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
>&nbsp;</TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Configuration</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>