在Centos 5上通过HTTP访问设置SVN

INTRODUCTION

介绍

Subversion is a fantastic version management and software configuration management tool for teams and individuals to manage software applications. It offers many advantages over it's CVS ancestor such as it's built-in compatibility with Apache through the WebDAV protocol giving easy remote access over HTTP.

Subversion是一个出色的版本管理和软件配置管理工具,供团队和个人管理软件应用程序。 与CVS祖先相比,它具有许多优势,例如通过WebDAV协议与Apache的内置兼容性,从而可以轻松地通过HTTP进行远程访问。

(Your server will require an external IP address to be accessed from an external location)

(您的服务器将需要从外部位置访问外部IP地址)

This tutorial will take you step-by-step through the install and set-up process for Subversion.

本教程将带您逐步了解Subversion的安装和设置过程。

SETTING UP YUM

设置百胜

The easiest way to install and manage packages on Linux is using yum. It can detect dependencies and resolve them for you - easing many headaches! If you do not have it installed then you can quickly install it from the terminal.

在Linux上安装和管理软件包的最简单方法是使用yum。 它可以检测依赖关系并为您解决依赖关系-减轻许多麻烦! 如果尚未安装,则可以从终端快速安装。

Run the following commands to install it (hit y where necessary to confirm the process):

运行以下命令进行安装(在必要时单击y以确认该过程):

rpm -Uvh http://mirror.centos.org/centos/5/os/i386/CentOS/python-iniparse-0.2.3-4.el5.noarch.rpm

rpm -Uvh http://mirror.centos.org/centos/5/os/i386/CentOS/yum-3.2.19-18.el5.centos.noarch.rpm http://mirror.centos.org/centos/5/os/i386/CentOS/yum-fastestmirror-1.1.16-13.el5.centos.noarch.rpm

Yum should now be ready to use!

百胜现在应该可以使用了!

INSTALLING SUBVERSION

安装子版本

1. From the terminal run the following commands (hit y where necessary to confirm the process):

1.在终端上运行以下命令(必要时在y处确认该过程):

yum install subversion
yum install mod_dav_svn

mod_dav_svn allows integration with Apache through the WebDAV protocol.

mod_dav_svn允许通过WebDAV协议与Apache集成。

You may find that SVN is already installed by default.

您可能会发现默认情况下已经安装了SVN。

Enter svnadmin into the terminal to confirm correct installation.

在终端中输入svnadmin确认正确安装。

SETTING UP SUBVERSION

设置子版本

1. First you must create a directory for your svn repository. Through this tutorial my repository will be in the  / directory and called repos. You should change the paths throughout the tutorial if you want to place the repository in a different place.

1.首先,您必须为svn存储库创建一个目录。 通过本教程,我的存储库将位于/目录中,并称为repos。 如果要将存储库放在其他位置,则应在整个教程中更改路径。

To create your repository and assign permissions open the terminal and run the following commands:

要创建您的存储库并分配权限,请打开终端并运行以下命令:

mkdir /repos
svnadmin create /repos
chown -R apache.apache /repos
chmod g+s /repos/db

2. Within /etc/httpd/conf.d you will find a file called subversion.conf. This file configures SVN to work with Apache. You must edit it to specify your SVN repository and secure it.

2.在/etc/httpd/conf.d中,您将找到一个名为subversion.conf的文件。 此文件将SVN配置为与Apache一起使用。 您必须对其进行编辑以指定SVN存储库并对其进行保护。

First copy and paste the file renaming it to subversion-backup.conf. This is just incase you make any mistakes - you can restore the file to its original with little hassle.

首先复制并粘贴文件,将其重命名为subversion-backup.conf。 这只是为了防止您犯任何错误-您可以轻松地将文件还原到原始文件。

Then delete the contents of the original file. Add in the following to the file, changing directories where necessary to your own repository.

然后删除原始文件的内容。 将以下内容添加到文件中,并在必要时将目录更改为您自己的存储库。

<Location /repos>
     DAV svn
     SVNPath /repos

     AuthType Basic
     AuthName "Your Subversion Repository"
     AuthUserFile /etc/httpd/passwd/password
     Require valid-user

</Location>

This is all the changes you need to make to Apache. You have now told Apache where your SVN repository is and told it to authenticate the user. The last thing we need to do is create the username and password for the user

这就是您需要对Apache进行的所有更改。 现在,您已经告诉Apache SVN存储库在哪里,并告诉它对用户进行身份验证。 我们需要做的最后一件事是为用户创建用户名和密码

3. From your terminal enter the following commands to set the SVN username and password.

3.在您的终端上,输入以下命令来设置SVN用户名和密码。

mkdir /etc/httpd/passwd
htpasswd -b -c /etc/httpd/passwd/password svn_username svn_password

Whichever username and password you choose - it will be required to authenticate when you attempt to connect to the SVN repository over HTTP.

无论您选择哪种用户名和密码-尝试通过HTTP连接到SVN存储库时都需要进行身份验证。

You should note that your password is stored in plain-text and sent over the web in plain text unless you use SSL. This is outside the scope of this article.

您应注意,除非使用SSL,否则密码以纯文本格式存储,并以纯文本格式通过Web发送。 这超出了本文的范围。

Thats all there is to setting up SVN. Restart Apache to make all your changes take effect.

设置SVN就是全部。 重新启动Apache,以使所有更改生效。

To test your setup open a web browser and navigate to http://externalip/repos

要测试您的设置,请打开网络浏览器并导航至http:// externalip / repos

It should return:

它应该返回:

Revision 0: /

修订版0:/

Powered by Subversion version 1.0.4 (r9844).

由Subversion 1.0.4(r9844)版本提供支持。

You can now use various clients such as Eclipse (with a plug-in) to add to your repositories.

现在,您可以使用各种客户端(例如Eclipse)(带有插件)将其添加到存储库中。

翻译自: https://www.experts-exchange.com/articles/1655/Setting-up-SVN-with-HTTP-Access-On-Centos-5.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值