0

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
Brian
  • 59
  • 3
  • 10

1 Answers1

0

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.

Steve Barnes
  • 27,618
  • 6
  • 63
  • 73
  • Does not seem to be the issue `$> pip install mercurial Requirement already satisfied (use --upgrade to upgrade): mercurial in /usr/lib64/python2.6/site-packages Cleaning up...` – Brian Aug 28 '13 at 12:46
  • Have you checked that the python that is used by Apache is that one? – Steve Barnes Aug 28 '13 at 13:44
  • As far as I can tell this is the only version of python installed on the server. In /usr/bin/ I have python, python2 (symlink back to python), and python2.6. Both /usr/bin/python and /usr/bin/python2.6 have the same cksum. – Brian Aug 28 '13 at 14:41
  • Yeah I have seen that blog and used it to get the components configured. I'm guessing that this may need to be compiled from scratch for some reason as well. Was hoping the rpms would work. I'll go ahead and mark this answered. Thanks for your time. – Brian Aug 28 '13 at 16:46
  • My pleasure and all the best! – Steve Barnes Aug 28 '13 at 17:00