setting up central mercurial server in ubuntu
来源:互联网 发布:自助授权系统源码 编辑:程序博客网 时间:2024/06/06 12:40
ref: http://phpfour.com/blog/2011/05/setting-up-central-mercurial-server-in-ubuntu/
It’s been a while since we’ve been thinking about moving to Mercurial from Subversion at our company. We were convinced about the benefits of DVCS and chose Mercurial over Git. However, due to pressure at work and some procrastination, the move was delayed a couple times. Finally, today we had the move and the team is already up to speed with it.
Although it’s quite simple to install it in a central server, the different articles on the web had me confused with too many options or with a different distro than Ubuntu. So, here is a dead simple list of things to do for installing Mercurial centrally for your dev team.
1. Log onto your server using SSH
2. Install mercurial from repository:
sudo apt-get install mercurial
3. We need to have a directory to store our Mercurial configuration and repository files, so let’s create one and change it’s owner to the apache user so that apache can access them:
sudo mkdir hg
sudo mkdir hg/repos
sudo chown -R www-data:www-data hg/repos
4. We’ll be creating a configuration that will allow us to host multiple repositories in this server. And we’ll be using CGI to serve the files through Apache:
sudo cp /usr/share/doc/mercurial/examples/hgweb.cgi .
sudo chmod a+x hgweb.cgi
5. We need to show the location of the config file to the CGI script, so open the file hgweb.cgi with nano or vim to update the line with “config = …” with the following and save it.
6. Now let’s create the file /var/hg/hgweb.config and write the location of the repositories:
Enter the following content and save the file:
/var/hg/repos = /var/hg/repos
7. As a final step, we’ll need to update the Apache configuration so that it executes the CGI when requested with a /hg prefix:
sudo nano default
At the end of the defaul virtual host configuration and just before the </VirtualHost> tag, add the following and save it:
AuthType Basic
AuthName "Mercurial repositories"
AuthUserFile /var/hg/hgusers
Require valid-user
8. In order to take effect of the above change, we’ll need to restart apache:
9. Now you should be able to visit the server’s /hg location like http://rbs-server.com/hg from browser. However, you’ll be greeted with a username/password prompt as we’ve enabled that in our apache configuration above. So, lets add some user for our use.
htpasswd -mc hgusers admin
It will ask for the password of the user admin twice and after you enter that, it will be stored in the file hgusers. You can add more users in the similar fashion, just ignore the c parameter as it was used to create the file first time:
htpasswd -m hgusers saeed
...
10. Now visit the /hg path in your browser and you’ll see the empty list of repositories after you authenticate.
11. By default Mercurial only allows pushing changes through SSL, but in our case it was not necessary. Also, we wanted to give all our developers the push access to the repositories. For that, let’s update the system-wide mercurial configuration file /etc/mercurial/hgrc by adding the following lines at the end of the file and saving it:
allow_push = *
push_ssl = false
12. Now that all is set, let’s setup a test repository so that we can clone it in our development machine:
mkdir test
cd test
hg init
This repository can now be accessed through http://rbs-server.com/hg/test and can be cloned in a development machine with the following command (mercurial must be installed already):
hg clone http://rbs-server.com/hg/test
Hope this will make someone’s life easy. Enjoy the beauty of Mercurial!
- setting up central mercurial server in ubuntu
- Setting Up a Telnet Server in Ubuntu
- Setting up Minicom in Ubuntu
- Setting up Mercurial on Mac
- Setting up Qt Development in Ubuntu 9.04
- Setting up Telnet server on Ubuntu
- Setting Up an Ubuntu Subversion Server
- Setting up NFS on Ubuntu 10.04 Server
- Setting up a Mercurial server under IIS7 on Windows Server 2008 R2
- [转]Setting Up an MPICH2 Cluster in Ubuntu 8.04 LTS Server (Quick-Note)
- Setting up OpenCV with Qt Creator in Ubuntu 13.10
- Setting up OpenCV in Eclipse
- 转载:Setting Up ADB/USB Drivers for Android Devices in Linux (Ubuntu)
- Setting Up Transmission-Daemon To Use With Remote GUI In Ubuntu And Debian
- Setting up Automatic NDK Builds in Eclipse
- Setting up OpenGL in an MFC control
- Setting up Automatic NDK Builds in Eclipse
- Setting up Automatic NDK Builds in Eclipse
- Ubuntu grub2 引导修复 与 硬盘引导进入 UbuntuLiveCD
- 多个定时器的使用
- ADO连接数据库字符串大全
- SQL按区间进行group by
- oralce常见异常——ORA-01747: user.table.column, table.column 或列说明无效
- setting up central mercurial server in ubuntu
- 如何将多个文件捆绑成一个可执行文件
- asp.net整站301重定向方法,asp.net整站301重定向方法成功验证方法
- iPhone系统常用文件夹位置
- flex登录界面实例2
- 不带signed或unsigned关键字的char型 无符号数? 有符号数? C标准规定为 Implementation Defined !!!
- 包含arxHeader.h的工程中调用了标准fstream, sstream, iosteam等引发链接问题的解决方案
- 把exe里面的资源通通取出来
- hibernate 4 映射持久化类 | hibernate 实战(第二版) 第4章映射持久化类 | 笔记