如何在腾讯云轻量级服务器搭建svn

 首先进入服务器控制面板:

https://console.cloud.tencent.com/lighthouse/instance/indexhttps://console.cloud.tencent.com/lighthouse/instance/indexicon-default.png?t=N7T8https://console.cloud.tencent.com/lighthouse/instance/index

点击服务器进入详情面板,如下图所示

服务器详情面板
服务器详情面板

 如果不是linux,可以点击上图所示的红框内的重置应用,将系统更换为CentOS,当然其他的系统也可以装svn,但是不适合这个教程了。

主信息面板

点击这里的重置密码

网络ip信息

然后就使用软件连接服务器,我这里使用的是xshell,一款个人免费的远程连接服务。

 点击连接输入对应的Ip地址,直接连接即可,然后根据提示输入用户名和密码,连接即可,如果不在服务器那里设置密码的话,就只能用密钥连接。

连接之后的面板
连接之后的面板

 1.然后安装svn

yum -y install subversion

 几秒之后显示如下图,Complete! 表示安装已经完成。

 2.确认svn安装完成

svnserve --version

 3.创建svn的版本库

mkdir /usr/local/svn

 输入以上命令,mkdir是linux命令,意思是在usr目录的local目录下,创建一个文件夹svn,没有提示就是对了

 如果安装了xftp的话,点击xftp到对应的路径下,就可以看到对应的文件夹。

 可以看到一个svn的空文件夹。

 4.创建svn版本库下文件存放地址

svnadmin create /usr/local/svn/firstTest

5.修改配置文件,也可以用xftp直接在对应的路径上修改文件

进入对应的路径

 cd /usr/local/svn/firstTest

cd 是linux命令,进入 /usr/local/svn/firstTest

输入ls,ls也是Liunx命令,展示当前目录下的文件

 ls

 conf就是配置文件,进入之后修改

cd conf

ls

 vi authz

 修改账号控制信息,这里都是liunx的操作命令,如果感觉不好修改的话,也可以使用xftp直接在文件上修改,vi 打开并修改当前文件。按i进入编辑模式。

i

 在末尾添加,注意等号两边有空格

[/]

hu = rw

 

 [/] 表示控制的路径是全部,hu 是账号名, rw 表示的权限 可读写,按Esc退出编辑模式

Esc

:wq

输入  :wq 表示保存并推出,:是英文的冒号: 

6.添加账号信息

vi passwd

i

 添加刚才的账号信息,注意输入数字的时候,要用字母上的数字,不要用小键盘的数字

hu = hu123456

 Esc

:wq

 7.开放权限

vi svnserve.conf

[general]
### The anon-access and auth-access options control access to the
### repository for unauthenticated (a.k.a. anonymous) users and
### authenticated users, respectively.
### Valid values are "write", "read", and "none".
### Setting the value to "none" prohibits both reading and writing;
### "read" allows read-only access, and "write" allows complete
### read/write access to the repository.
### The sample settings below are the defaults and specify that anonymous
### users have read-only access to the repository, while authenticated
### users have read and write access to the repository. 
anon-access = read
auth-access = write
### The password-db option controls the location of the password
### database file.  Unless you specify a path starting with a /,
### the file's location is relative to the directory containing
### this configuration file.
### If SASL is enabled (see below), this file will NOT be used.
### Uncomment the line below to use the default password file.
password-db = passwd
### The authz-db option controls the location of the authorization
### rules for path-based access control.  Unless you specify a path
### starting with a /, the file's location is relative to the
### directory containing this file.  The specified path may be a
### repository relative URL (^/) or an absolute file:// URL to a text
### file in a Subversion repository.  If you don't specify an authz-db,
### no path-based access control is done.
### Uncomment the line below to use the default authorization file.
authz-db = authz
### The groups-db option controls the location of the file with the
### group definitions and allows maintaining groups separately from the
### authorization rules.  The groups-db file is of the same format as the
### authz-db file and should contain a single [groups] section with the
### group definitions.  If the option is enabled, the authz-db file cannot
### contain a [groups] section.  Unless you specify a path starting with
### a /, the file's location is relative to the directory containing this
### file.  The specified path may be a repository relative URL (^/) or an
### absolute file:// URL to a text file in a Subversion repository.
### This option is not being used by default.
# groups-db = groups
### This option specifies the authentication realm of the repository.
### If two repositories have the same authentication realm, they should
### have the same password database, and vice versa.  The default realm
### is repository's uuid.
realm = My First Repository
### The force-username-case option causes svnserve to case-normalize
### usernames before comparing them against the authorization rules in the
### authz-db file configured above.  Valid values are "upper" (to upper-
### case the usernames), "lower" (to lowercase the usernames), and
### "none" (to compare usernames as-is without case conversion, which
-- INSERT --

将下图所示的配置前面的#去掉即可,如果不好修改,建议使用xftp直接在对应的文件的也好。

anon-access = read
auth-access = write

password-db = passwd

authz-db = authz
realm = My First Repository

Esc

:wq 

 8.启动svn,这里到 第三步 3.创建svn的版本库即可

svnserve -d -r /usr/local/svn

确定是否启动

 netstat -apn | grep 3690

 如下图所示,3690是svn的默认端口

 然后在控制面板中开启端口,我这里直接开启全部的端口

开启端口

9.检出文件 

创建一个存放svn的路径,检出,注意这里是 4.创建svn版本库下文件存放地址的创建的路径,svn://ip:3690/firstTest

svn检出
svn检出

 输入对应的用户名和密码即可。

提交之后发现查看不了版本信息,日期选择不了永远是1970/1/1

修改svn上的svnserve.conf

 anon-access=none

 清理svn客户端的cache即可,TortoiseSVN --> settings

 

 删除这里的即可。

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
您好!要在腾讯云服务器上搭建 SVN(Subversion),您可以按照以下步骤进行操作: 1. 登录腾讯云控制台,进入云服务器实例列表页面。 2. 选择您想要搭建 SVN 的实例,点击右侧的“登录”按钮,通过 SSH 连接到服务器。 3. 在服务器上安装 SVN 服务,可以使用以下命令: ``` sudo apt update sudo apt install subversion ``` 4. 创建一个 SVN 仓库,可以使用以下命令: ``` sudo svnadmin create /path/to/repository ``` 将 `/path/to/repository` 替换为您想要存储仓库的实际路径。 5. 配置 SVN 仓库的访问权限,可以使用以下命令: ``` sudo chown -R www-data:www-data /path/to/repository sudo chmod -R 775 /path/to/repository ``` 这将将仓库的所有权和权限分配给 `www-data` 用户和组,并确保需要的权限设置。 6. 配置 Apache Web 服务器来提供 SVN 服务,可以使用以下命令安装 Apache: ``` sudo apt install apache2 ``` 7. 启用 Apache 的 `dav` 和 `dav_svn` 模块,可以使用以下命令: ``` sudo a2enmod dav sudo a2enmod dav_svn ``` 8. 编辑 Apache 的配置文件,在配置文件中添加以下内容: ``` <Location /svn> DAV svn SVNPath /path/to/repository </Location> ``` 将 `/svn` 替换为您想要访问 SVN 仓库的 URL 路径,将 `/path/to/repository` 替换为实际的仓库路径。 9. 重启 Apache 服务器,可以使用以下命令: ``` sudo systemctl restart apache2 ``` 10. 现在,您可以通过浏览器或 SVN 客户端访问 SVN 仓库了。在浏览器中访问 `http://your_server_ip/svn`,将 `your_server_ip` 替换为服务器的实际 IP 地址。 希望这能帮到您!如有任何问题,请随时提问。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

我的天才女友

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值