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[‘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.