1.安装mercurial 和 nginx
sudo apt-get install python2.6
sudo apt-get install python-all-dev
sudo apt-get install python-setuptools
sudo easy_install -U mercurial
hg --version
nginx安装方法见我之前的博客。
2.配置中央库
新建一个本地库
mkdir -p /var/hg/depo1
cd /var/hg/depo1
hg init
建立配置文件
vi /var/hg/depo1/hgweb.config
内容如下:
[web]
push_ssl = false
allow_push = *
encoding = "UTF-8"
[paths]
/depo1 = /var/hg/depo1
[hooks]
changegroup = hg update
(配置了一个hook,用于每次客户端push新的修改时,都自动update)
开启服务
hg --cwd /var/hg/depo1 serve -d -a localhost --webdir-conf hgweb.config
(-a localhost就可以杜绝其他人通过8000端口访问该服务器)
3.配置nginx
在 http://trac.edgewall.org/browser/trunk/contrib/htpasswd.py
下载该程序,并拷贝至/etc/nginx目录,用于创建密码文件。
创建密码文件(添加3个用户)
cd /etc/nginx/
python htpasswd.py -c -b htpasswd useraaa1 123
python htpasswd.py -b htpasswd useraaa2 123
python htpasswd.py -b htpasswd useraaa3 123
修改nginx的配置文件
vi /etc/nginx/nginx.conf
在http{}段下增加:
client_max_body_size 20m;
修改nginx的配置文件
vi /etc/nginx/sites-enabled/default
增加如下:
location /depo1 {
root html;
index index.html index.htm;
proxy_pass http://127.0.0.1:8000;
auth_basic "Restricted";
auth_basic_user_file htpasswd;
}
重启ngxin
service nginx restart
4.完成
现在可以在客户端机器通过浏览器访问:
http://hostname/depo1
来浏览中央库;也可以直接通过hg来push和pull。注意这些操作都需要输入上面建立的用户名和密码来验证。
分享到:
相关推荐
在Ubuntu-10.04下搭建Qt开发环境
Ubuntu Server 10.04中文环境乱码解决办法
NULL 博文链接:https://ethanwooblog.iteye.com/blog/1340252
ubuntu-10.04-desktop-amd64.iso.torrent, Ubuntu Lucid amd64位下载种子
Ubuntu 10.04 搭建vsftpd 2.2.2
Ubuntu_10.04上编译Android_2.3Ubuntu_10.04上编译Android_2.3
安装网上其他人的指导,完全安装排错后的总结.
按照网上其他人的指导,完全安装排错后的总结
介绍最新版本Ubuntu10.04的安装,配置,shell编程等内容,快速入门提高的资料。 分两卷: Ubuntu10.04入门教程01 Ubuntu10.04入门教程02
ubuntu 10.04下载源
ubuntu-10.04-torrent ubuntu 10.04的种子
基于Ubuntu10.04下搭建qte开发环境.pdf
ubuntu10.04界面汉化安装包,deb格式。由于包的相互依赖,需用如下命令安装: #dpkg -i language-pack-zh-hans_1%3a10.04+20100421_all.deb language-pack-zh-hans-base_1%3a10.04+20100421_all.deb language-pack-...
目前最为详细的ubuntu10.04上搭建海思3798MV100安卓sdk开发环境的文档了 本人原创,已多次安装验证 需要探讨,请联系我
ubuntu10.04源地址, 替换原始的源,速度很快啊
ubuntu10.04 安装 opencv2.2.0
Ubuntu10.04 Server Oracle Setup
VM7安装Ubuntu 10.04系统 VM7安装Ubuntu 10.04系统