【工具】VisualSvn Server

官网地址:https://www.visualsvn.com/server/

可以作为版本管理工具的服务器,默认支持subversion(svn),Apache等,配置后支持Git。


VisualSVN Server安装一路默认即可。

关键设置:

Storage: 存放位置,如F:\Repositories\

NetWork:servername = 本地IP,端口默认用443,建议使用https协议,IP绑定限制,支持所有。

路由器设置:

1。设置静态IP

2。绑定MAC

3。设置DMZ主机

4。设置虚拟服务器,端口(单一软件多端口在特殊应用下设置,复杂NAT穿透)

5。动态DNS,花生壳,注册、登陆(在路由器登陆即可),在花生壳官网绑定IP(默认会自动绑定登陆的IP,如果异常可在官网查看IP是否绑定错误,如果错误修改保存再尝试)

6。如果端口非默认端口需要在网址(或ip)后加:端口号,web默认80,https默认443。

7。如果要开放非svn的本身web,而是自己的网站,可再使用IIS配置或Apache(暂时没用过)配置,IIS配置时主要是制定路径、默认页、权限(这个是最容易出错的地方)。

8。沙箱安全相关以及跨域问题,如Unity3d做web跨域问题需要doman配置。


VisualSVN Subversion Server and Git:http://blog.subgit.com/visualsvn-subversion-server-and-git/


VisualSVN Subversion Server and Git

I’d like to start this blog with a few real-world examples on how to set up SubGit assuming infrastructure that is already in place. This post will take place in a strange world of Windows.

Initial configuration: VisualSVN Server on 64-bit Windows computer, provides read and write access to two Subversion repositories over HTTPS.

Primary Objective: Make Subversion repositories accessible for reading and modification with Git over HTTPS.
Secondary Objective: Reuse existing authentication settings, that are already configured for Subversion repositories.

In other words I’m about to set up instant bidirectional Svn to Git replication.

CONFIGURATION DETAILS

This is a VisualSVN configuration I’ve created for this guide:

Initial VisualSVN Configuration

As you may see project repository is a single-project one with a standard trunk/branches/tags layout, and main repository contains two subproject, each with a standard layout.

VisualSVN is installed in C:\Program Files (x86)\VisualSVN Server directory.
Repositories are located in C:\Repositories directory.
VisualSVN uses standard Subversion authentication settings.

ADD GIT TO SVN

First, install msysGit, you may download installer from their download page. Make sure you select this option when installing msysGit (it is important for enabling HTTP access later!):

Important Git Installation Option

Second, change an account VisualSVN service uses and modify C:\Repository directory (one where repositories are kept) permissions as described in a Visual SVN knowledge base entry. It is important to make VisualSVN service run on behalf of the account that has access to the Git you’ve just installed. Following the way of lesser resistance, I’ve used my personal account for that, but you may create a dedicated one.

After completing this step, I had VisualSVN service running on behalf of “HOST\alex” account and C:\Repository was writable for “HOST\alex”. Yes, my name is Alex.

Finallydownload SubGit zip archive and unpack it into C:\SubGit directory. The run “subgit install” on Subversion repositories to enable replication:

> C:\SubGit\bin\subgit install C:\Repositories\main
> C:\SubGit\bin\subgit install C:\Repositories\project

Install SubGit

Install SubGit


Note, that you  must run “subgit install” on behalf of the same user that you’ve configured VisualSVN service with.

CONFIGURE HTTP ACCESS FOR GIT

Important: VisualSVN comes with more or less truncated version of Apache, but fortunately it misses only one module of those needed for Git (mod_cgi). Download it (mod_cgi.so from Apache 2.2.21 for win32) and put into C:\Program Files (x86)\VisualSVN Server\bin directory.

Alternatively, you may get this missing module by installing Apache and taking mod_cgi.so file from the modules folder.

Then, edit C:\Program Files (x86)\VisualSVN Server\conf\httpd-custom.conf file:

LoadModule cgi_module bin/mod_cgi.so
LoadModule authz_user_module bin/mod_authz_user.so

SetEnvIf Request_URI "^/git/.*$" GIT_PROJECT_ROOT=C:/Repositories
SetEnvIf Request_URI "^/git/.*$" GIT_HTTP_EXPORT_ALL

ScriptAlias /git/ "C:/Program Files (x86)/Git/libexec/git-core/git-http-backend.exe/"

<Location /git>
  Options +ExecCGI

  Require valid-user
  AuthName "VisualSVN Server"
  AuthType Basic
  AuthBasicProvider file
  AuthUserFile "C:/Repositories/htpasswd"
</Location>

Note, that this configuration example uses “Basic” authentication option, granting read and write access to repositories for all Git users that are listed in htpasswd file. Of course you may configure something more complicated here.

Now restart VisualSVN Server service. That’s all!

GIT FOR SVN

Try the following commands now:

# set this environment variable in case you're using SSL and 
# self-signed SSL certificate in VisualSVN (this is default).
> SET GIT_SSL_NO_VERIFY=true

> git clone https://alex@localhost/git/project project
> git clone https://alex@localhost/git/main/git/library lib

Thanks to SubGit, changes pushed from the cloned Git repository will be immediately propagated to the corresponding Svn repository and vice versa – new Svn revisions will be received by a pull performed from a cloned Git repository.

You may find more on SubGit at http://subgit.com/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值