发布新日志

  • 庆祝51Testing软件测试网成立五周年

    2009-04-29 18:14:02

    51testing五周年了,我工作一年,

    我们共同努力,共同进步,加油!!!

  • SVN与Bugzilla整合—(二)下载并安装mod_auth_mysql

    2008-07-29 15:09:38

    下载mod_auth_mysql.tar.gz, 解压后进行目录

    #cd mod_auth_mysql

    运行下列代码, 进行模块链接

    #/usr/local/apache/bin/apxs

    –C –I /usr/local/mysql/include/mysql

    –L /usr/local/mysql/lib/mysql

    –lmysqlclient –lm lz /home/software/mod_auth_mysql/mod_auth_mysql.c

    #/usr/local/apache/bin/apxs –I /home/software/mod_auth_mysql/mod_auth_mysql.a

     

    重新修改apache配置文件httpd.conf

    LoadModule mysql_auth_module /usr/local/mysql/lib/mysql/.libs/mod_auth_mysql.so

    LoadModule dav_svn_module modules/mod_dav_svn.so

    LoadModule authz_svn_module modules/mod_authz_svn.so

    <Location /svn>

     DAV svn

     SVNParentPath /home/svnroot/repository/

     AuthzSVNAccessFile /home/svnroot/repository/authz.conf

     AuthType Basic

     AuthName "Subversion.zoneyump"

     AuthUserFile /home/svnroot/repository/authfile

     Require valid-user

     

    AuthMySQLEnable on

     AuthMySQLHost localhost

    AuthMySQLUser bugs

     AuthMySQLPassword 123

     AuthMySQLNameField login_name

     AuthMySQLPasswordField cryptpassword

    #因为bugzilladefault下是用的是crypt,所以这用的是crypt。请注意在不同的#mod_auth_mysql下这个配制有一点不一样!

     AuthMySQLPwEncryption crypt

    </Location>

  • SVN与Bugzilla整合—(三)Linux下用scmbug将subversion与bugzilla整合

    2008-07-29 15:06:09

    下载的rpm包有四个:

    Scmbug-common

    Scmbug-doc

    Scmbug-server

    Scmbug-tools

    安装时提供docbook-utilsMail::sendmail模块,安装上即可.

    注意: 若安装tar,则运行以下命令:

    bash$ ./configure

    bash$ make

    bash# make install-common

    bash# make install-doc

    bash# make install-tools

    bash# make install-server

    配置scmbug 主要为以下几个部分:

    (1)配置daemon.conf

    安装完scmbug, scmbug自动安装在/etc/scmbug, 进入该目录, 修改daemon.conf文件:

    首先确定bugzilla的安装目录路径

    # Used for Bugzilla and RequestTracker.

    #

    # Path to the directory of the bugtracker sources providing an

    # API that the daemon can use

    installation_directory => ’/home/bugzilla/’

    再确定bugzilla安装参数, bugzilla本地安装installed_locally设置为1

    # Used only for Bugzilla.

    #

    # Flags whether the live bugtracker instance is installed

    # locally on the same machine the daemon is running

    installed_locally => 1,

    最后修改mapping_regexes部分,设置enabled=>1, 并且修改unix user mapping为邮件地址形式(由于bugzilla用户名为邮件地址),此处不设置的话会出现如下错误:

    Scmbug error 77: The userlist mappings are enabled, but no mappings are configured.

    (2)利用scmbug的命令scm_install_glue下载安装glue

    首先确定scmbugserver开启,输入命令

    #/etc/init.d/scmbug-server start

    然后输入如下命令安装glue:

    $ scmbug_install_glue --scm=Subversion \

    --product=Finacingmanagemen --repository=file:///home/svnroot/repository/test \

    --bug=770 --binary-paths=/bin,/usr/bin --daemon=192.168.1.222

    注意:输入产品名称中间最好没有空格,否则报无效产品

    出现以下信息

    This is the installation scrīpt of the Scmbug glue.

    The glue will be installed in repository: file:/// home/svnroot/repository/test

    This is a repository for the Subversion SCM tool.

    The product name in the bug tracking system is Finacingmanagement..

    The integration glue will be committed against bug 770.

    The IP address of the Scmbug integration daemon to contact is 192.168.1.222.

    The binary paths used are: /bin,/usr/bin

    -------------

    Press Enter to continue or Ctrl-C to cancel

    两次回车后安装完毕.

    安装完毕后glue装在/ home/svnroot/repository/test/hooks/etc/scmbug/glue.conf

    (3)由于subversion不能区分提交任务和创建tags或者branches. 所以创建project时要设置subersion中的labeling directories, trunk directories.(建立project时详细描述)

     

    最后一步,在SVN中将project文件夹配置属性,此项设置下回发篇详细的文章细说。

  • SVN与Bugzilla整合—(一)Linux下SVN服务器的搭建与配置

    2008-07-29 15:02:18

    一.   安装

    软件包:httpd-2.23        下载地址http://apache.justdn.org/httpd/httpd-2.2.3.tar.gz
    apr-1.27, apr-util-1.27            
    http://apache.justdn.org/apr/

    安装apr,apr-util
    # tar zxvf apr-1.2.7.tar.gz
    # cd apr-1.2.7
    # ./configure --prefix=/usr/local/apr
    # make&make install
    # tar zxvf apr-util-1.2.7.tar.gz
    # cd apr-util-1.2.7
    # ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
    make&make install
    安装
    apache
    # tar zxvf httpd-2.2.3.tar.gz
    # cd httpd-2.2.3
    # ./configure --prefix=/usr/local/apache --enable-so --enable-rewrite=share --enable-proxy=share --enable-proxy-ajp=share --enable-dav=share --enable-dav-fs --with-apr=/usr/local/apr/ --with-apr-util=/usr/local/aprutil/
    # make&make install

    下载最新的svn压缩包http://subversion.tigris.org/downloads/subversion-1.4.6.tar.gz

    //解压SubVersion安装包 (root用户进行下面的操作)

    # tar xvzf subversion-1.4.6.tar.gz

    //进入解压后的目录

    # cd Subversion-1.4.6

    //配置subversion安装

    #./configure --with-apxs=/usr/local/apache/bin/apxs --prefix=/usr/local/subversion

    --with-apr=/usr/local/apr --with-apr-util=/usr/local/aprutil  --with-ssl --with-zlib

    --enable-maintainer-mode

    //安装

    # make & make install

    .配置

    //创建库文件所在的目录 (svnroot用户进行下面的操作)

    # mkdir /home/svnroot/repository

    //进入subversionbin目录

    # cd /usr/local/subversion/bin

    //创建仓库"test"

    # ./svnadmin create /home/svnroot/repository/test

    # cd /home/svnroot/repository/test

    # ll

    //test里多了许多文件,说明Subversion安装成功了

    //不让其他人有该目录的权限

    # chmod 700 /home/svnroot/repository

    修改Apache配置文件

    # cd /usr/local/apadche/bin

    # vi /usr/local/apache/conf/httpd.conf

      //在最下面添加

      LoadModule dav_svn_module modules/mod_dav_svn.so

      LoadModule authz_svn_module modules/mod_authz_svn.so

      <Location /svn>

      DAV svn

      SVNParentPath /home/svnroot/repository/ //svn父目录

      AuthzSVNAccessFile /home/svnroot/repository/authz.conf //权限配置文件

      AuthType Basic //连接类型设置

      AuthName "Subversion.zoneyump" //连接框提示

      AuthUserFile /home/svnroot/repository/authfile //用户配置文件

      Require valid-user //采用何种认证

      </Location>

      //其中authfile是通过"htpasswd [c] /home/svnroot/repository/authfile username password"来创建的

      //"Require valid-user"告诉apacheauthfile中所有的用户都可以访问。如果没有它,

      //则只能第一个用户可以访问新建库

    # 修改版本库配置文件:
    # vi /home/svnroot/repository/test/conf/svnserve.conf
    内容修改为
    :
    [general]
    anon-access = none
    auth-access = write
    password-db = /home/svnroot/repository/authfile
    authz-db = /home/svnroot/repository/authz.conf
    realm = test

    . 权限管理

    1)增加用户

    # htpasswd [-c] /home/svnroot/repository/authfile wooin

    //第一次设置用户时使用-c表示新建一个用户文件。回车后输入用户密码,完成对用户的增加. 再增加别的用户时,不用加c

    # htpasswd authfile 用户名(加入新的用户)

    2)权限分配

    新建访问权限文件

    # vi /home/svnroot/repository/authz.conf

    注意:
    *
    权限配置文件中出现的用户名必须已在用户配置文件中定义。也就是在前面用htpasswd添加的用户
    *
    对权限配置文件的修改立即生效,不必重启svn

    用户组格式:
    [groups]
    用户组名 = 用户1,用户2
    其中,1个用户组可以包含1个或多个用户,用户间以逗号分隔。

    版本库目录格式:
    [
    版本库:/项目目录]
    @
    用户组名 = 权限

    用户名 = 权限
    其中,方框号内部分可以有多种写法:
    /,
    表示根目录及以下。根目录是svnserve启动时指定的,我们指定为/home/svnroot/repository。这样,/就是表示对全部版本库设置权限。

    test:/,
    表示对版本库test设置权限
    权限主体可以是用户组、用户或*,用户组在前面加@*表示全部用户。权限可以是wrwr和空,空表示没有任何权限。

      [test:/] //这表示,仓库test的根目录下的访问权限

      User1 = rw         //test仓库user1用户具有读和写权限

      User2 = r          //test仓库user2用户具有读权限

      [/] //这个表示在所有仓库的根目录下

      * = r //这个表示对所有的用户都具有读权限

      #[groups] //这个表示群组设置

      #svn1-developers = user1  //这个表示某群组里的成员

      #svn2-developers = user1

    删除Subversion默认安装库文件权限文件authz,passwd
    # rm /home/svnroot/repository/test/conf/authz
    # rm /home/svnroot/repository/test/conf/passwd

    将这个设置完成后。重启Apache,就可以通过

    http://localhost/svn/test

    这个URL来访问仓库了,当然,受权限的限制,必须是合法用户才能访问且具有相应的权限

    . 一些备忘:

    1. svn checkout http://localhost/svn/example

    2. svn commit 时的默认编辑器的环境变量$SVN_EDITOR=vi需要手动设定,用kate好像有问题

    3. 如果linux的登录用户名密码都和svn的其中一个用户名密码相同时,在checkout的时候不会要求输 入用户名密码直接就可以checkout出来。比如:linux有个用户user1svn也有一个用户user1,并且密码 都是一样的,当用user1登录linux后,执行checkout,可以直接提取出源码文件,不用输入认证信息。

    4. svn使用过程中牵扯到几种权限:文件系统的权限,linux系统权限,svn用户的权限,apache进程的权限。

    文件系统的权限,linux系统权限:这里相同的意思,就是平时大家使用linux时文件夹和文件的访问权限。在 svn建立仓库,文件夹,配置文件的时候用svnroot用户,并将仓库权限设置为700,不允许其他用户直接通过 文件系统查看,只能由svnroot进行管理。

    apache进程的权限:因为所有跟仓库传输的操作都是通过apache进程进行的,所以即使你给svn用户设置了 很大的权限,但是apache进程没有访问仓库或者相关文件的权限也没有用,apache进程的权限设置在 /usr/local/apache/conf/httpd.conf 文件中配置,找到文件中的这两行:

    User daemon # daemon改为svnroot,让apache进程以svnroot的身份运行

    Group daemon

    svn用户的权限:就是在repository/authz.conf文件中设置的权限信息,是svn用来管理仓库访问权限的。

    5. svn服务器设置有两种方式:http svnserve。这里介绍的是http方法

    6. /etc/profile的结尾设置一些svn启动时要做的工作 # start apache server for svn

    /usr/sbin/apachectl start

    export SVN_EDITOR=vi

    7. APR libraries 安装 SVN 的时候最好指定 --with-apr= --with-apr-util= 参数到 Apache 安装的根目录

    ServerRoot)下,而不是使用缺省的 SVN 安装包中自带的 apr 。否则如果你安装的 Apache

    版本不同有可能导致 APR 库不匹配,出现类似:

    Can't set position pointer in file '/svn/test/db/revs/1': Invalid argument 的错误。

    Updated 2006-04-20 16:30 -- 比如说如果你安装的是apache 2.2.0版本,就需要在编译安装svn的时候指定

    --with-apxs--with-apr参数到你的apache2.2.0安装目录下:

    ./configure --divfix=${subversionInstallFolder} /

    --with-apxs=${apacheInstallFolder}/bin/apxs /

    --with-apr=${apacheInstallFolder} /

    --with-apr-util=${apacheInstallFolder} /

    --with-ssl /

    --with-zlib /

    --enable-maintainer-mode

数据统计

  • 访问量: 17300
  • 日志数: 30
  • 书签数: 1
  • 建立时间: 2008-07-23
  • 更新时间: 2009-05-07

RSS订阅

Open Toolbar