By luishengjie8
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!
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.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.