subversion安装_在Ubuntu上使用Web Access安装Subversion

subversion安装

subversion安装

This article covers installing subversion with the apache module so that it can be easily accessed from other systems on a public network. If you want a more secure svn server, you could use svnserve+ssh, which isn’t covered in this article.

本文介绍如何使用apache模块安装Subversion,以便可以从公用网络上的其他系统轻松访问它。 如果您想要更安全的svn服务器,则可以使用svnserve + ssh,本文不会对此进行介绍。

To install subversion, open a terminal and run the following command:

要安装Subversion,请打开一个终端并运行以下命令:

sudo apt-get install subversion libapache2-svn

须藤apt-get install subversion libapache2-svn

We’re going to create the subversion repository in /svn, although you should choose a location that has a good amount of space.

尽管您应该选择一个具有足够空间的位置,但我们将在/ svn中创建Subversion存储库。

sudo svnadmin create /svn

sudo svnadmin创建/ svn

Next we’ll need to edit the configuration file for the subversion webdav module. You can use a different editor if you’d like.

接下来,我们需要编辑Subversion Webdav模块的配置文件。 您可以根据需要使用其他编辑器。

sudo gedit /etc/apache2/mods-enabled/dav_svn.conf

须藤gedit /etc/apache2/mods-enabled/dav_svn.conf

The Location element in the configuration file dictates the root directory where subversion will be acessible from, for instance: http://www.server.com/svn

配置文件中的Location元素指示可从其中进行subversion的根目录,例如:http://www.server.com/svn

<Location /svn>

<位置/ svn>

The DAV line needs to be uncommented to enable the dav module

DAV线需要取消注释才能启用dav模块

# Uncomment this to enable the repository,DAV svn

#取消注释以启用存储库DAV svn

The SVNPath line should be set to the same place your created the repository with the svnadmin command.

SVNPath行应设置为使用svnadmin命令创建存储库的位置。

# Set this to the path to your repositorySVNPath /svn

#将此设置为存储库的路径SVNPath / svn

The next section will let you turn on authentication. This is just basic authentication, so don’t consider it extremely secure. The password file will be located where the AuthUserFile setting sets it to…  probably best to leave it at the default.

下一部分将允许您打开身份验证。 这只是基本身份验证,因此不要认为它非常安全。 密码文件将位于AuthUserFile设置将其设置为的位置…最好将其保留为默认值。

# Uncomment the following 3 lines to enable Basic AuthenticationAuthType BasicAuthName “Subversion Repository”AuthUserFile /etc/apache2/dav_svn.passwd

#取消注释以下3行以启用基本身份验证AuthType BasicAuthName“ Subversion Repository” AuthUserFile /etc/apache2/dav_svn.passwd

To create a user on the repository use, the following command:

要在存储库上使用创建用户,请使用以下命令:

sudo htpasswd2 -cm /etc/apache2/dav_svn.passwd <username>

sudo htpasswd2 -cm /etc/apache2/dav_svn.passwd <用户名>

Note that you should only use the -c option the FIRST time that you create a user. After that you will only want to use the -m option, which specifies MD5 encryption of the password, but doesn’t recreate the file.

请注意,仅应在第一次创建用户时使用-c选项。 之后,您只需要使用-m选项,该选项指定密码的MD5加密,但不重新创建文件。

Example:

例:

sudo htpasswd2 -cm /etc/apache2/dav_svn.passwd geekNew password: Re-type new password: Adding password for user geek

sudo htpasswd2 -cm /etc/apache2/dav_svn.passwd geek新密码:重新输入新密码:为geek用户添加密码

Restart apache by running the following command:

通过运行以下命令来重新启动Apache:

sudo /etc/init.d/apache2 restart

sudo /etc/init.d/apache2重新启动

Now if you go in your browser to http://www.server.com/svn, you should see that the repository is enabled for anonymous read access, but commit access will require a username.

现在,如果您在浏览器中访问http://www.server.com/svn,则应该看到已对存储库启用了匿名读取访问,但是提交访问将需要用户名。

If you want to force all users to authenticate even for read access, add the following line right below the AuthUserFile line from above. Restart apache after changing this line.

如果您要强制所有用户进行身份验证,甚至可以进行读取访问,请在上方的AuthUserFile行下方添加以下行。 更改此行后,重新启动apache。

Require valid-user

需要有效用户

Now if you refresh your browser, you’ll be prompted for your credentials:

现在,如果刷新浏览器,将提示您输入凭据:

You now have a working subversion server!

您现在拥有一个可以正常工作的Subversion服务器!

翻译自: https://www.howtogeek.com/howto/ubuntu/install-subversion-with-web-access-on-ubuntu/

subversion安装

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值