Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3310173
  • 博文数量: 258
  • 博客积分: 9440
  • 博客等级: 少将
  • 技术积分: 6998
  • 用 户 组: 普通用户
  • 注册时间: 2009-05-03 10:28
个人简介

-- linux爱好者,业余时间热衷于分析linux内核源码 -- 目前主要研究云计算和虚拟化相关的技术,主要包括libvirt/qemu,openstack,opennebula架构和源码分析。 -- 第五届云计算大会演讲嘉宾 微博:@Marshal-Liu

文章分类

全部博文(258)

文章存档

2016年(1)

2015年(4)

2014年(16)

2013年(22)

2012年(41)

2011年(59)

2010年(40)

2009年(75)

分类: LINUX

2011-02-23 17:20:30

一 apache 和 mercurial的安装
  sudo apt-get install apache2 mercurial meld

二 apache和mercurial的整合
1 sudo cp /usr/share/doc/mercurial/examples/hgweb.cgi  /var/www/
2 修改apache中心配置文件
   sudo vim /etc/apache2/sites-available/default
修改完成如下:
ServerAdmin webmaster@localhost

DocumentRoot /var/www
Options FollowSymLinks
AllowOverride None
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all

ErrorLog ${APACHE_LOG_DIR}/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog ${APACHE_LOG_DIR}/access.log combined

    Alias /doc/ "/usr/share/doc/"
    
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    

#### Added by dylan ###########
ScriptAlias /hg "/var/www/hgweb.cgi"
     AuthType Basic
AuthName "Mercurial repositories"

AuthUserFile /var/www/hgusers
Require valid-user

 


4 建立/var/www/hgweb.config文件,内容如下:
[collections]
/var/hg/repos = /var/hg/repos
[web]
allow_push = *
push_ssl = false

5 添加登录用户和密码
sudo htpasswd -c /var/www/hgusers user1
sudo htpasswd  /var/www/hgusers user2

6 修改hgweb.sgi文件
config = "/var/www/hgweb.config"

7 修改几个文件的权限
sudo chmod a+r /var/www/hgusers
sudo chmod a+x /var/www/hgweb.cgi
sudo chmod a+r /var/www/hgweb.config
sudo chmod -R a+w /var/hg/repos (自己建立,所有仓库都在这个文件夹下:sudo mkdir -p /var/hg/repos)

8

阅读(3605) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~