Install SVN (Alibaba Cloud Server) on (CentOS7.6 version) for code submission and version iteration

The local software I use is SecureCrt to remotely control my cloud server.

1. Install the software: yum -y install subversion

2. Check the svn version: svn --version

2.1. Note: In addition, you can also check whether the old version has been installed before installation. You can uninstall the old version and reinstall it.

2.2. Check the installed version: rpm -qa subversion

2.3 Uninstall the old version of SVN: yum remove subversion

3. Create a new folder for the SVN folder (used to submit and store code): mkdir -p / data1 / svn / curstom_projs

4. Set the SVN folder as the SVN file repository: svnadmin create / data1 / svn / curstom_projs

5. Configuration parameters:

5.1 Enter this folder cd / data1 / svn / curstom_projs 

(There are three configuration files in the conf folder in this folder: authz, passwd, svnserver.conf)

authz: ​​permission control, which users can set which directories can be accessed;

passwd: set user and password;

svnserve.conf: setting set svn related operations, the resulting file has described English comments.

5.2 Configure svnserv.conf Modify configuration information: vi /data1/svn/curstom_projs/conf/svnserve.conf

Modify the following parameters: (Modify the parameters to pay attention to remove # [Comment], and top to the left, no spaces)

anon-access = none (making unauthorized users inaccessible)

auth-access = write (enable authorized users to write)

password-db = passwd (user password file)

authz-db = authz (access control file)

realm = / data1 / svn / curstom_projs (authentication namespace, subversion will be displayed in the authentication prompt and used as a key for credential cache.)

5.3 Configure passwd (format: account = password ): vi / data1 / svn / curstom_projs / conf / passwd

Add data: username = 123456 (need to add)

5.4  Note: Users here have svn protocol to use svn;

5.5 Configure authz permissions: vi / data1 / svn / curstom_projs / conf / authz

Add data: (The user has read and write permissions but can only access the content under the corresponding file (curstom_projs), r: read, w: write)

[/]

username = rw

[/ curstom_projs]

username=rw

6. Set the data submission permissions: (where -d is the daemon user, so you need to set the user permissions)

6.1  sudo chown -R daemon /data1/svn/curstom_projs

6.2  sudo chmod -R 755 /data1/svn/curstom_projs

7. Start svn

7.1  svnserve -d -r /data1/svn --listen-port 10010   

(The port number is 10010, remember to configure the port on Alibaba Cloud, if not, you can read my previous blog)

7.2 netstat -ntlp (view port information)

7.3 yum install net-tools (if the netstat command cannot be found)

8. Finally, we can access our svn server through (" svn: // ip: port / curstom_projs ").

Published 167 original articles · Like 92 · Visitors 10,000+

Guess you like

Origin blog.csdn.net/weixin_42995083/article/details/105412771