Mercurial+Apache on CentOS 6.4

670 Views Asked by At

Trying to configure apache/mercurial but running into the following error..

[Tue Aug 27 22:51:21 2013] [error] [client xxx.xxx.xxx.xxx] mod_wsgi (pid=32758): Target WSGI script '/var/www/vhosts/hg.xxxxx.net/cgi-bin/hgweb.wsgi' cannot be loaded as Python module.
[Tue Aug 27 22:51:21 2013] [error] [client xxx.xxx.xxx.xxx] mod_wsgi (pid=32758): Exception occurred processing WSGI script '/var/www/vhosts/hg.xxxxx.net/cgi-bin/hgweb.wsgi'.

replacing hgweb.wsgi with a hello world test script works as expected. All software is from CentOS repos.

Here is the traceback from error.log

[Tue Aug 27 22:57:59 2013] [error] Traceback (most recent call last):
[Tue Aug 27 22:57:59 2013] [error]   File "/var/www/vhosts/hg.xxxxx.net/cgi-bin/hgweb.wsgi", line 14, in <module>
[Tue Aug 27 22:57:59 2013] [error]     from mercurial import demandimport; demandimport.enable()
[Tue Aug 27 22:57:59 2013] [error] ImportError: No module named mercurial
1

There are 1 best solutions below

5
On

The traceback is indicating that you do not have mercurial, (for python), installed on the server, you need the python bindings installed before your scripts can use it.

If you don't have admin rights then you will have to contact your administrator but otherwise you could try, on the server running:

sudo pip install mercurial

Update

There is an interesting blog post here on setting up mercurial on centos that suggests that you need to install and build the python mercurial bindings from source.