Linux Deployment SVN server

Source: Internet
Author: User

Go

As a "Magnum" code farmer, this kind of work you will have to do sooner or later. ----by Jimi no bond

Preparation: Yum

1. Check if it is installed
Rpm-qa Subversion
If you want to uninstall the old version:
Yum Remove Subversion

2. Installation
Yum Install Subversion
Ps:yum Install httpd httpd-devel Subversion mod_dav_svn Mod_auth_mysql (this is installed with Apache module, I haven't done it yet, do it again, you can only install subversion, It doesn't matter if it's loaded)
3. Check if the installation is successful
Svnserve--version
If successful, the version number is output

4. Create a warehouse directory
For example:
Mkdir/home/svn/game

5. Create a project
Svnadmin Create/home/svn/game

6. Check whether the creation was successful
Cd/home/svn/game
ll
If successful, there will be a few more folders in the game directory


7. Enter the Conf directory will see 3 configuration files, the generated files are in English annotation description
Sample requirements:
Planning Group: Open planning, art reading and writing
Back-end group: read-write on the back-end, plan-only
Front End group: read-write, planning, art reading
Art Group: Open Art reading and writing, planning read-only
Administrators group: all read and write
Authz: User Rights configuration
Example:
[Groups]
#管理组
Manager = Boss
#服务端用户组
Server = Server1,server2
#客户端用户组
Client = Client1,client2
#美术组
Art = Art1,art2
#策划组
Design=design1,design2
[game:/]
@manager =RW
[Game:/server]
@server =RW
[Game:/client]
@client =RW
@design =r
@art =r
[Game:/art]
@design =RW
@art =RW
@client =r
[Game:/design]
@design =RW
@server =r
@client =r
@art =r
passwd: User Password
[Users]
boss=123456
server1=123456
server2=123456
client1=123456
client2=123456
art1=123456
art2=123456
design1=123456
design2=123456
Svnserve.conf:
#匿名访问者权限
Anon-access = None
#验证用户权限
auth-access = Write
#密码文件地址
Password-db =/home/svn/game/passwd
#权限文件地址
Authz-db =/home/svn/game/authz
#项目名称 (UUID)
Realm =game

8. Open SVN port
The default is 3690 ports, you can also use other. Turned on skip this step
Modify
Iptables-i input-p TCP--dport 3690-j ACCEPT

/etc/rc.d/init.d/iptables Save
Restart
Service Iptables Restart
View
/etc/init.d/iptables status

If the error above try this iptables-a input-p TCP--dport 3690-j ACCEPT
#/etc/init.d/iptables Save

# Service Iptables Restart


9. Start the SVN service
Svnserve-d-R/HOME/SVN
-D: Daemon
-R:SVN root directory
Suppose the server-side IP is 192.168.1.100, then the Access directory for the game is as follows:
Svn://192.168.1.100/game

10. Installing the Client TortoiseSVN

11. Create a subdirectory
Find a directory on the client PC, move out of the game directory from Svn://192.168.1.100/game with the administrator account, create a new Art,design,server,client 4 subdirectories, and then commit.
At this point you can use the other group's account to test whether it is working properly.

12. Installed SVN server, the default is not boot from the boot, each boot itself will be very troublesome, we can set it to boot
First: Write a startup script svn_startup.sh, which I put in/root/svn_startup.sh
#!/bin/bash
/usr/bin/svnserve-d-r/home/svn/
Here the Svnserve path is safe, it is best to write the absolute path, because the environment variable may not be loaded when it is started.
How do you find the absolute path?
Which Svnserve
There may also be a problem, if you build and write in Windows under the footsteps, get Linux, with VI or VIM modified may not be able to execute, this is a file format problem
VI svn_startup.sh

Input: Set FF Enter

If the displayed result is not Fileformat=unix

Re-enter

Set Ff=unix

It's OK.
Then modify the Execute permissions for the script
chmod ug+x svn_startup.sh

or everything.

chmod 777 svn_startup.sh
Last: Join Auto run
Vi/etc/rc.d/rc.local
Add the path to the script at the end, such as:
/root/svn_startup.sh
Now, you can reboot and try again. Do not know how to confirm success? I lost you.
Ps-ef|grep Svnserve

Linux Deployment SVN server

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.