214 lines
8.4 KiB
HTML
214 lines
8.4 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 Campcaster development environment</title>
|
|
<meta content="$Author$" name="author">
|
|
</head>
|
|
<body>
|
|
<h1>Preface</h1>
|
|
This document is part of the <a href="http://campcaster.campware.org/">Campcaster</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$</li>
|
|
<li>Version: $Revision$</li>
|
|
<li>Location: $URL$</li>
|
|
</ul>
|
|
<h1>Scope</h1>
|
|
This document describes how to set up the Campcaster development
|
|
environment.<br>
|
|
|
|
<h1>Introduction</h1>
|
|
Campcaster uses a well-defined <a
|
|
href="developmentEnvironment/index.html">development environment</a>.
|
|
Most of the Campcaster-specific files are included in the version
|
|
control system, but some preparation and setup has to be made on system
|
|
used to develop Campcaster as well.<br>
|
|
<br>
|
|
There is a simplified and Ubuntu-centric version of this document in the
|
|
<a href="http://code.campware.org/projects/campcaster/wiki/DevelopmentEnvironment">
|
|
Campcaster Trac wiki</a>.
|
|
|
|
<h1>Steps<br>
|
|
</h1>
|
|
The following steps needed to be taken for setting up the Campcaster
|
|
development environment.<br>
|
|
<ul>
|
|
<li>install development tools<br>
|
|
</li>
|
|
<li>set up additional system resources</li>
|
|
<li>check out the sources</li>
|
|
<li>configure the environment<br>
|
|
</li>
|
|
<li>set up tools used by Campcaster</li>
|
|
<li>personalize your development environment<br>
|
|
</li>
|
|
</ul>
|
|
<h2>Install development tools</h2>
|
|
Install all the tools needed for the development of Campcaster. 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 Campcaster 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 Campcaster development environment.<br>
|
|
<br>
|
|
First, Campcaster 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.<br>
|
|
<br>
|
|
In newer versions of PostgreSQL (≥ 8), TCP/IP connections from localhost
|
|
are enabled by default. If you are using an older version, do the following:
|
|
<ul>
|
|
<li>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>
|
|
<li> 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 all all 127.0.0.1 255.255.255.255 password</code></pre>
|
|
<br>
|
|
After the above two manual edits to the PostgreSQL configuration,
|
|
restart the postgresql daemon.<br>
|
|
</ul>
|
|
|
|
|
|
<h3>Web server<br>
|
|
</h3>
|
|
Second, Campcaster 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> PHP iconv extension (--with-iconv)<br>
|
|
<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> </li>
|
|
</ul>
|
|
|
|
<h3>Apache group membership</h3>
|
|
The setup script assumes that the current user is a member of the Apache group.
|
|
Add the user who will be using the development environment to this group;
|
|
it's usually called <code>apache</code>; on debian-based systems, it is
|
|
called <code>www-data</code>.
|
|
|
|
<h3>Apache configuration</h3>
|
|
The storage server uses some directives which are not enabled by default.
|
|
To enable them, find the configuration file for the userdir module of
|
|
apache, and change the <code>AllowOverride</code> directive in the
|
|
<code><Directory /home/*/public_html></code> section to <code>All</code>.
|
|
<br><br>
|
|
|
|
<h2>Check out the sources</h2>
|
|
The Campcaster development directory tree can be accessed anonymously via
|
|
<a href="http://subversion.tigris.org/">Subversion</a>, at
|
|
<code>svn+ssh://code.campware.org/home/svn/repo/campcaster/trunk/campcaster</code>.
|
|
The following Subversion command
|
|
would check out the development tree:<br><br>
|
|
<pre><code>svn checkout svn+ssh://code.campware.org/home/svn/repo/campcaster/trunk/campcaster</code></pre><br>
|
|
This will check out and create the Campcaster development <a
|
|
href="developmentEnvironment/directoryStructure.html">directory
|
|
structure</a>.<br>
|
|
<br>
|
|
|
|
<h2>Configure the environment</h2>
|
|
First, you need to create the database and ODBC data source used by
|
|
Campcaster. This is done most easily by running the script
|
|
<code>campcaster/bin/user_setup_db.sh</code>.
|
|
Run the scripts as root, and provide your user name with the
|
|
<code>--user</code> option:
|
|
|
|
<pre><code>
|
|
cd campcaster
|
|
sudo ./bin/user_setup_db.sh --user=<ls_developer_user>
|
|
</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>Campcaster-<ls_developer_user></code></li>
|
|
<li>an ODBC data source of the same name, with user name
|
|
and password <code>test</code></li>
|
|
</li>
|
|
</ul>
|
|
<br>
|
|
|
|
Next (and last), you compile the code and set up the configuration files.
|
|
Both are done by the script
|
|
<pre><code>
|
|
cd campcaster
|
|
./bin/setupDevelopmentEnvironment.sh --apache-group=<apache_group>
|
|
</code></pre>
|
|
<br>
|
|
This script will set up the libraries used by Campcaster (by compiling
|
|
and installing them under campcaster/usr), and set up the development
|
|
environment for all Campcaster modules.<br>
|
|
<br>
|
|
It will also create your personalized configuration files under
|
|
<code>~/.campcaster</code>, make certain directories writable for Apache
|
|
(this is where we need the current user to be a member of the
|
|
<code>apache</code> group), define a user-specific port for the scheduler
|
|
daemon, and create a symlink in <code>~/public_html/</code> to the PHP
|
|
entry points.<br>
|
|
<br>
|
|
After running the above script, the campcaster development environment
|
|
for the current user will be unique on the system, and will not
|
|
conflict with resources used by other developers. For example, the
|
|
Campcaster HTML user interface for the user will be reachable at:<br>
|
|
<pre><code>
|
|
http://localhost/~<ls_developer_user>/campcaster/htmlUI/var
|
|
</code></pre>
|
|
<br>
|
|
|
|
<h2>Single-user setup</h2>
|
|
It is also possible to set up a shared configuration, instead of the
|
|
per-user setup described in the previous section.<br>
|
|
<br>
|
|
To do this, use the script <code>test_setup_db.sh</code> instead of
|
|
<code>user_setup_db.sh</code>. You will also need to manually execute
|
|
the commands in <code>setupDevelopmentEnvironment</code> up to, and not
|
|
including, the call to <code>user_setup.sh</code>; and manually execute
|
|
the "Setup storage server" and "Setup directory permissions" portions
|
|
of the <code>user_setup.sh</code> script. Finally, create a symlink
|
|
<code>campcaster</code> in the root data directory of the Apache server
|
|
which points to <code>campcaster/src/modules/</code>.
|
|
The address of the HTML interface will now be<br>
|
|
<pre><code>
|
|
http://localhost/campcaster/htmlUI/var
|
|
</code></pre>
|
|
<br>
|
|
After this, the development environment should work, using the default
|
|
configuration files. NOTE: this single-user method has not been used by any
|
|
developers for quite some time, so these instructions may be
|
|
out of date or incomplete.<br>
|
|
<br>
|
|
|
|
<h1>Ready to roll</h1>
|
|
With the above steps completed, the Campcaster modules and products
|
|
are ready to be compiled and developed further. Have fun!<br>
|
|
<br>
|
|
<br>
|
|
</body>
|
|
</html>
|