Create an SVN server
1, first install SVN this software
Apt-get Install Subversion
2. Create a folder named SVN in the home directory (the name of the folder is random)
Mkdir/home/svn
3. Create a Data warehouse (you can create as many as you want)
Svnadmin Create/home/svn/test
4. Start SVN Network Service
Svnserve-d-R/HOME/SVN
Where the-D parameter lets Svnserve run in the background, the-R parameter limits the data warehouse to the address that can be accessed on the network. /HOME/SVN Specify the location of the directory where the SVN data warehouse resides
5. Set SVN: Access permissions for the way
In each data Warehouse directory there are a bunch of directories, enter CONF and open svnserve.conf This file, find the following lines,
and remove the previous note symbol ' # ', and be careful not to leave any spaces in front of each line.
Anon-access = Read
auth-access = Write
Password-db = passwd
Where anon-access and auth-access are anonymous and privileged users, the default is to read-only permissions for anonymous users.
But if you want to deny access to anonymous users, simply change the anon-access read to none to achieve the goal.
The passwd after password-db is the file path that defines the user name and password. This file defaults to snvserve.conf
The same directory, see below How to configure the contents of the passwd file.
[User]
# Harry = Harryssecret
# sally = Sallyssecret
Harry and Sally each define the user name and password of the user who can write to repo. We can add the following
Your user name and password, such as
TESTSVN = Tester
This gives the user TESTSVN permission to write to repo. After saving, the SVN server can be run even if it is official!
Put all the projects that need to be managed in the/HOME/SVN directory and build the Data Warehouse with the Svnadmin create command as normal .
This allows the SVN client to pull the data warehouse on the server to local using the SVN Co SVN://IP address/Data Warehouse directory.
recently upgraded the next Linode, found that SVN can not be submitted and updated, reported svn:E000061:Unable to connect to a repository at URL such errors, later looked up some information, it is SVN port is not open, SVN default port is 3690, in Ubuntu View port open situation, command is NETSTAT-ANP, the SVN service is restarted under it, command for svnserve-d-r/home/svn
Setting up an Update synchronization web site
SVN sync repository with Site Directory
Defined:
SVN repository =/home/svn/repos
Site Directory =/var/www/web
Www.2cto.com
1. Check out a project to the site Directory
#svn Checkout File:///home/svn/repos/var/www/web
At this point, the site directory has become a working copy of SVN, and all we have to do is let the working copy be updated automatically.
3. Add hooks (Hook) file
# Vim/home/svn/repos/hooks/post-commit
#!/bin/sh
Export lang= "ZH_CN. UTF-8 "#防止乱码
SVN update/var/www/web--username user1--password password1--no-auth-cache
Modify the file permission after saving to 755, otherwise SVN cannot invoke execution
#chmod 755/home/svn/repos/hooks/post-commit
Hooks (Hook) file Description:
# Start-commit triggers a transaction before committing
# Pre-commit triggers transaction before commit completes
# Post-commit triggers transaction when commit is complete
# Pre-revprop-change triggers a transaction before the Version property is modified
# Post-revprop-change triggers a transaction after the version property has been modified
Ubuntu Create SVN server and set up submit and update to website