浏览器访问svn

时间:2022-01-07 09:13:16

文章转自https://www.cnblogs.com/ayanmw/archive/2011/12/19/2294054.html

你看到的这个文章来自于http://www.cnblogs.com/ayanmw

基本的安装包有: subversion /httpd/ svn的httpd的mod_dav_svn mod_authz_svn 两个模块.(yum install mod_dav_svn subversion httpd )

svn的服务形式应该是有两种: 1 通过svnserve建立的 通过svn://ip:port 端口默认是3690,这种形式; 2 通过apache httpd或者其他的web服务器的扩展模块,进行svn管理

对于svnserve,通过svnserve -d -r /var/www/svn 这种形式建立 daemon的后台进程,但是结束要 kill `pgrep svnserve` 这种形式 来kill掉,不知道有没有直接的比如 stop的方式.

通过http服务器来管理svn也很不错,可以很方便的浏览.其配置过程如下(首先几个软件都安装,这就不用说了.):

1.在 /etc/httpd/module下面 有两个 mod 关于 svn的.

2.在/etc/httpd/config.d/下有一个subversion.conf(没有就建立一个),其内容是:

浏览器访问svn
LoadModule dav_module         modules/mod_dav.so
LoadModule dav_svn_module modules/mod_dav_svn.so
<Location /svn>
DAV svn
SVNPath /var/www/svn/
AuthType Basic
AuthName "Subversion repos"
AuthUserFile /var/www/svn/repos1/conf/passwd
Require valid-user
</Location>

# To create a new repository "http://localhost/repos/stuff" using
# this configuration, run as root:
#
# # cd /var/www/svn
# # svnadmin create stuff
# # chown -R apache.apache stuff
# # chcon -R -t httpd_sys_content_t stuff

#<Location /repos>
# DAV svn
# SVNParentPath /var/www/svn
#
# # Limit write permission to list of valid users.
# <LimitExcept GET PROPFIND OPTIONS REPORT>
# # Require SSL connection for password protection.
# # SSLRequireSSL
#
# AuthType Basic
# AuthName "Authorization Realm"
# AuthUserFile /path/to/passwdfile
# Require valid-user
# </LimitExcept>
#</Location>

浏览器访问svn

其中/var/www/svn是准备放仓库的目录,这个目录可以放置多个代码仓库,AuthUserFile就是用户和密码的文件,也可以移动到其他地方单独管理.

/var/www/svn 下面可以通过 svnadmin createa /var/www/svn/repos1 来建立一个空的仓库.还可以建立多个仓库;这个目录貌似最好 给apche用户所有权限:chown -R apache.apache /var/www/svn ;在repos1/conf目录下可以进行一些账号密码 配置,就不多说了.建立的其他仓库 可以拷贝这些conf文件

其中AuthUserFile 是如何制作的呢?

浏览器访问svn
创建“ AuthUserFile ”设置所需的用户密码以及存储的文件

使用 apache bin/htpasswd 命令来创建。命令的格式为

htpasswd [-cmdpsD] passwordfile username

若第一次创建用户,我们必须使用参数“-c”来同时创建用户密码文件

htpasswd -c passwd robert

上述命令创建的一个文件“ passwd”,同时在文件里添加了一个 user named “robert”,执行该命令时会要求输入密码。

注意:创建第二或之后的用户时,一定不能用参数“ c ”,否则之前的用户就会被删除。

如果想要删除某个用户,我们可以使用下列命令:

    htpasswd -D passwd robert

这样, robert就被从 passwd中删除了。
浏览器访问svn

下面就是一个示例,创建两个用户 a b,密码 aaa,bbb,再删除。查看密码文件内容:

浏览器访问svn
[root@src-server websvn]# htpasswd accesspwd a
htpasswd: cannot modify file accesspwd; use '-c' to create it
[root@src-server websvn]# htpasswd -c accesspwd a
New password:
Re-type new password:
Adding password for user a
[root@src-server websvn]# ll accesspwd
-rw-r--r-- 1 root root 16 Jun 23 02:03 accesspwd
[root@src-server websvn]# htpasswd accesspwd b
New password:
Re-type new password:
Adding password for user b
[root@src-server websvn]# cat accesspwd
a:wpEqdKjINQsvM
b:JEpHUbhZZP3fc
[root@src-server websvn]# htpasswd -D accesspwd b
Deleting password for user b
[root@src-server websvn]# cat accesspwd
a:wpEqdKjINQsvM
[root@src-server websvn]#
浏览器访问svn

3. sudo service httpd restart 重启httpd apache 服务. 貌似很简单呢..回来再整理下svn的命令 补充.

然后通过 http://IP/svn/repos1可以访问这个仓库,可以建立多个仓库同时访问.不过直接访问 IP/svn 无法列出仓库的列表,apache显示 "forbidden \n You don't have permission to access /svn on this server"

对于一些svn的web管理程序也有,比如ViewVC 还有一些其他的管理svn的web程序,最好可以在web端创建仓库、权限管理就好了。目前寻找这样的svn web管理程序中。

CentOS 安装websvn直接yum即可,不需要配置mysql,只需要php的支持即可。

查看websvn的包文件

浏览器访问svn
[root@src-server ~]# yum install websvn
Loaded plugins: fastestmirror, presto, refresh-packagekit
Loading mirror speeds from cached hostfile
* base: mirrors.btte.net
* epel: ftp.kddilabs.jp
* extras: ftp.stu.edu.tw
* kernel-xen: us1.mirror.crc.id.au
* updates: mirrors.tuna.tsinghua.edu.cn
Setting up Install Process
Package websvn-2.3.3-2.el6.noarch already installed and latest version
Nothing to do
[root@src-server ~]#rpm -ql websvn
/etc/httpd/conf.d/websvn.conf
/etc/websvn/config.php
/usr/share/doc/websvn-2.3.3
/usr/share/doc/websvn-2.3.3/changes.txt
/usr/share/doc/websvn-2.3.3/doc
/usr/share/doc/websvn-2.3.3/doc/install.html
/usr/share/doc/websvn-2.3.3/doc/style.css
/usr/share/doc/websvn-2.3.3/doc/templates.html
/usr/share/doc/websvn-2.3.3/license.txt
/usr/share/websvn
/usr/share/websvn/blame.php
/usr/share/websvn/cache
/usr/share/websvn/comp.php
/usr/share/websvn/diff.php
/usr/share/websvn/dl.php
/usr/share/websvn/filedetails.php
/usr/share/websvn/include
/usr/share/websvn/include/accessfile.php
/usr/share/websvn/include/auth.php
/usr/share/websvn/include/bugtraq.php
/usr/share/websvn/include/command.php
/usr/share/websvn/include/config.php
/usr/share/websvn/include/configclass.php
/usr/share/websvn/include/diff_inc.php
/usr/share/websvn/include/diff_util.php
/usr/share/websvn/include/header
/usr/share/websvn/include/setup.php
/usr/share/websvn/include/svnlook.php
/usr/share/websvn/include/template.php
/usr/share/websvn/include/utils.php
/usr/share/websvn/include/version.php
/usr/share/websvn/index.php
/usr/share/websvn/languages
/usr/share/websvn/languages/chinese-simplified.php
/usr/share/websvn/languages/languages.php
/usr/share/websvn/languages/省略省略省略
/usr/share/websvn/listing.php
/usr/share/websvn/log.php
/usr/share/websvn/revision.php
/usr/share/websvn/rss.php
/usr/share/websvn/temp
/usr/share/websvn/templates
/usr/share/websvn/templates/BlueGrey
/usr/share/websvn/templates/BlueGrey/省略省略省略
/usr/share/websvn/templates/Elegant
/usr/share/websvn/templates/Elegant/省略省略省略
/usr/share/websvn/templates/calm
/usr/share/websvn/templates/calm/省略省略省略
/usr/share/websvn/wsvn.php
/var/cache/websvn
浏览器访问svn

下面就是vim /etc/websvn/config.php,其实这个文件就是/usr/share/websvn/include/config.php,只是做了一个链接到etc目录,这种方法对于这种需要配置的web程序来说,还真是方便。

浏览器访问svn
[root@src-server ~]# ll /etc/websvn/config.php
-rw-r--r-- 1 root root 21210 Jun 24 18:48 /etc/websvn/config.php
[root@src-server ~]# ll /usr/share/websvn/include/config.php
lrwxrwxrwx 1 root root 33 Jun 23 01:01 /usr/share/websvn/include/config.php -> ../../../../etc/websvn/config.php
[root@src-server ~]#
浏览器访问svn

这里需要修改的配置选项有:

$config->parentPath('/srv/svn/');

$config->useMultiViews();

############ $config->useAuthenticationFile('/srv/svn/passwd');#这里是因为我 不知道如何在websvn上登录我的账号

$config->setBlockRobots();#防止搜索程序收录

$config->expandTabsBy(4);#默认的8 似乎并不适合我的习惯

$config->useEnscript();##语法高亮 建议安装GNU Enscript高亮显示程序包,官方下载:http://www.iki.fi/~mtr/genscript/

#  关于编码 我不知道如何设置,SetInputEncoding 对于我的websvn-2.3.3不起作用,反而websvn出现500错误。

修改/etc/httpd/conf.d/websvn.conf 添加基本权限认证

浏览器访问svn
Alias /websvn /usr/share/websvn/

<Directory /usr/share/websvn/>
Options MultiViews Indexes
DirectoryIndex wsvn.php
order allow,deny
allow from all
AuthType Basic
AuthName "Authorization Realm"
AuthUserFile /srv/svn/passwd
Require valid-user </Directory>
浏览器访问svn

websvn就可以在线浏览了。

第三节:在线修改htpasswd密码

前面是由apache的htpasswd来通过 base 认证来进行账号管理的。通过这个小程序可以在线添加删除 校验账号密码。还有点小遗憾是 没有对 添加 删除 进行权限管理。校验后 才可以进行这个选项。

http://www.cnblogs.com/mutuan/archive/2012/07/27/2611537.html

参考:http://www.scmbbs.com/cn/svntp/2007/11/svntp1.php

转载请注明出处:http://www.cnblogs.com/ayanmw 我会很高兴的!

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

一定要专业!本博客定位于 ,C语言,C++语言,Java语言,Android开发和少量的Web开发,之前是做Web开发的,其实就是ASP维护,发现EasyASP这个好框架,对前端后端数据库 都很感觉亲切啊。. linux,总之后台开发多一点。以后也愿意学习 cocos2d-x 游戏客户端的开发。

浏览器访问svn的更多相关文章

  1. 通过浏览器https能够访问SVN,但eclipse SVN&comma;tortoiseSVN始终连接不上SVN的问题解决方案

    为了便于本地代码维护,特意在本地搭建了一个visualSVN服务器用于本地代码管理,但是最近突然出现问题,eclipse上的SVN资源库始终连接不上,提示 "svn: connection ...

  2. 使用 svn&colon;&sol;&sol;ip&sol;filename 方式访问svn 资源库

    a. 下载 SVN的官方网站为 http://subversion.tigris.org/,当前最新版本为1.4.2.Windows下的二进制安装包分为两种,一种是以setup结尾的安装文件,另一种是 ...

  3. 360路由器&plus;花生壳实现外网访问SVN服务器

    注册花生壳账号 花生壳注册地址:https://console.oray.com/passport/register.html?fromurl=http%3A%2F%2Fhsk.oray.com%2F ...

  4. Centos虚拟机SVN的安装和使用http方式访问svn服务器

    1.查看是否安装旧版SVNrpm -qa | grep subversion2.卸载旧版本SVNyum remove subversion3.安装SVNyum -y install subversio ...

  5. 浏览器访问Servlet

    浏览器访问Servlet1.指定一个Servlet路径(                     在web.xml :              <servlet>             ...

  6. TortoiseSVN和VisualSVN-Server的配置使用,外网访问SVN版本库

    TortoiseSVN和VisualSVN-Server的配置使用,外网访问SVN版本库 SVN客户端程序:TortoiseSVN SVN服务器程序:VisualSVN-Server ######## ...

  7. 用chrome模拟微信浏览器访问需要OAuth2&period;0网页授权的页面

    现在很流行微信网页小游戏,用html5制作的小游戏移过来,可以放到微信浏览器中打开,关键是可以做成微信分享朋友圈的形式,大大提高游戏的传播,增强好友的游戏互动. 微信浏览器中打开网页游戏效果还不错,对 ...

  8. 解决使用IIS5&period;0配置的FTP服务器,客户端浏览器访问时无法获取目录列表的问题。

    我在windows xp sp3下利用iis构架了FTP服务器,允许且只允许匿名用户登陆.但刚开始配置好后,不管是使用命令行模式还是使用浏览器都发现无法访问. 于是怀疑防火墙屏蔽端口所致,果不其然,在 ...

  9. Windows Server 2003服务器&period;net4&period;0&plus;IIS6&period;0的服务器&comma;IE11浏览器访问的不兼容性

    工作中发生了一件诡异的事情: 程序在Win7+.NET4.0+IIS7.5的服务器部署,IE8和IE11请求时,响应的样式都正常. 但是在美的同事反映说,Windows Server 2003服务器. ...

随机推荐

  1. spring cvc-elt&period;1&colon; Cannot find the declaration of element &&num;39&semi;beans&&num;39&semi;解决办法

    转载自http://blog.csdn.net/legendj/article/details/9950963 今天在写spring aop示例的时候,在spring.xml文件中添加spring a ...

  2. JStorm集群的部署

    JStorm是一个类似Hadoop MapReduce的系统,不同的是JStorm是一套基于流水线的消息处理机制,是阿里基于Storm优化的版本,和Storm一样是一个分布式实时计算的系统,从开发角度 ...

  3. codeforces mysterious present 最长上升子序列&plus;倒序打印路径

    link:http://codeforces.com/problemset/problem/4/D #include <iostream> #include <cstdio> ...

  4. Redis Sets

    Sets Sets 就是一个集合,集合的概念就是一堆不重复值的组合.利用Redis提供的Sets数据结构,可以存储一些集合性的数据,比如在微博应用中,可以将一个用户所有的关注人存在一个集合中,将其所有 ...

  5. &lbrack;Reprint&rsqb;c&plus;&plus;中typename和class的区别介绍

    在c++Template中,很多地方都用到了typename与class这两个关键字,而且好像可以替换,是不是这两个关键字完全一样呢?   相信学习C++的人对class这个关键字都非常明白,clas ...

  6. 【Linux】方便的SecureCRT文件上传、下载命令

    使用SecureCRT连接服务器,可用命令上传.下载文件,非常方便. > 安装 如果系统报找不到以下命令,那么你可能没有安装软件.安装以下吧. [root@localhost ~]# yum - ...

  7. Linux 内核 链表 的简单模拟(2)

    接上一篇Linux 内核 链表 的简单模拟(1) 第五章:Linux内核链表的遍历 /** * list_for_each - iterate over a list * @pos: the &amp ...

  8. 今天写了个从一张表数据插入到另一张表的oracle 语句

    create or replace procedure data_move(param in number) is cursor enterprise is select SENTERPRISEID, ...

  9. opencv 图像仿射变换 计算仿射变换后对应特征点的新坐标 图像旋转、缩放、平移

    常常需要最图像进行仿射变换,仿射变换后,我们可能需要将原来图像中的特征点坐标进行重新计算,获得原来图像中例如眼睛瞳孔坐标的新的位置,用于在新得到图像中继续利用瞳孔位置坐标. 仿射变换在:http:// ...

  10. COM实现过程

    前言 COM已经成为一个必需的东西了.在我们周围,可以说处处充满了COM – 如果你是在使用WINDOWS,并在其下面编写程序的话.然而,无论你是用VC,还是使用DELPHI进行COM编程时,在大多数 ...