Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1045149
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:56:27+00:00 2026-05-16T15:56:27+00:00

I’m setting up my freelance server which will be using Mercurial for all the

  • 0

I’m setting up my freelance server which will be using Mercurial for all the version controlling. Each project will have it’s own folder, with it’s own repository. Which I can then clone from my home computer, work computer or any other computer by going to that particular folder.

I’m wanting to serve these repositories up into a web browser for me to browse visually when I need to. I’ve looked around and seen this: https://www.mercurial-scm.org/wiki/HgServeNginx

That looks like it’s along the right tracks, as I will be using Nginx on this server anyhow. But I’m curious to know how I would correctly set this up. What do I need to do in particular to efficiently serve up multiple repositories on my server through the web browser?

Any help or experienced insight on this would be very helpful to make sure I’m doing this correctly.

Many thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T15:56:28+00:00Added an answer on May 16, 2026 at 3:56 pm

    Using that link, you can configure as many locations as you will have repos. In every repo directory, you need to run hg serve:

    cd repos/repo1;        
    nohup hg serve -p 8000 &
    cd repos/repo2;
    nohup hg serve -p 8001 &
    

    Then you can just proxy all request via nginx to that running hg servers. This is not very good way. This method need manually edit nginx config, run hg serve etc. But this method allow to you create separate auth settings for each repo. So if you plan to share repo with customer, you can easily manage this.

    Instead, you can use special script, which is contributed with mercurial — hgwebdir.
    Detailed info, you can fine on this page: https://www.mercurial-scm.org/wiki/PublishingRepositories#Publishing_Multiple_Repositories

    UPDATE: I have mercurial version 1.6 on server, and for runnung repo web UI we use this script hgwebdir.py:

    #!/usr/bin/env python
    import sys 
    import os
    os.environ["HGENCODING"] = "UTF-8"
    from mercurial.hgweb.hgwebdir_mod import hgwebdir
    from mercurial.hgweb.request import wsgiapplication
    from flup.server.fcgi import WSGIServer
    
    def make_web_app():
       return hgwebdir('/home/hg/hgwebdir.conf')
    
    WSGIServer(wsgiapplication(make_web_app),
           umask=0000,
           bindAddress='/home/hg/hg.sock').run()
    

    hgwebdir.conf is looks like this:

    [web]
    allow_push = some_useronly
    baseurl = 
    push_ssl = false
    [collections]
    /home/hg/repos = /home/hg/repos
    

    To run: nohup hgwebdir.py &, you need flup python module, so: easy_install flup

    Related nginx.conf part is:

    server {
        listen 80;
        server_name hg.example.com;
        gzip off;
        include fastcgi_params;
        location / {
            client_max_body_size 30m;
            auth_basic  "Restricted Area";
            auth_basic_user_file /home/hg/hg.password;
            fastcgi_pass unix:/home/hg/hg.sock;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.