Rev 1293 | Go to most recent revision | Blame | Compare with Previous | 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><METANAME="GENERATOR"CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINKREL="HOME"TITLE="The Codestriker Guide"HREF="book1.html"><LINKREL="PREVIOUS"TITLE="We Want to Hear from You!"HREF="x44.html"><LINKREL="NEXT"TITLE="Configuration"HREF="x107.html"></HEAD><BODYCLASS="CHAPTER"BGCOLOR="#FFFFFF"TEXT="#000000"LINK="#0000FF"VLINK="#840084"ALINK="#0000FF"><DIVCLASS="NAVHEADER"><TABLESUMMARY="Header navigation table"WIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><THCOLSPAN="3"ALIGN="center">The Codestriker Guide: Version 1.9.3</TH></TR><TR><TDWIDTH="10%"ALIGN="left"VALIGN="bottom"><AHREF="x44.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="80%"ALIGN="center"VALIGN="bottom"></TD><TDWIDTH="10%"ALIGN="right"VALIGN="bottom"><AHREF="x107.html"ACCESSKEY="N">Next</A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><DIVCLASS="CHAPTER"><H1><ANAME="AEN49"></A>Chapter 2. Installation</H1><DIVCLASS="TOC"><DL><DT><B>Table of Contents</B></DT><DT>2.1. <AHREF="c49.html#CODESTRIKER-DATABASE-CREATION">Codestriker database creation</A></DT><DT>2.2. <AHREF="x107.html">Configuration</A></DT><DT>2.3. <AHREF="x234.html">Running install.pl</A></DT><DT>2.4. <AHREF="x248.html">Apache webserver configuration</A></DT><DT>2.5. <AHREF="x302.html">IIS configuration</A></DT><DT>2.6. <AHREF="x326.html">Upgrading Codestriker</A></DT></DL></DIV><P> This chapter is concerned with installing Codestriker on yoursystem. 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><DIVCLASS="SECT1"><H1CLASS="SECT1"><ANAME="CODESTRIKER-DATABASE-CREATION">2.1. Codestriker database creation</A></H1><P> Codestriker stores all code review topics and comments into arelational database. Currently,<AHREF="http://www.mysql.com"TARGET="_top">MySQL</A>,<AHREF="http://www.postgresql.org"TARGET="_top">PostgreSQL</A>,Oracle and SQL Server aresupported, but any database system can be used, provided it hasan implementation of Perl's DBI interface, which is the casefor all major database implementations.</P><DIVCLASS="SECT2"><H2CLASS="SECT2"><ANAME="AEN64">2.1.1. Using MySQL</A></H2><P> MySQL can be used on either UNIX or Window platforms. It isavailable for download from<AHREF="http://www.mysql.com"TARGET="_top">http://www.mysql.com</A>.Make sure you use at least version 4.1 or above, as thissupports UTF8 databases.<SPANCLASS="emphasis"><ICLASS="EMPHASIS">Note under Solaris, it seems atthe time of writing that only the 32-bit version of Perl andMySQL (and DBD::mysql) can be used, the 64-bit versionsdon't work.</I></SPAN>For Linux RedHat distributions, the necessary packagesrequired are mysql, mysql-devel, mysql-server, which may ormay not already be present on your system. Depending onyour UNIX operating system, starting mysql will be somethinglike the following:<PRECLASS="PROGRAMLISTING">/etc/rc.d/init.d/mysql start</PRE>For Windows, there will typically be a desktop icon or menushortcut for starting mysqld.</P><P> Once mysql is running, it is necessary to create theCodestriker database and create the codestriker user. UnderUNIX, a command like the following will be required:<PRECLASS="PROGRAMLISTING">% mysql -u root mysql</PRE>For Windows, there should be a shortcut available forgetting a mysql prompt.</P><P> At the mysql prompt, issue the following command, butsubstitute a suitable database password instead of cspasswdas shown here.<PRECLASS="PROGRAMLISTING">CREATE DATABASE codestrikerdb CHARACTER SET utf8;GRANT SELECT,INSERT,UPDATE,DELETE,INDEX,ALTER,CREATE,DROP,REFERENCESON codestrikerdb.* TO codestriker@localhost IDENTIFIED BY 'cspasswd';FLUSH PRIVILEGES;QUIT</PRE></P><P> You can check the Codestriker database at any time from thecommand line, by issuing the following command, andentering the database password:<PRECLASS="PROGRAMLISTING">mysql -u codestriker -D codestrikerdb -p</PRE></P><P> If required, the Codestriker database can be dropped, byentering in the following command at the mysql commandprompt as user root:<PRECLASS="PROGRAMLISTING">DROP DATABASE codestrikerdb;</PRE></P></DIV><DIVCLASS="SECT2"><H2CLASS="SECT2"><ANAME="AEN78">2.1.2. Using PostgreSQL</A></H2><P> At the time of writing PostgreSQL was only available forUNIX platforms, however it is quite possible by the time youare reading this that a version for Windows will be available.The project page for PostgreSQL is:<AHREF="http://www.postgresql.org"TARGET="_top">http://www.postgresql.org</A>.For Linux RedHat distributions, the postgresql,postgresql-server and postgresql-devel packages arerequired. Make sure you are using at least version 7.1, asprior versions had restrictions on the size of "text"fields, making it impractical for use with Codestriker.PostgreSQL can be started with a command like:<PRECLASS="PROGRAMLISTING">/etc/rc.d/init.d/postgresql start</PRE></P><P> To create the Codestriker database and user, enter thefollowing commands:<PRECLASS="PROGRAMLISTING">% createuser --username=postgres -d -A codestriker% createdb -E UTF8 --username=codestriker codestrikerdb</PRE>If the last command claims UTF8 is an unknown encoding, trythe value UNICODE. If that still fails, you have adistribution which wasn't configured with--enable-multibyte. Try downloading the latest version ofPostgreSQL.</P><P> Make sure your <TTCLASS="FILENAME">pg_hba.conf</TT> file issuitable configured, in particular for authentication.This file is often located in<TTCLASS="FILENAME">/etc/postgres</TT>.</P><P> You can check the Codestriker database interactively at anytime with the following command:<PRECLASS="PROGRAMLISTING">% psql -U codestriker codestrikerdb</PRE></P><P> If required, the Codestriker database can be dropped, byentering in the following command:<PRECLASS="PROGRAMLISTING">% dropdb --username=codestriker codestrikerdb</PRE></P></DIV><DIVCLASS="SECT2"><H2CLASS="SECT2"><ANAME="AEN92">2.1.3. Using Oracle</A></H2><P> Codestriker has been deployed under Linux 2.4 usingOracle 8i. If you have Oracle installed, you most likelywill have somebody that can easily create a new Codestrikerdatabase for you. Install the DBD::Oracle Perl module, andmodify the <CODECLASS="VARNAME">$db</CODE> variable in the<TTCLASS="FILENAME">codestriker.conf</TT> file appropriately sothat Codestriker knows how to connect to its database. Anexample is given in the configuration file. For moreadvanced connection strings, please consult the DBD::Oracleman page.</P></DIV><DIVCLASS="SECT2"><H2CLASS="SECT2"><ANAME="AEN97">2.1.4. Using SQL Server</A></H2><P> Codestriker has been deployed using SQL Server on Win32, viathe ODBC interface. The first step is to create a"Codestriker" system data source, by going to "ControlPanel" -> "Administrative Tools" -> "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, "Codestrikerdatabase" for the description textfield, and select theappropriate SQL Server from the server dropdown box, thenclick "Next". Choose the authentication appropriate foryour site, and work your way through the final configurationoptions. Modify the <CODECLASS="VARNAME">$db</CODE> variable in the<TTCLASS="FILENAME">codestriker.conf</TT> file appropriately(see the example) so that Codestriker knows how to connectto this datasource. For more advanced connection settings,please consult the DBD::ODBC man page or online manual.</P></DIV><DIVCLASS="SECT2"><H2CLASS="SECT2"><ANAME="AEN102">2.1.5. Other Databases</A></H2><P> Codestriker uses the Perl DBI package, a portable API thatsupports all the major database systems. The databasecreation code is abstracted so that it can work on adiverse range of database systems. Support for a newdatabase system involves writing a single Perl module in the<TTCLASS="FILENAME">Codestriker::DB</TT> package and registeringit in the <TTCLASS="FILENAME">Codestriker::DB::Database</TT>module. There are a number of example database modulesthere.</P></DIV></DIV></DIV><DIVCLASS="NAVFOOTER"><HRALIGN="LEFT"WIDTH="100%"><TABLESUMMARY="Footer navigation table"WIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top"><AHREF="x44.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="book1.html"ACCESSKEY="H">Home</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top"><AHREF="x107.html"ACCESSKEY="N">Next</A></TD></TR><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top">We Want to Hear from You!</TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"> </TD><TDWIDTH="33%"ALIGN="right"VALIGN="top">Configuration</TD></TR></TABLE></DIV></BODY></HTML>