Setting Up A Source Control Server with Domino LDAP : Part 6

So now we need to configure phphgadmin so it will work with our Mercurial server. lets start by editing the configuration file.

sudo vi /var/www/wordpress/admin/application/config/phphgadmin.php

There are quite a few edits that we need to do to this file to get everything working. First we need to set the base URL so find the line starting $config[‘base_url’] and set the value to something like

$config[‘base_url’] = “http://yourserver/admin/”

When you create a new repository your can have a number of default values preset by changing the following lines. I suggest setting allowpull to ‘true’ to allow people to clone the repositories and push_ssl to false to allow contributors to push changes to the repository over http. the allow_read should be set to * to allow anybody, including anonymous, to clone the repository and the allow_push can either be * to allow all authenticated users push changes back up to the repository or you can put in usernames to restrict it to specific people.

$config[‘default_hgrc’][‘general’][‘paths’][‘default’] = ‘%1$s%2$s’;
$config[‘default_hgrc’][‘general’][‘web’][‘allow_archive’] = ”;
$config[‘default_hgrc’][‘general’][‘web’][‘allow_push’] = ‘*’;
$config[‘default_hgrc’][‘general’][‘web’][‘allowpull’] = ‘true’;
$config[‘default_hgrc’][‘general’][‘web’][‘allow_read’] = ‘*’;
$config[‘default_hgrc’][‘general’][‘web’][‘contact’] = ‘your@email.address’;
$config[‘default_hgrc’][‘general’][‘web’][‘description’] = ”;
$config[‘default_hgrc’][‘general’][‘web’][‘name’] = ‘%2$s’;
$config[‘default_hgrc’][‘general’][‘web’][‘push_ssl’] = ‘false’;
$config[‘default_hgrc’][‘general’][‘web’][‘style’] = ‘monoblue’;
Next scroll down through the file till you find the lines starting with $config[‘profile’][‘default’] and edit the lines to read as follows, making sure to change the url to your servers url.
$config[‘profile’][‘default’][‘ini’] = ‘/var/hg/hgweb.config’;
$config[‘profile’][‘default’][‘default_repo_dir’] = ‘/var/hg/repos/’;
$config[‘profile’][‘default’][‘hgserve_url’] = ‘http://yourserver/hg/’;
$config[‘profile’][‘default’][‘default_hgrc’] = $config[‘default_hgrc’][‘general’];

You should also delete the 4 lines that start with $config[‘profile’][‘test’] as we don’t need them.

Save the file and then perform the following commands to enable the Apache Rewrite module and restart the apache server. You also need to give special permissions to a lock directory for phphgadmin.

sudo chown www-data:www-data /var/www/wordpress/admin/lock
sudo a2enmod rewrite
sudo /etc/init.d/apache2 restart

You should now be able to go to http://yourserver/admin and be able to create new Mercurial repositories.

Tagged with: , , , , ,
Posted in Uncategorized
%d bloggers like this: