关闭

hg server in fedora 14

281人阅读 评论(0) 收藏 举报

 

1. Install vervices.

 

yum install mercurial

yum install hg

yum install httpd

yum install mod_wsgi.x86_64

 

2. modify http configuration. Add below lines to /etc/httpd/conf/httpd.conf.

             

####

Alias /hgrepos/ "/var/hg/repos/"

WSGIScriptAlias /hg "/var/hg/scripts/hgweb.wsgi"

<Directory "/var/hg/repos">

    Options FollowSymlinks

    DirectoryIndex index.html

    AllowOverride All

    Order allow,deny

    Allow from all

</Directory>

<Directory "/var/hg/scripts">

    Options ExecCGI FollowSymlinks

    AllowOverride All

    Order allow,deny

    Allow from all

</Directory>

<Location /hg>

    AuthType Basic

    AuthName "Mercurial repositories"

    AuthUserFile /var/hg/hgusers

    <LimitExcept GET>

        Require valid-user

    </LimitExcept>

</Location>

###

 

3.create directory.

 

3.1 hg directory

mkdir /var/hg

 

 3.2 scripts

  mkdir /var/hg/scripts

  change directory to /var/hg/scripts. Create hgweb.config and hgweb.wsgi 2 files.

 

In hgweb.config:

####

[collections]

/var/hg/repos = /var/hg/repos

 

[trusted]

users = *

 

[web]

allow_push = *

push_ssl = false

##### 

 

  In hgweb.wsgi.

#####

config = "/var/hg/scripts/hgweb.config"

import cgitb; cgitb.enable()

from mercurial.hgweb import hgweb

application = hgweb(config)

#####

 

3.2 create repos directory in /hg/var.

   mkdir /var/hg/repos

 

   create test directory for example:

   mkdir test directory in /var/hg/repos/test.

  

   Initialize test directory by below command:

      hg init /var/hg/repos/test

 

4. restart httpd service.

    service httpd restart

 

5. htpasswd -c /var/hg/hgusers USERNMAE

 

6. change dirctory mode:

      chmod –R 777 /var/hg

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:16112次
    • 积分:233
    • 等级:
    • 排名:千里之外
    • 原创:8篇
    • 转载:17篇
    • 译文:0篇
    • 评论:0条
    文章分类