Tell me more ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am setting up Apache for Mercurial on Ubuntu 12.04.

sudo apt-get install libapache2-mod-wsgi

sudo a2enmod auth_digest

sudo /etc/init.d/apache2 restart

sudo vim /etc/apache2/sites-available/default-ssl

and added this bit to the script

WSGIScriptAlias /hg /var/www/scripts/hgweb.wsgi
        <Directory /var/www/scripts>
                Order allow,deny
                Allow from all
                AuthType Digest
                AuthName "Company Mercurial repositories"
                AuthDigestProvider file
                AuthUserFile /home/ubuntu/hg/hgusers
                Require valid-user
        </Directory>        

And pointing to the config file:

sudo vim /var/www/scripts/hgweb.wsgi

--> Replace config = "/path/to/repo/or/config" with config = "/home/ubuntu/hg/hgweb.config"

Then I created the password for the user like this:

sudo htdigest -c /home/ubuntu/hg/hgusers MyRealm username

Then I gave the script directory and repository directory access from browser:

sudo chown -R www-data:www-data /var/www/scripts
sudo chown -R www-data:www-data /home/ubuntu/hg

Now when I go to https://mysite.com/hg I am asked for the username and password. I enter username and password (without realm) and it doesn't work.

  1. Do I have to bring Realm also somehow into equation? How though?

  2. Is this way of setting it up safe? Are you seeing any potential security leaks the way I setup mercurial?

Many Thanks,

share|improve this question
Alright, I figured out the answer to 1) At password creation theRealm has to be equal to AuthName value. Then it works! It would be great if someone experienced could also comment on 2). Thanks – Kave Jun 7 '12 at 15:46

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.