1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "../../../dtd/docbookx.dtd" [
3 <!ENTITY % authors SYSTEM "../entities/authors.ent">
6 <article lang="en-US" id="installation_guide">
8 <title>GForge Installation Guide</title>
17 <title>Hardware Requirements</title>
19 Hardware requirements are dependent on the number of users that will use the system and how active those users are.
22 For instance, an installation of GForge hosts over 450 users and over 140 projects on a single CPU Pentium 2.4GHz machine with 512 MB of RAM.
25 You can find additionnal information about hardware used by several installations of GForge in the <ulink url="http://gforge.org/docman/view.php/1/52/gforge-sites.html">GForge sites list maintained by Tom Copeland</ulink>.
29 <title>Software Requirements</title>
31 GForge should work correctly on any system configured like this:
34 <listitem><para>Linux Operating System</para></listitem>
35 <listitem><para><ulink url="http://www.postgresql.org/">PostgreSQL</ulink> 7.3 or later</para></listitem>
36 <listitem><para><ulink url="http://www.apache.org/">Apache</ulink> 1.3.22 or later</para></listitem>
37 <listitem><para><ulink url="http://www.openssl.org/">openssl</ulink> 0.9.4 or later</para></listitem>
38 <listitem><para><ulink url="http://www.openssl.org/">mod_ssl</ulink> 2.4.10 or later (included in Apache 2.0 and later)</para></listitem>
39 <listitem><para><ulink url="http://www.php.net/">PHP</ulink> 4.0.4 or later (note that you'll need to have PHP built with the command line interface support, which only comes standard with PHP 4.3 or later)</para></listitem>
40 <listitem><para>php-pgsql (enable it with <literal>--with-pgsql</literal> when building PHP, or install it as package)</para></listitem>
41 <listitem><para>php-mbstring (enable it with <literal>--with-mbstring</literal> when building PHP, or install it as package)</para></listitem>
47 <listitem><para><ulink url="http://turck-mmcache.sourceforge.net">Turck MMCache</ulink> or <ulink url="http://www.php-accelerator.co.uk/">PHP Accelerator</ulink> or any other PHP accelerator (highly recommended)</para></listitem>
48 <listitem><para><ulink url="http://www.gnu.org/software/mailman/">GNU Mailman</ulink> and <ulink url="http://www.python.org/">Python</ulink> (Mailing list support)</para></listitem>
49 <listitem><para><ulink url="http://jabberd.jabberstudio.org/">Jabberd</ulink> (Jabber support)</para></listitem>
50 <listitem><para><ulink url="http://www.aditus.nu/jpgraph/">JPGraph</ulink> (Gantt Charting and Graphing Support)</para></listitem>
51 <listitem><para><ulink url="http://www.perl.org/">Perl</ulink>, <ulink url="http://dbi.perl.org/">DBI module</ulink> and associated <literal>DBD::Pg</literal>.</para></listitem>
54 Successful installations and operations have been done using the following systems:
58 <para>RedHat Enterprise Linux 3 with bundled packages except for a compiled GNU Mailman</para>
61 <para>RedHat Linux 9 with bundled packages except for a compiled GNU Mailman</para>
66 <title>Installation</title>
68 <title>Overview</title>
69 <para>GForge has a lot of different pieces touching a lot of different components in the system. Cronjobs are required to maintain the system, touching lots of files on a daily and hourly basis, including <filename>/etc/*</filename> system files.</para>
70 <para>The plugins that now manage the CVS and SVN functionality have made installation slightly harder because even more files have to be moved into place during installation.</para>
71 <para>The manual installation of GForge is documented below. Be sure to follow each step carefully, check the forums for frequently asked questions, and ask your Apache, Mailman, and PostgreSQL installation questions in the corresponding mailing lists rather than on the GForge forums where little help is available.</para>
74 <title>Installing on Debian</title>
76 You can simply add lines found at <ulink url="http://people.debian.org/~bayle/"/> or <ulink url="http://roland.mas.free.fr/"/> to <filename>/etc/apt/sources.list</filename> and type <command>apt-get install gforge</command> to install a working GForge system, thanks to Christian Bayle and Roland Mas.
79 Note that GForge is now part of official Debian, and so you can find it in all debian mirrors all other the planet. From scratch install snapshot are also available for a guided installation.
83 <title>Installing on RPM-based systems</title>
84 <para>Guillaume Smet makes <ulink url="http://people.openwide.fr/~gsmet/gforge/rpm/">RPM packages for installing GForge</ulink>. If you are using Fedora Core or Red Hat Enterprise Linux, you may want to try them.</para>
87 <title>Installing GForge</title>
89 <title>Directory Layout</title>
90 <para>Instructions below assume that gforge is unpacked into <filename class="directory"><replaceable>/var/www/gforge</replaceable></filename>. There are some other directories where GForge stores files. In this installation guide, they are put in <filename class="directory">/var/www</filename> too.</para>
92 <para>If you want to be <ulink url="http://www.pathname.com/fhs/">FHS</ulink>-compliant, GForge should be unpacked into <filename class="directory">/usr/local/share/gforge</filename>, and directories for storing files should be in <filename class="directory">/var/lib/gforge</filename> or <filename class="directory">/var/local/lib/gforge</filename>.</para>
96 <title>Unpacking</title>
97 <para>To install GForge, follow these steps (as root):</para>
99 # <userinput>bzip2 -dc gforge-4.1.tar.bz2 | tar xvf -</userinput>
100 # <userinput>mv gforge-4.1 <replaceable>/var/www/gforge</replaceable></userinput>
104 <title>GForge Config File</title>
105 <para>In the GForge distribution, you will find <filename>etc/local.inc</filename>. Copy it to <filename>/etc/gforge/local.inc</filename> and edit all of the settings. In later sections, there is more information about specific configuration settings. Usually, you will want to make it readable only by webserver user (see <xref linkend="web-server"/> for <replaceable>apache-user</replaceable>):</para>
107 # <userinput>mkdir /etc/gforge</userinput>
108 # <userinput>cp <replaceable>/var/www/gforge</replaceable>/etc/local.inc /etc/gforge</userinput>
109 # <userinput>chown -R root: /etc/gforge</userinput>
110 # <userinput>chmod -R 644 /etc/gforge</userinput>
111 # <userinput>chown <replaceable>apache-user</replaceable> /etc/gforge/local.inc</userinput>
112 # <userinput>chmod 600 /etc/gforge/local.inc</userinput>
116 <title>Configuring GForge</title>
118 <listitem><para>Login as <literal>root</literal> user</para></listitem>
120 <para>Create a directory <filename class="directory">/etc/gforge</filename></para>
123 <para>Copy the file <filename>local.inc.example</filename> from <filename class="directory"><replaceable>/var/www/gforge</replaceable>/etc/</filename> to <filename class="directory">/etc/gforge/</filename> </para>
126 <para>Open <filename>/etc/gforge/local.inc</filename>, configuring the following basic parameters:</para>
129 <para>Database configuration:</para>
131 $sys_dbhost="localhost"
134 $sys_dbpasswd="gforge"
135 $sys_server="postgres"
139 <para>Change the value of the <varname>$sys_upload_dir</varname> to:</para>
141 $sys_upload_dir='/var/www/download/';
145 <para>Change the value of the <varname>$sys_urlroot</varname> to:</para>
147 $sys_urlroot="<replaceable>/var/www/gforge</replaceable>/www/";
151 <para>The directives <varname>$sys_default_domain</varname> and <varname>$sys_fallback_domain</varname> should contain the domain of your server, e.g. <literal>gforge.org</literal>.</para>
159 <title>Configuring the Database (PostgreSQL)</title>
161 <title>Initialization of PostgreSQL</title>
162 <para>In some distributions, PostgreSQL database cluster is not initialised. Consult distribution documentation for more information. If database cluster is not created, you can do so by running:</para>
164 # <userinput>su - postgres</userinput>
165 $ <userinput>initdb</userinput>
168 <para>This will wipe out any existing PostgreSQL databases!</para>
173 <title>PostgreSQL Authentication Configuration</title>
174 <para>The <literal>postgres</literal> PostgreSQL user is used only during installation. Usually, it can connect via UNIX socket without password when invoked by <literal>postgresql</literal> system account. Check by running this:</para>
176 # <userinput>su - postgres</userinput>
177 $ <userinput>psql template1</userinput>
179 <para>If connection fails, add the following line to <filename>pg_hba.conf</filename>:</para>
181 local all postgres ident sameuser
183 <para>GForge uses <literal>gforge</literal> PostgreSQL user to connect to <literal>gforge</literal> database by using password. (You can change that name by editing <filename>local.inc</filename>.) In order this to work, assure that you have the following line in your <filename>pg_hba.conf</filename>:</para>
185 host gforge gforge 127.0.0.1 255.255.255.255 md5
187 <para>This line assumes that GForge will always use local PostgreSQL database (<literal>localhost</literal>). If this is not the case, consult PostgreSQL manual for ways to allow connection.</para>
188 <para>The following option should be set in <filename>postgresql.conf</filename> because connection to <literal>localhost</literal> uses TCP/IP:</para>
192 <para>After all these changes to PostgreSQL configuration files are made, PostgreSQL should be restarted. This depends on the distribution. In Debian, it's like this:</para>
194 # <userinput>/etc/init.d/postgresql restart</userinput>
198 <title>Importing Database</title>
199 <para>Create GForge database user:</para>
201 # <userinput>su - postgres</userinput>
202 $ <userinput>psql template1</userinput>
203 template1=# <userinput>CREATE USER gforge NOCREATEUSER NOCREATEDB</userinput>
204 template1-# <userinput>PASSWORD '<replaceable>gforge-password</replaceable>';</userinput>
206 <para>Create GForge database:</para>
208 template1=# <userinput>CREATE DATABASE gforge OWNER gforge ENCODING 'UNICODE';</userinput>
210 <para>Add PL/pgSQL support using the commands:</para>
212 # <userinput>su - postgres</userinput>
213 $ <userinput>createlang plpgsql gforge</userinput>
215 <para>Finally, install the database:</para>
217 $ <userinput>cd <replaceable>/var/www/gforge</replaceable>/db</userinput>
218 $ <userinput>psql -a -U gforge -W -f gforge.sql gforge &> /tmp/gforge.sql.log</userinput>
223 <title>Configuring DNS Server (BIND)</title>
224 <para>GForge needs its own domain. In example GForge configuration file, it's <literal>gforge.<replaceable>company.com</replaceable></literal>. Here some example configuration files for BIND are presented that can help you if you are not familiar with BIND but it's not meant to be complete. Don't ask BIND-related questions in GForge forums – consult documentation that come with your distribution and search in Internet. Distributions put files in different places and so there are no file locations here. The example configuration below is only quick start example and doesn't include reverse mapping.</para>
225 <para>New subdomain in <replaceable>company.com</replaceable> should be created. In <replaceable>company.com</replaceable> zone file, it may look like that:</para>
227 gforge IN NS ns.gforge.<replaceable>company.com</replaceable>.
228 ns.gforge IN A <replaceable>1.2.3.4</replaceable>
230 <para>New zone file for <literal>gforge.<replaceable>company.com</replaceable></literal> may look like this:</para>
233 @ IN SOA gforge.<replaceable>example.com</replaceable>. hostmaster.gforge.<replaceable>example.com</replaceable>. (
238 3600 ) ; Negative Cache TTL
240 @ IN NS ns.gforge.<replaceable>example.com</replaceable>.
241 @ IN A <replaceable>1.2.3.4</replaceable>
242 ns IN A <replaceable>1.2.3.4</replaceable>
244 download IN A <replaceable>1.2.3.4</replaceable>
245 upload IN A <replaceable>1.2.3.4</replaceable>
246 shell IN A <replaceable>1.2.3.4</replaceable>
247 users IN A <replaceable>1.2.3.4</replaceable>
248 gfdocs IN A <replaceable>1.2.3.4</replaceable>
249 lists IN A <replaceable>1.2.3.4</replaceable>
250 cvs IN A <replaceable>1.2.3.4</replaceable>
251 svn IN A <replaceable>1.2.3.4</replaceable>
252 scm IN A <replaceable>1.2.3.4</replaceable>
253 ldap IN A <replaceable>1.2.3.4</replaceable>
254 jabber IN A <replaceable>1.2.3.4</replaceable>
255 images IN A <replaceable>1.2.3.4</replaceable>
257 <para>The new zone must be added in main BIND configuration file:</para>
259 zone "gforge.<replaceable>example.com</replaceable>" {
261 file "<replaceable>/dist-specific/path/to/zone-file</replaceable>";
264 <para>Of course, changes will take effect after reloading BIND.</para>
267 <title>Configuring PHP</title>
268 <para>PHP is used in two ways:</para>
271 <para><emphasis>Serving Web pages</emphasis>. In this case, PHP is usually used as module and its configuration is in virtual host configuration, as shown later in document. If you prefer to configure <filename>php.ini</filename>, the following directives are required by GForge:</para>
273 register_globals = On
274 magic_quotes_gpc = On
276 include_path=".:<replaceable>/var/www/gforge</replaceable>:<replaceable>/var/www/gforge</replaceable>/www/include:/etc/gforge"
280 <para><emphasis>Cron jobs and some scripts</emphasis> require PHP Command-Line Interface (CLI). All scripts are invoked with command like this (split into some lines for readability):</para>
283 -d include_path=".:<replaceable>/var/www/gforge</replaceable>:<replaceable>/var/www/gforge</replaceable>/www/include:/etc/gforge"
284 -f cronjobs/mailing_lists_create.php</userinput>
287 <para>The <literal>-f</literal> is optional when using PHP CLI but it's required when PHP CGI executable is used.</para>
289 <para>Instead of using <literal>-d include_path=...</literal>, you may want to set <varname>include_path</varname> in PHP CLI <filename>php.ini</filename>, like already shown above. To find where <filename>php.ini</filename> is located, use the following command:</para>
291 $ <userinput>php4 -i | fgrep php.ini</userinput>
296 <section id="web-server">
297 <title>Configuring the Web Server (Apache)</title>
298 <para>First, you should decide where to put GForge configuration of Apache. It's best if own configuration file that is included by main Apache configuration is used. Consult documentation of your distribution on recommended ways for doing this. Use <filename>etc/gforge-httpd.conf.example</filename> as template for your configuration. The rest of the section is guide to GForge virtual host configuration for Apache. All is inside the following template:</para>
300 NameVirtualHost <replaceable>1.2.3.4</replaceable>
301 <VirtualHost <replaceable>1.2.3.4</replaceable>>
303 <replaceable># Put the rest of the directives here.</replaceable>
309 <para>Set basic virtual host settings:</para>
311 ServerName gforge.<replaceable>company.com</replaceable>
312 ServerAdmin webmaster@gforge.<replaceable>company.com</replaceable>
316 <para>Define log files:</para>
318 CustomLog "<replaceable>/var/log/gforge</replaceable>/access.log" combined
319 ErrorLog "<replaceable>/var/log/gforge</replaceable>/error.log" combined
321 <para>Usual practice is to use <command>logrotate</command> on these files. Alternative is to pipe logs to <command>cronolog</command> which will automatically make directory with <filename>access.log</filename> and <filename>error.log</filename> for each day:</para>
323 CustomLog "|/usr/bin/cronolog <replaceable>/var/log/gforge</replaceable>/%Y/%m/%d/access.log" combined
324 ErrorLog "|/usr/bin/cronolog <replaceable>/var/log/gforge</replaceable>/%Y/%m/%d/error.log" combined
327 <para>In FHS-compliant install, you may want to use <filename class="directory">/var/local/log/gforge</filename> instead of <filename class="directory">/var/log/gforge</filename>.</para>
331 <para>Set up document root:</para>
333 DocumentRoot "<replaceable>/var/www/gforge</replaceable>/www"
334 <Directory "<replaceable>/var/www/gforge</replaceable>/www">
335 Options FollowSymLinks
339 ErrorDocument 404 /404.php
344 <para>Configuring PHP for Apache</para>
345 <para>The configuration for the PHP module for Apache is different for Apache versions 1.3 and 2.0. Follow the instructions for the version installed on your system.</para>
348 <para>Configuring PHP for Apache 1.3</para>
349 <para>Insert the following instructions after the <literal>DocumentRoot</literal> directive:</para>
351 <Location /projects>
352 ForceType application/x-httpd-php
354 <Location /users>
355 ForceType application/x-httpd-php
358 <para>Ensure the following lines are present and not commented out in Apache configuration:</para>
360 LoadModule php_module modules/libphp.so
365 <para>Configuring PHP for Apache 2.0</para>
366 <para>For newer versions of Apache 2.0 (RedHat 9 or above), please follow Apache 1.3 instructions above.</para>
367 <para>Change the existing <literal>Files</literal> directive to:</para>
373 LimitRequestBody 2097152
376 <para>The <literal>LimitRequestBody</literal> directive allows you to limit the maximum number of bytes of a request (including uploads). The default is 524288 (512Kb). This means that you cannot upload files with a size greater than 512Kb. With this directive, we set it to 2MB. If you wish to set this value higher than 2MB, you must also edit the <literal>upload_max_filesize</literal> directive in PHP configuration file.</para>
377 <para>Add the following lines:</para>
379 <Files projects>
395 <para>Set up PHP module:</para>
397 php_flag register_globals On
398 php_flag gpc_magic_quotes On
399 php_flag files_uploads On
400 php_value include_path ".:/etc/gforge:<replaceable>/var/www/gforge</replaceable>:<replaceable>/var/www/gforge</replaceable>/www/include"
401 php_value default_charset "UTF-8"
406 <para>Set up directory index script name:</para>
408 DirectoryIndex index.php
412 <para>Of couse, all changes will take effect only after reloading or restarting Apache.</para>
414 <title>Project webs</title>
415 <para>Each project can have its own vhost. Module <literal>vhost_alias</literal> should be enabled and the following directives should be added to <filename>httpd.conf</filename>:</para>
416 <programlisting><![CDATA[
418 # WARNING - security is degraded by having this
419 # on the same machine as the primary GForge
421 <VirtualHost 192.168.1.1>
422 ServerName projects.gforge.company.com
423 ServerAlias *.gforge.company.com
424 DocumentRoot /var/www/homedirs/groups
425 VirtualDocumentRoot /var/www/homedirs/groups/%1
426 <Directory /var/www/homedirs/groups>
429 # WARNING - turning on php will allow any user
430 # to upload a php file to your server, and include
431 # the gforge local.inc file and get your password to
432 # connect to the database and have total control.
439 DirectoryIndex index.html index.htm
445 <title>Configuring Mail Transport Agent (Any)</title>
447 Add the following line to <filename>/etc/aliases</filename> and run <command>newaliases</command>:
454 <title>File Release System (FRS)</title>
456 Create a directory (e.g. <filename class="directory">/var/lib/gforge/download</filename>) and make it owned by the webserver user (e.g. <literal>apache</literal>). Usually <command>chown -R apache:apache /var/lib/gforge/download</command> will do the trick. This directory will be referenced in the GForge Config File <filename>/etc/gforge/local.inc</filename> as <varname>$sys_upload_dir</varname>.
460 <title>Configuring GNU Mailman</title>
461 <para>GNU Mailman is used to help manage the GForge mailing lists. Mailman is frequently installed in <filename class="directory">/var/mailman/</filename> and the sample vhost shown below will work with this setup without any changes.</para>
462 <para>Cronjobs for Mailman are located in <filename>cronjobs/mail/*</filename>.</para>
463 <para><filename>cronjobs/mail/mailing_lists_create.php</filename> is used obviously to create new mailing lists. You may have to edit the file to change the location of the mailman <filename class="directory">bin/</filename> directory.</para>
464 <para>For all problems with mailman installation and use, contact the mailman mailing lists for help.</para>
465 <para>To install it:</para>
468 <para>Install a GNU Mailman package or compile it</para>
471 <para><command>su</command> to <literal>root</literal> and set the Mailman password by using the <command>mmsitepass</command> command</para>
474 <para>Create directory <filename class="directory">/var/www/mailman/</filename>.</para>
477 <para>Create in <filename>httpd.conf</filename> virtual host for Mailman, adjusting <literal>ScriptAlias</literal> and <literal>Alias</literal> directives:</para>
478 <programlisting><![CDATA[
479 <VirtualHost 192.168.1.1>
480 ServerName lists.gforge.company.com
481 ServerAdmin mailman@lists.gforge.company.com
482 DocumentRoot /var/www/mailman
483 DirectoryIndex index.php index.cgi index.html index.htm
484 ScriptAlias /mailman/ /var/mailman/cgi-bin/
485 Alias /pipermail/ /var/mailman/archives/public/
490 <para>Run the script <filename>gforge/cronjobs/mail/mailing_lists_create.php</filename> (with <command>php -f</command>). This creates any lists that are already in the database.</para>
495 <title>Cron Jobs</title>
497 Cron jobs are in the <filename class="directory">cronjobs/</filename> directory and the <filename>README</filename> file contains a sample crontab. This gives you the basic cronjobs for updating certain statistics and data on the site.
500 <filename class="directory">cronjobs/cvs-cron/</filename> contains scripts useful for creating blank cvs trees and managing the <filename>/etc/groups</filename>, <filename>/etc/passwd</filename> and <filename>/etc/shadow</filename> files. See <filename>cronjobs/README.root</filename> for more info.
503 <filename class="directory">cronjobs/mail/</filename> contains files useful for the creation of new mailing lists in mailman and creating the <filename>/etc/aliases</filename> file.
507 # cp /etc/aliases /etc/aliases.org
508 # cp /etc/shadow /etc/shadow.org
509 # cp /etc/passwd /etc/passwd.org
510 # cp /etc/group /etc/group.org
514 The following command will blow away any existing root crontab:
518 # crontab cronjobs/crontab.in
520 <para>Now edit the paths to the cron scripts by setting the value of <varname>GFORGE</varname> and <varname>PHP</varname> variables:</para>
526 The <filename>cronjobs/cvs-cron/usergroup.php</filename> cron script will meddle with your <filename>/etc/passwd</filename>, <filename>/etc/group</filename>, and <filename>/etc/shadow</filename> files. By default, this cron will save these files with a <literal>.new</literal> extension. You will have to edit the cron script to remove the <literal>.new</literal> extension, but you must make sure that it is properly generating your files or your server could be unusable.
531 <title>Verifying the Installation</title>
532 <para>To verify if everything was installed correctly, use the browser and connect to GForge. You should see the GForge homepage.</para>
534 <para>If you get an <computeroutput>Error: Could Not Connect to Database</computeroutput>, check if you have followed all installation instructions for the database. Also, you can experiment with making the settings in <filename>pg_hba.conf</filename> a bit more trusting - for example, change the last work of the second line from <literal>md5</literal> to <literal>trust</literal>.</para>
538 <title>Creating the Admin User</title>
539 <para>Site admins are anyone who is an admin of <literal>group_id</literal>=1.</para>
541 <listitem><para>Connect to GForge and register a new account.</para></listitem>
542 <listitem><para>Insert a valid email address; this will be used for the account confirmation.</para></listitem>
543 <listitem><para>Open your e-mail client, wait for the email from GForge site and follow the link that appears on the message.</para></listitem>
545 <para>Verify in Account Maintenance the user id of the user registered.</para>
546 <para>Usually this is 102, but you can verify this by running the following SQL query via the PostgreSQL <command>psql</command> utility:</para>
548 $ psql -U gforge gforge
549 gforge=> SELECT user_id FROM users WHERE user_name='<replaceable>YOUR USER NAME</replaceable>';
553 <para>Now set up the newly added user to be a GForge administrator:</para>
555 gforge=> <userinput>INSERT INTO user_group (user_id,group_id,admin_flags)</userinput>
556 gforge-> <userinput>VALUES (<replaceable>102</replaceable>,1,'A');</userinput>
561 <para>Once you have set up this user as an administrator, you can use GForge web interface to add more administrators.</para>
565 <title>Optional Features</title>
567 <title>JPGraph</title>
568 <para>PHP must be compiled with <literal>--with-gd</literal>, or appropriate package must be installed. Extra fonts for JPGraph are not necessary. Be sure your <filename>/etc/gforge/local.inc</filename> file contains the proper path to the <filename class="directory">jpgraph/src/</filename> directory.</para>
569 <para>Manual installation can be done like this:</para>
571 # tar -xzf jpgraph-1.17.tar.gz
572 # mkdir /var/www/jpgraph
573 # mv jpgraph-1.17/src/* /var/www/jpgraph
575 <para>When you get your preferred version of JPGraph installed, you will have to edit one setting in <filename>jpgraph.php</filename>:</para>
577 DEFINE("USE_CACHE", false);
580 <para>Be careful with JPGraph license: versions > 1.5.2 are not free (as in free speech).</para>
585 <para>If you want to use some of the Perl scripts that access the database, you'll need the <literal>DBI</literal> and <literal>DBD::Pg</literal> Perl modules. On Red Hat systems (and variants), you can get them by installing the <literal>libdbi</literal> and <literal>libdbd-pgsql</literal> packages. On Debian systems (and variants), the packages are called <literal>libdbi-perl</literal> and <literal>libdbd-pg-perl</literal>.</para>
586 <para>You'll also need to install <filename>utils/include.pl</filename> to <filename class="directory">/usr/lib/gforge/lib/</filename>, and put some configuration variables into <filename class="directory">/etc/gforge/local.pl</filename>. In particular, you'll need something like the following in <filename>local.pl</filename>:</para>
588 $sys_default_domain = 'gforge.company.com' ;
589 $sys_dbhost = '192.168.12.34' ;
590 $sys_dbname = 'gforge' ;
591 $sys_dbuser = 'gforge' ;
592 $sys_dbpasswd = 'p455w0rd' ;
596 <title>Jabber Support</title>
597 <para>GForge supports the sending of messages to jabber accounts. To accomplish this, you must have a user account setup on the jabber server that gforge can connect to and send messages.</para>
598 <para>Once you have that user account, server, and password set up, just edit <filename>/etc/gforge/local.inc</filename> and add the information to the jabber section.</para>
601 <title>Peer Ratings</title>
602 <para>Add yourself, and any others you wish, to the <quote>Peer Ratings</quote> project, which should be at <literal>/projects/peerrating/</literal> on the website. Make yourself an admininistrator of the project, and then proceed to <quote>rate</quote> other users on the website.</para>
603 <para>Members of the <quote>Peer Ratings</quote> project, who are administrator of the project, become the first trusted users. This is the only way to prime the pump for the peer ratings system.</para>
608 <title>Plugins</title>
610 <para>From GForge 4.0, plugins are necessary as source code management is now provided by plugins (SCM* plugins).</para>
612 <para>For each plugin you can find an <filename>INSTALL</filename> file in the plugin tarball.</para>
616 <title>Overview</title>
617 <para>CVS is now managed via the scmcvs plugin which is included in the <filename class="directory">plugins/</filename> directory in the tarball downloaded from gforge.org. Most of the files in scmcvs are intended for auto-installation on Debian systems and <emphasis role="strong">do not apply</emphasis> to the majority of users. The scmcvs plugin is activated by default in the <filename>gforge.sql</filename> database and all that you have to do is move the <filename>scmcvs/etc/plugins/*</filename> files to <filename>/etc/gforge/plugins/*</filename> and possibly modify the files slightly. In addition, the <filename>scmcvs/www/*</filename> files should be placed in <filename>gforge/www/plugins/scmcvs/*</filename>.</para>
618 <para>Cronjobs for CVS are included in <filename>cronjobs/crontab.in</filename>, but are commented out by default for your security. <filename>cronjobs/cvs-cron/*</filename> contains the files that are executed hourly to build permissions and create blank cvs trees. Make sure these files are executed as root, and have proper execution bits set. Each of these cronjobs has configuration parameters which you may have to edit manually for your specific system.</para>
621 <title>Installation</title>
623 #Create default location for CVS repositories
626 # Optional - Set up basic index.php file for CVS vhost if desired
628 cp <replaceable>/var/www/gforge</replaceable>/cronjobs/cvs-cron/www/* /var/www/cvs/
630 #copy the scmcvs plugin config to /etc/gforge/
631 cp -R <replaceable>/var/www/gforge</replaceable>/plugins/scmcvs/etc/plugins/ /etc/gforge/
633 #make sure the cvs crons are executable
634 cd <replaceable>/var/www/gforge</replaceable>/cronjobs/cvs-cron/
637 <para>You will likely have to edit <filename>/etc/gforge/plugins/scmcvs/cvsweb.conf</filename> to change the cvsroot location:</para>
639 'gforge' => ['GForge-CVS', '/home/chroot/cvsroot/'],
643 <title>Configuring CVS</title>
645 <para>Since GForge 4.0, CVS is integrated by plugin. Look at the plugins section below for more information.</para>
647 <para>GForge uses CVS via <literal>pserver</literal> for anonymous read only access and <literal>ext</literal> for developers to commit to the repositories. To set it up:</para>
648 <para>Download and install the latest CVS package for your distribution.</para>
649 <para>Ensure the following info is in <filename>/etc/services</filename>:</para>
651 $ grep cvspserver /etc/services
652 cvspserver 2401/tcp # CVS client/server operations
653 cvspserver 2401/udp # CVS client/server operations
655 <para>Ensure the following info is in <filename>/etc/xinetd.d/cvspserver</filename> (if it doesn't exist, create a new file with the following text to enable anonymous access):</para>
664 server = /usr/bin/cvs
665 server_args = -f --allow-root=/path/to/my/cvsroot pserver
668 <para>Now add an <literal>anonymous</literal> user to your system with a blank password, or one of <literal>anonymous</literal></para>
671 <title>Configuring CVSWeb</title>
673 <para>Since GForge 4.0, a specific version of CVSWeb is bundled in GForge SCM CVS plugin. You don't need to install CVSWeb anymore.</para>
674 <para>The following instructions are for GForge < 4.0.</para>
677 You can download the latest official CVSWeb release from <ulink url="http://www.freebsd.org/projects/cvsweb.html"/> but you should consider using the one bundled in GForge SCMCVS plugin.
679 <para>Copy the tar.gz file into a tmp directory and unzip it:</para>
681 tar -zxvf cvsweb.tar.gz
683 <para>CVSWeb consists of a Perl script (<filename>cvsweb.cgi</filename>), a configuration file (<filename>cvsweb.conf</filename>), and some icons (<filename>back.gif</filename>, <filename>dir.gif</filename>, etc).</para>
685 <listitem><para>Copy the <filename>cvsweb.cgi</filename> script into Apache's <filename class="directory">cgi-bin</filename> directory</para></listitem>
686 <listitem><para>Copy the <filename>cvsweb.conf</filename> file into Apache's configuration directory (such as <filename class="directory">/etc/httpd/conf.d/</filename> on RedHat 9)</para></listitem>
687 <listitem><para>Edit <filename>cvsweb.conf</filename></para></listitem>
688 <listitem><para>Change <varname>%CVSROOT</varname> hash to include your repositories - note you'll need to have created a repository first, of course.</para></listitem>
689 <listitem><para>Change the <varname>$cvstreedefault</varname> variable to point to a default repository</para></listitem>
690 <listitem><para>With GForge specific CVSWeb, you don't need to add manually projects' repositories.</para></listitem>
691 <listitem><para>Edit <filename>cvsweb.cgi</filename></para></listitem>
692 <listitem><para>Change the <varname>$config</varname> variable to point the <filename>cvsweb.conf</filename> file</para></listitem>
693 <listitem><para>Change the <varname>$PATH</varname> variable in <filename>cvsweb.conf</filename> to point to the directory that contains <command>rlog</command></para></listitem>
695 <para>Possible problems:</para>
698 <para><computeroutput>Error: Configuration not found</computeroutput> - edit <filename>cvsweb.cgi</filename> and point <varname>$config</varname> to the <filename>cvsweb.conf</filename> file</para>
701 <para><computeroutput>Error: Failed to spawn GNU rlog</computeroutput> - ensure <command>rlog</command> is in the directory pointed to by <varname>$ENV{'PATH'}</varname></para>
704 <para>Create in <filename>httpd.conf</filename> virtual host for viewing of CVSWeb:</para>
705 <programlisting><![CDATA[
706 <VirtualHost 192.168.1.1>
707 ServerName cvs.gforge.company.com
708 ServerAdmin webmaster@cvs.gforge.company.com
709 DocumentRoot /var/www/cvs
710 DirectoryIndex index.php cvsweb.cgi index.html index.htm
718 <title>Overview</title>
719 <para>SVN is also managed via plugin – the scmsvn plugin is included and activated by default in GForge. As with scmcvs, you have to move the <filename>scmcvs/etc/plugins/*</filename> files to <filename>/etc/gforge/plugins/*</filename> and may have to make minor modifications for your specific setup.</para>
720 <para>There are two ways to manage SVN – one is to have SVN over DAV and the other is to have SVN over SSH just as you do with CVS. If you choose to use DAV, you will need the <filename class="libraryfile">mod_auth_gforge</filename> library compiled and installed in your apache and the appropriate virtual host settings in your <filename>httpd.conf</filename>. <filename class="libraryfile">mod_auth_gforge</filename> is available from gforge.org. The cronjobs to manage SVN are in <filename class="directory">cronjobs/dav-svn/</filename> and so are sample <filename>httpd.conf</filename> virtual host settings. Each of these cronjobs has configuration parameters which you may have to edit manually for your specific system.</para>
721 <para>Configuring svnserv for svn-over-ssh:
724 <para><ulink url="http://svnbook.red-bean.com/en/1.0/ch06s03.html" /></para>
727 <para><ulink url="http://www.logemann.org/day/archives/000099.html" /></para>
730 <para><ulink url="http://bitworking.org/news/Getting_subversion_svn_ssh____to_work_with_PuTTY" /></para>
736 <title>Installation</title>
738 #Create default location for SVN repositories
741 # Optional - Set up some basic files for SVN-over-DAV only
743 cp <replaceable>/var/www/gforge</replaceable>/cronjobs/dav-svn/www/* /var/www/svn/
745 #copy the scmsvn config files to /etc/gforge/
746 cp -R gforge/plugins/scmsvn/etc/plugins/scmsvn/ /etc/gforge/plugins/
751 <title>CVSTracker Overview</title>
752 <para>The cvstracker plugin allows for some integration between CVS commits and the bug tracker and task manager. So, for example, when you commit, you can reference bug and task IDs in your commit message and have the commit linked to the corresponding bug and task.</para>
753 <para>See the <filename>plugins/cvstracker/README</filename> file for details. This plugin is enabled by default in the <filename>gforge.sql</filename> database file. As with the other plugins, you may manually place the config files in <filename class="directory">/etc/gforge/plugins/cvstracker/</filename> and uncomment the cronjob in <filename>crontab.in</filename>.</para>
754 <para>You will also have to copy the <filename>newcommit.php</filename> file to your gforge <filename class="directory">www/plugins/cvstracker/</filename> dir</para>
757 <title>Installation</title>
759 #copy the cvstracker config files to /etc/gforge/
760 cd <replaceable>/var/www/gforge</replaceable>/plugins/cvstracker/
761 cp -R etc/plugins/cvstracker/ /etc/gforge/plugins/
762 cp -R www/ <replaceable>/var/www/gforge</replaceable>/www/plugins/cvstracker/
767 <title>Upgrading Existing Install</title>
768 <para>You will upgrade your database from a prior version by applying each database schema change, in order, and applying it only once. Only apply the schema changes in the <filename class="directory">db/</filename> folder that are dated <emphasis>after</emphasis> your existing installation.</para>
769 <para>There may also be migration scripts that have to be run. In the <filename class="directory">db/</filename> folder, look for php scripts and run them.</para>
771 <para>You have to apply database schema changes and to run migration scripts in the right order.</para>
775 <title>Most Common Problems</title>
776 <para>Q: I get a blank page when I visit http://gforge.company.com/</para>
777 <para>A: Most often you are missing the php-pgsql library that lets PHP talk to the postgres database. Find a php-pgsql RPM or recompile php to have pgql support.</para>
778 <para>If you're sure you have php-pgsql support, you can edit common/include/database.php and remove the @ symbol from this line:</para>
782 <para>So that it looks like:</para>
786 <para>This will let debug output dump to the screen and may let you find the problem. Search the forums for more solutions.</para>
788 <para>Q: <quote>Error Occurred In the Logger</quote> or other database permission problems</para>
789 <para>A: As stated in the installation instructions, the database must be created, owned, and accessed by the gforge user. This user is the only one who will have total acess to all the tables. Any other user would have to be specifically granted permissions with the GRANT commands in postgres.</para>
791 <para>Q: Reporting or time tracking doesn't work</para>
793 <para>A: Go to the reporting tab and scroll down so you can choose <quote>Initialize/Rebuild Reporting Tables</quote></para>
795 <para>You may also be missing GD support or be missing JPGraph or have it installed improperly. The <filename class="directory">jpgraph/src/</filename> directory should be specified accurately in your <filename class="directory">local.inc</filename> file, and you should include a <filename>/</filename> at the end of the path specified. In addition, you should modify <filename>jpgraph.php</filename> to set <literal>USE_CACHE=false</literal>.</para>
797 <para>Q: How do I upgrade my database?</para>
798 <para>A: As stated above, you must apply the changes that are listed in date order in the <filename class="directory">db/</filename> directory to your database. Only the changes that are not already in your old <filename class="directory">db/</filename> directory should be applied, and they should be applied and checked <emphasis>in order</emphasis>.</para>
800 <para>Q: I'm getting an error about BaseLanguage.class not being found.</para>
801 <para>A: Make sure your localization path is correctly specified in the local.inc file and that it is readable <emphasis>and</emphasis> writable by the apache user.</para>
803 <para>Q: When I click on <quote>/projects/</quote> or <quote>/users/</quote> links, I get the source code instead of the page I expected.</para>
804 <para>A: As shown in the example <filename>httpd.conf</filename> files above, you may have to switch to using the <literal><Files></literal> or <literal><Location></literal> directives depending on your server version.</para>
806 <para>Q: How do I backup GForge?</para>
807 <para>A: The only proper way to backup the gforge database is with <command>pg_dump</command>. Any attempt to backup the filesystem while pgsql is running will result in a useless and corrupt backup. You can backup CVS trees using <command>tar</command> as long as they are not actively and heavily used during the backup. Mailman and the FRS uploads dir can also be backed up with <command>tar</command>.</para>
809 <para>Q: Any time i enter an apostrophe in a text box, i get a parse error</para>
810 <para>A: As stated in the instructions above, you should have <literal>magic_quotes_gpc=On</literal> in your <filename>php.ini</filename> file.</para>
812 <para>Q: Large uploads into FRS or the doc manager fail.</para>
813 <para>A: Apache and the <filename>php.ini</filename> file need to have upload limits and possibly memory limits increased.</para>