远程虚拟主机上的 SVN 服务器/存储库?
我的愿望很简单,但显然又很复杂。
作为一名编程学生,我接触到了 SVN,确切地说是 TortoiseSVN。 我们获得了存储库的 url,如下所示: www.schoolderp.com/svn/project1
这非常棒,但现在我们想要启动一些私人项目。 因此,我们使用 TortoiseSVN 创建了一个存储库,将其上传到网络主机并尝试通过存储库浏览器查看它..当然不可能那么简单..呸!
因此,在过去的几天里,我一直在网上搜索答案,但我陷入困境。
我读过很多需要 Apache 的地方,但是当我读到 Apache 时,似乎它是我需要在我的机器上运行的一项服务,或者我只是愚蠢?
所以 atm 我几乎要疯了,并且希望有一个非常简单的解释来说明如何做,在我的网络主机上启动并运行 svn 服务器:/
提前非常感谢..
My wish is pretty simple, yet so complex, aparrently.
As a programming-student, I was introduced to SVN, TortoiseSVN to be exact.
We were given a url to the repository, which looked something like:
www.schoolderp.com/svn/project1
That is great and all, but now we want to get some private projects going.
So with TortoiseSVN we created a repository, uploaded it to a webhost and tried to view it through the repo-browser.. Ofcourse it couldnt be that simple.. bah!
So for the last couple of days, i've searched the web for answers, but im stuck.
I've read alot of places that Apache is needed, but when I read about Apache, it seems that it is a service i need to run on my machine, or am I just stupid?
So atm i pretty much going insane, and would LOVE a really simple explanation on what to do, to get a svn server up and running on my webhost :/
Thanks alot in advance..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
你需要一个服务器(虚拟的或真实的)来运行 svn。简单的 Web 主机不提供 svn 服务器所需的功能。
作为替代方案,您可以在多个 svn 服务器上拥有自己的私有存储库。
SVN 主机
You need a server (virtual or real) to run svn. A simple webhost does not provide the features needed for an svn server.
As an alternative there are several svn servers where you can have your own private repositories.
SVN Hoster
如果你想设置 svn 服务器,你将需要 root 权限。但是,您可以使用其他一些免费的 svn 托管服务,并且可以像存储库浏览器一样在网络上查看源文件。
http://unfuddle.com/
You will need a root privilege if you want to setup svn server. However, you can use some other free svn hosting services and can see the source files on the web just like a repo-browser.
http://unfuddle.com/
如果您正在运行一些私人服务器,并且无法访问 VPS 或专用服务器(并且您的教育机构无法帮助您在其部门 IP 地址之一上进行设置),那么也许一种解决方案是使用 VisualSVN for Windows(假设您使用的是 Windows)。有了这个,您可以在您正在使用的 PC(或笔记本电脑)上设置存储库,然后使用 dyndns(或其他动态名称/IP 映射服务)之类的东西将您的 PC/笔记本电脑的 IP 映射到 webdomain,如 oursvn.yourwebsite .com。通过一些配置,您可以通过映射到“当前”IP 地址的 url 访问您的 SVN 服务器(即使在便携式笔记本电脑上)。
这可能不是一条简单的路线,但却是一条低成本的 DIY 路线。
VisualSVN ( http://www.visualsvn.com/ ) 相对容易设置。动态 IP/URL 映射服务可以免费或付费,如果您在 VisualSVN 中创建用户和存储库,您可以自己控制访问。 (如果这是您认为适合的解决方案,请下载右侧的服务器版本。)如果
做不到这一点,有第三方服务提供商可以为您提供一系列价格的 SVN 托管。
http://beanstalkapp.com/pricing [不是建议,只是作为示例参考]
http://dyn.com/dns/dyndns-free/ [同样也不是推荐,只是一个例子]
if you're running some private ones, and don't have access to a VPS or Dedicated server (and your educational institution can't help you set this up on one of their departmental IP addresses), then perhaps one solution may be to use VisualSVN for Windows (Assuming you're using windows). With this you can set up the Repositories on a PC that you're using (or Laptop) and then use something like dyndns (or another dynamic name/ip mapping service) to map your PC/Laptop's IP to a webdomain like oursvn.yourwebsite.com. With some configuration, you can get your SVN server to be accessible (even on a portable laptop) from a url that maps to your 'current' ip address.
This may not be a simple route to go down, but it's a low cost, DIY route.
VisualSVN ( http://www.visualsvn.com/ ) is relatively easy to set up. Dynamic IP/url mapping services can be free or paid and if you create your users and repositories in VisualSVN, you can have control over the accesses yourself. (Download the server version on the right if this is a solution you think would suit.)
Failing that, there are third party service providers who can offer you SVN hosting for a range of prices.
http://beanstalkapp.com/pricing [not a recommendation, just as an example reference]
http://dyn.com/dns/dyndns-free/ [again also not a recomandation, just an example]
SVN-repo 和网站在共同点上关系较弱
SVN-repo and website are weakly related in common
Apache 只是托管 Subversion 存储库的方式之一。 Subversion 使用三种协议来为其存储库提供服务:
最简单的是
file:
。您所要做的就是在本地计算机上创建一个存储库,然后使用file:
协议简单地指向它。下载 SlikSVN。这是一个命令行驱动的客户端,但它包含可用于创建存储库的svnadmin
命令:现在,在 TortoisSVN 中,指向非
http
://www.schoolderp.com/svn/project1
,但是文件
://C/repository/myrepos
。请注意使用的不同协议!您应该能够从新创建的myrepos
存储库中签出。 (它将是空的,因此那里不会有任何文件或目录,但您可以创建它们并重新签入它们。file:
协议的问题是您必须处于本地系统,它并不能很好地处理多个用户,但是,如果您使用 TortoiseSVN,并且它是您自己的私人项目,那么另一种可能性是使用 svnserve 。使用以下命令运行存储库
svn:
协议实际上比http:
更快,因为开销更少,但每个服务器实例只能有一个存储库,而使用 http 则可以有多个存储库。在单个 Apache httpd 实例上运行myrepos\conf\svnserve.conf
文件是存储库的配置文件,您需要更改###password- 行。 db = passwd
到从行的开头删除###
这会将 密码数据库设置为 passwd 文件。有一个示例可以用作模板。您所需要做的就是在
[users]
部分下添加用户名及其密码。例如:david = Swordfish
会将用户david
的密码设置为swordfish
。现在,您可以将 TortoiseSVN 指向
svn
://localhost
并从存储库中签出。您的朋友还可以从同一存储库中签出,并将您的计算机名称替换为 localhost 。因此,您必须创建一个 Subversion 存储库,但使用 svncreate 命令非常容易完成。您可以立即通过
file://
协议访问它,而无需执行任何其他操作。如果您想与其他人共享此存储库,则需要使用 svnserve 命令来运行 SVN 服务器,但这也很容易做到。我建议您阅读Subversion 在线手册。前几章将让您基本了解 Subversion 的工作原理以及如何使用 Subversion svn 命令,该命令是您下载并安装的 SlikSVN 客户端的一部分。服务器基础知识位于第 5 章以及有关使用svnserve 在第 6 章。
Apache is just one of the ways of hosting a Subversion repository. Subversion uses three protocols for serving its repository:
The simplest is
file:
. All you have to do is create a repository on your local machine, and simply point to it using thefile:
protocol. Download SlikSVN. This is a command line driven client, but it includes thesvnadmin
command that you can use to create repositories:Now, in TortoisSVN, point to not
http
://www.schoolderp.com/svn/project1
, butfile
://C/repository/myrepos
. Note the different protocol used! You should be able to checkout from your newly createdmyrepos
repository. (It will be empty, so there won't be any files or directories there, but you can create them and check them back in.The problem with the
file:
protocol is that you have to be on the local system and it doesn't really handle multiple users very well. But, if you're using TortoiseSVN, and its your own private project, it works pretty well.The other possibility is to use
svnserve
to run the repository using thesvn:
protocol. This is actually faster thanhttp:
because there's less overhead, but you can only have a single repository per server instance while with http, you can have multiple repositories running on a single Apache httpd instance.The
myrepos\conf\svnserve.conf
file is the configuration file for your repository. You'll need to change the line that says###password-db = passwd
to remove the###
from the beginning of the line. This sets the password database to the passwd file.You'll need to create the passwd file. There's a sample one you can use as a template. All you need is to add under the
[users]
section the name of the user and their password. For example:david = swordfish
would set userdavid
's password toswordfish
.Now, you can point TortoiseSVN to
svn
://localhost
and check out from your repository. Your friends can also checkout from the same repository substituting your machine name forlocalhost
.So, you have to create a Subversion repository, but it's pretty easy to do with the
svncreate
command. And you can immediately access it via thefile://
protocol without doing anything else. If you want to share this repository with other people, you need to use thesvnserve
command to run the SVN server, but that's also pretty easy to do.I recommend that you go through the Subversion online manual. The first few chapters will give you a basic understanding of how Subversion works and how to use the Subversion
svn
command which is part of the SlikSVN client you downloaded and installed. The server fundamentals are in Chapter 5 and information about using svnserve is in chapter 6.