Report this

What is the reason for this report?

How do you set up a mercurial server in a Debian droplet?

Posted on March 24, 2016

I am trying to set up the version control tool, Mercurial on my Debian8 droplet on an Apache2 server. Mercurial seems to be installed on my server however when i try to access the repository startpage of the Mercurial server, the following python code from the hgweb.cgi file is being displayed instead. http://128.199.249.221/hg

#!/usr/bin/env python
#
# An example hgweb CGI script, edit as necessary
# See also http://mercurial.selenic.com/wiki/PublishingRepositories

# Path to repo or hgweb config to serve (see 'hg help hgweb')
config = "/var/hg/hgweb.config"

# Uncomment and adjust if Mercurial is not installed system-wide
# (consult "installed modules" path from 'hg debuginstall'):
#import sys; sys.path.insert(0, "/path/to/python/lib")

# Uncomment to send python tracebacks to the browser if an error occurs:
#import cgitb; cgitb.enable()

from mercurial import demandimport; demandimport.enable()
from mercurial.hgweb import hgweb, wsgicgi
application = hgweb(config)
wsgicgi.launch(application)


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

This question was answered by @SphericalCow:

not sure if it is going to help, but i suspect that it is a permissions issue with the “hgweb.cgi” file - perhaps it needs to be set to execute or that it is not configured properly. I haven’t setup mercurial so it is more or less a stab in the dark.

you may wish to look into your apache2 error log files and see if there might be anything there - probably /var/log/apache2/ or something similar on Ubuntu.

View the original comment

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.