3.17. Optional Features

3.17.1. Project webs

Each project can have its own virtual host projectname.projects.gforge.company.com. Location of project files is configured with $groupdir_prefix variable in GForge configuration file. Each project has directory with project's name and contains htdocs subdirectory where Web files are placed. Project directories are created by cronjobs/cvs-cron/usergroup.php.

3.17.1.1. DNS Server Configuration (BIND)

Project virtual hosts require new DNS zone. Making this new zone is similar to making DNS zone for GForge itself.

  1. Declare new zone in gforge.company.com zone:

    projects        IN      NS      ns.projects.gforge.company.com
    

    If DNS server doesn't serve the new projects.gforge.company.com zone, add the following line too:

    ns.projects     IN      A       1.2.3.4
    

    Don't forget to change serial number of gforge.company.com zone!

  2. Create new zone file with following content:

    $TTL    2d
    @       IN      SOA     projects.gforge.company.com. hostmaster.gforge.company.com. (
                                  1         ; Serial
                             172800         ; Refresh
                                900         ; Update retry
                            2419200         ; Expire
                               3600 )       ; Negative Cache TTL
    ;
    @               IN      NS      ns.projects.gforge.company.com.
    @               IN      A       1.2.3.4
    ns              IN      A       1.2.3.4
    
    *               IN      A       1.2.3.4
    
  3. The new zone must be added in main BIND configuration file:

    zone "projects.gforge.company.com" {
            type master;
            file "/dist-specific/path/to/zone-file";
    };
    
  4. Reload BIND and test if all works:

    $ host test.projects.gforge.company.com
    test.projects.gforge.company.com has address 1.2.3.4
    
3.17.1.2. Web Server Configuration (Apache)

Module vhost_alias should be enabled and the following directives should be added to httpd.conf (if /var/www/homedirs/groups is what you have chosen in $groupdir_prefix):

Note

If you want to be FHS-compliant, you may use /var/local/gforge/log and /var/local/gforge/homedirs.

#
#	WARNING - security is degraded by having this
#	on the same machine as the primary GForge
#
NameVirtualHost 1.2.3.4
<VirtualHost 1.2.3.4>
  ServerName        projects.gforge.company.com
  ServerAlias       *.projects.gforge.company.com
  ServerAdmin       webmaster@gforge.company.com
  UseCanonicalName  Off

# You may want to add these files to logrotate, or just use cronolog as shown below
  CustomLog "/var/log/gforge/projects/access.log" combined
  ErrorLog  "/var/log/gforge/projects/error.log"

#  CustomLog "|/usr/bin/cronolog /var/log/gforge/projects/%Y/%m/%d/access.log" combined
#  ErrorLog  "|/usr/bin/cronolog /var/log/gforge/projects/%Y/%m/%d/error.log"

  DocumentRoot        /var/www/homedirs/groups
  VirtualDocumentRoot /var/www/homedirs/groups/%1/htdocs
  <Directory /var/www/homedirs/groups>
    Options Indexes
#
#	WARNING - turning on php will allow any user
#	to upload a php file to your server, and include 
#	the gforge local.inc file and get your password to 
#	connect to the database and have total control.
#
    php_flag engine off
    AllowOverride None
    Order allow,deny
    Allow from all
  </Directory>
  DirectoryIndex index.html index.htm
</VirtualHost>

Note

cronjobs/cvs-cron/usergroup.php copies from cronjobs/cvs-cron/default_page.php to /var/www/homedirs/groups/projectname/htdocs/index.php but the above configuration disables PHP.

3.17.2. Full Text Indexing

If you want to enable full text indexing, follow these steps:

  • Find tsearch2.sql in your distribution of PostgreSQL and run it:

    # su - postgres
    $ psql -f /path/to/tsearch2.sql gforge
    

    Since gforge PostgreSQL user is not superuser, access to some Tsearch2 tables should be additionally granted:

    # su - postgres
    $ psql gforge
    gforge=# GRANT SELECT ON pg_ts_dict TO gforge;
    gforge=# GRANT SELECT ON pg_ts_parser TO gforge;
    gforge=# GRANT SELECT ON pg_ts_cfg TO gforge;
    gforge=# GRANT SELECT ON pg_ts_cfgmap TO gforge;
    
  • Import data definitions:

    $ cd /var/www/gforge/db
    $ psql -U gforge -W -h localhost -f FTI.sql gforge
    $ psql -U gforge -W -h localhost -f FTI-20050315.sql gforge
    $ psql -U gforge -W -h localhost -f FTI-20050401.sql gforge
    $ psql -U gforge -W -h localhost -f FTI-20050530.sql gforge
    
  • Enable Full Text Indexing by setting $sys_use_fti in GForge Configuration File local.inc.

3.17.3. JPGraph

PHP must be compiled with --with-gd, or appropriate package must be installed. Extra fonts for JPGraph are not necessary. Be sure your /etc/gforge/local.inc file contains the proper path to the jpgraph/src/ directory.

Manual installation can be done like this:

# tar -xzf jpgraph-1.19.tar.gz
# mkdir /var/www/jpgraph
# cp -R jpgraph-1.19/src/* /var/www/jpgraph

Note

If you want FHS-compliance, /usr/local/share/jpgraph

When you get your preferred version of JPGraph installed, you will have to edit one setting in jpgraph.php (or jpg-config.php, depending on JPGraph version):

DEFINE("USE_CACHE", false);

Warning

Be careful with JPGraph license: versions > 1.5.2 are not free (as in free speech). You must check license before use.

3.17.4. Perl

If you want to use some of the Perl scripts that access the database, you'll need the DBI and DBD::Pg Perl modules. On Red Hat systems (and variants), you can get them by installing the libdbi and libdbd-pgsql packages. On Debian systems (and variants), the packages are called libdbi-perl and libdbd-pg-perl.

You'll also need to install utils/include.pl to /var/www/gforge/lib/, and put some configuration variables into /etc/gforge/local.pl. In particular, you'll need something like the following in local.pl:

$sys_default_domain = 'gforge.company.com' ;
$sys_dbhost = '192.168.12.34' ;
$sys_dbname = 'gforge' ;
$sys_dbuser = 'gforge' ;
$sys_dbpasswd = 'p455w0rd' ;

3.17.5. Jabber Support

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.

Once you have that user account, server, and password set up, just edit /etc/gforge/local.inc and add the information to the jabber section.

3.17.6. Peer Ratings

Add yourself, and any others you wish, to the “Peer Ratings” project, which should be at /projects/peerrating/ on the website. Make yourself an admininistrator of the project, and then proceed to “rate” other users on the website.

Members of the “Peer Ratings” 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.