sintonia/livesupport/doc/gettingStarted.html

224 lines
9.9 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
<title>Getting started with the LiveSupport development environment</title>
<meta content="$Author: maroy $" name="author">
</head>
<body>
<h1>Preface</h1>
This document is part of the <a href="http://livesupport.campware.org/">LiveSupport</a>
project, Copyright © 2004 <a href="http://www.mdlf.org/">Media
Development Loan Fund</a>, under the GNU <a
href="http://www.gnu.org/licenses/gpl.html">GPL</a>.<br>
<ul>
<li>Author: $Author: maroy $</li>
<li>Version: $Revision: 1.15 $</li>
<li>Location: $Source:
/home/cvs/livesupport/doc/gettingStarted.html,v $</li>
</ul>
<h1>Scope</h1>
This document describes how to set up the LiveSupport development
environment.<br>
<h1>Introduction</h1>
LiveSupport uses a well-defined <a
href="developmentEnvironment/index.html">development environment</a>.
Most of the LiveSupport-specific files are included in the version
control system, but some preparation and setup has to be made on system
used to develop LiveSupport as well.<br>
<h1>Steps<br>
</h1>
The following steps needed to be taken for setting up the LiveSupport
development environment.<br>
<ul>
<li>install development tools<br>
</li>
<li>set up additional system resources</li>
<li>check out the sources</li>
<li>set up tools used by LiveSupport</li>
<li>personalize your development environment<br>
</li>
</ul>
<h2>Install development tools</h2>
Install all the tools needed for the development of LiveSupport. Please
see the <a href="developmentTools.html">development tools</a> document
for a list of tools needed.<br>
<h2>Set up additional system resources</h2>
The LiveSupport development environment uses some system resources,
that are not reasonable to include in the environment itself.<br>
<h3>Test database<br>
</h3>
One such
resource is an ODBC datasource to a test database. This
database has to be accessible for executing the test suites and
applications within the LiveSupport development environment.<br>
<br>
First, LiveSupport expects a <a href="http://www.postgresql.org/">PostgreSQL</a>
database, and an ODBC
Data Source accessible to it through <a href="http://www.unixodbc.org/">unixODBC</a>.
Please refer to the documentation of these tools to set them up.<br>
<br>
The test environment assumes that it can connect to the PostgreSQL
database as localhost via a TCP/IP connection, as the user test. To
achieve this access, please make sure to edit <code>postgresql.conf</code>
(usually <code>/var/lib/postgres/data/postgresql.conf</code>), to have
to following line:<br>
<br>
<pre><code>tcpip_socket = true</code></pre>
<br>
and also edit <code>pg_hba.conf</code> (usually <code>/var/lib/postgres/data/pg_hba.conf</code>)
to include the following line, before other lines related to access
through localhost:<br>
<br>
<pre><code>host&nbsp;&nbsp;&nbsp; all&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; all&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 127.0.0.1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 255.255.255.255&nbsp;&nbsp; password</code></pre>
<br>
After the above two manual edits to the PostgreSQL configuration,
execute the script <code>livesupport/bin/setup_test_db.sh</code> , as
root to create the required database user, database and ODBC datasource.<br>
<h3>Web server<br>
</h3>
Second, LiveSupport expects:
<ul>
<li><a href="http://httpd.apache.org/">Apache</a> httpd server
running on the development computer</li>
<li><a href="http://www.php.net/">PHP</a> interpreter</li>
<li><a href="http://www.php.net/">PHP</a> apache module</li>
<li><a href="http://www.php.net/domxml">DOMXML</a> PHP extension - an
XMLv2 module for PHP<br>
</li>
<li><a href="http://www.postgresql.org/">PostgreSQL</a> support in PHP</li>
<li><a href="http://pear.php.net/">PEAR</a> modules (may be checked: <code>pear
list</code> and installed by e.g.: <code>pear install DB</code>):</li>
<ul>
<li>DB</li>
<li>Calendar (available in Beta Version 0.5.2, so use <code>pear&nbsp;install&nbsp;Calendar-0.5.2</code>)
<br>
</li>
<li>File</li>
<li>File_Find</li>
<li>HTML_Common</li>
<li>HTML_QuickForm</li>
<li>XML_Beautifier</li>
<li>XML_Parser</li>
<li>XML_RPC</li>
<li>XML_Serializer-0.15.0</li>
<li>XML_Util</li>
</ul>
<!-- <li><a href="http:///"></a></li>-->
</ul>
<h2>Check out the sources</h2>
The LiveSupport development directory tree can be accessed via
anonymous <a href="https://www.cvshome.org/">CVS</a>, using the
CVSROOT <code>:pserver:anonymous@netfinity-5.mdlf.org:/home/cvs</code>.
The repository is called livesupport, thus the following CVS command
would check out the development tree:<br>
<pre><code><br>cvs -z3 -d </code><code>:pserver:anonymous@netfinity-5.mdlf.org:/home/cvs checkout livesupport<br><br></code></pre>
This will check out and create the LiveSupport development <a
href="developmentEnvironment/directoryStructure.html">directory
structure</a>.<br>
<h2>Set up tools</h2>
LiveSupport uses widely available tools for development, like the GNU
C++ compiler, but also uses more specific tools. As these tools, or the
exact versions of these tools are not expected to be installed on the
development system, the LiveSupport development environment contains
them. The tools are installed into the <code>livesupport/usr</code>
directory, as described in the directory structure document.<br>
<br>
Moreover, some components in livesupport have to be set up prior to
compilation, for example running autoconf or similar configuration
programs. This ensures that the components compile fine on the
development system.<br>
<br>
To achieve all these goals, invoke the target <code>setup</code> in
the main <code>Makefile</code>, at the root of the LiveSupport
directory structure, by issuing the following command in the
livesupport directory:<br>
<pre><code><br>cd livesupport<br>make setup<br><br></code></pre>
The execution of this command will take a while, as all the supporting
libraries and tools are compiled and installed to the <code>livesupport/usr</code>
directory. Please note that nothing is installed outside of the
LiveSupport directory structure.<br>
<h2>Personalize your LiveSupport development environment</h2>
The LiveSupport development environment can be run in two ways: either
only one developer actively doing LiveSupport development on the
system, or multiple developers sharing a system for LiveSupport
development. In the former case, only one database instance, scheduler
daemon and apache (XML-RPC and HTTP/HTML) entry point is needed. In the
latter case, each user will have their own database instance, scheduler
daemon and apache entry points.<br>
<h3>Only one developer doing development on the system<br>
</h3>
If only one developer is doing development on the system, there is no
need to personalize the resources used by the development environment.
The following resources are expected on the system.<br>
<br>
LiveSupport expects an ODBC Data Source with the following parameters:<br>
<ul>
<li>DSN: <code>LiveSupport-test</code></li>
<li>username: <code>test</code></li>
<li>password: <code>test</code></li>
</ul>
This data source should point to a PostgreSQL instance of the same
name. Only one
developer at the time should access this datasource, as the test suites
regularly create and destroy database tables.<br>
<br>
The scheduler daemon will use the port 3344.<br>
<br>
Please, check settings in <code>var/conf.php</code> files in both
storageServer and archiveServer modules and create two
symlinks with name corresponding to 'URL configuration' part of
<code>var/conf.php</code> files - example for default values:
<ul>
<li> <code>http://localhost:80/livesupportStorageServer/</code>
should point to the <code>&lt;livesupport-cvs&gt;/modules/storageServer/var</code>
directory </li>
<li> <code>http://localhost:80/livesupportArchiveServer/</code>
should point to the <code>&lt;livesupport-cvs&gt;/modules/archiveServer/var</code>
directory </li>
<li> <code>http://localhost:80/YOUR-CHOICE/</code>
should point to the <code>&lt;livesupport-cvs&gt;/modules/htmlUI/var</code>
directory </li>
</ul>
Please make <code>&lt;livesupport-cvs&gt;/modules/htmlUI/var/templates_c/</code>
and
<code>&lt;livesupport-cvs&gt;/modules/htmlUI/var/html/img/</code>
writable for
apache.
<h3>Multiple developers doing development on the system</h3>
In case multiple developers are sharing a system for LiveSupport
development, each resource has to be personalized. Please run the <code>livesupport/bin/user_setup_db.sh</code>
script as <code>root</code> to make the appropriate steps for
personalization. The script expects the name of the user as a mandatory
parameter, e.g. invoke as:<br>
<br>
<pre><code>cd livesupport<br>./bin/user_setup_db.sh --user ls_developer_user<br></code></pre>
<br>
The script will set up the following resources:<br>
<ul>
<li>a PostgreSQL user named <code>test</code> with the password <code>test</code>
(if it does not exist)</li>
<li>a PostgreSQL database named <code>LiveSupport-ls_developer_user</code></li>
<li>an ODBC data source of the same name</li>
<li>define a user-specific port for the scheduler daemon<br>
</li>
<li>make certain the directories in the development environment are
writable by <code>apache</code></li>
<li>create personalized configuration files in <code>~/.livesupport/</code></li>
<li>create symlinks from <code>~/public_html/</code> to XML-RPC and
HTML entry points</li>
</ul>
After running the above script, the livesupport development environment
for the specified user will be unique on the system, and will not
conflict with resources used by other developers. For example, the
LiveSupport HTML user interface for the user will be reachable at:<br>
<br>
<pre><code>http://localhost/~ls_developer_user/livesupport/htmlUI/var<br><br></code></pre>
<h1>Ready to roll</h1>
With the above steps completed, the LiveSupport modules and products
are ready to be compiled and developed further. Have fun!<br>
<br>
<br>
</body>
</html>