First, the required packages
1, apr-1.4.6.tar.gz:http://apr.apache.org/
2, apr-util-1.4.1.tar.gz:http://apr.apache.org/
3, pcre-8.20.tar.gz:http://www.pcre.org/
4, SERF-1.2.1.TAG.BZ2:HTTP://PAN.BAIDU.COM/S/1DDHFMHV
This library provides support for HTTP and HTTPS protocols. It is worth noting that, before the 1.8 version, it relied on neon,1.8 and changed it to Serf.
5, Sqlite-amalgamation, this is more special, because it is directly with his source files, and need to put the correct path. : Http://www.sqlite.org/snapshot/sqlite-amalgamation-201404281756.zip
Extract the code into the SVN source directory root directory and name it sqlite-amalgamation, otherwise you will be prompted sqlite3 error when installing subversion
Ii. Compiling and installing subversion
If there is an older version of subversion, then uninstall Yum Erase Subversion
./configure--prefix=/usr/local/subversion--with-apxs=/usr/local/httpd/bin/apxs--with-apr=/usr/local/apr/-- with-apr-util=/usr/local/apr-util/--with-zlib--with-openssl--enable-maintainer-mode make && make install
Third, add environment variable (permanent) after successful installation
Using VI to add a variable to the file/etc/profile file, the variable will be valid for all users under Linux and is "permanent".
Vi/etc/profile export path= "$PATH:/usr/local/subversion/bin/"
To make the changes take effect immediately, you need to execute the following code
Source/etc/profile
Iv. Check if the installation is successful
Subversion--version
If you have a libsvn_subr-1.so.0:undefined symbol:apr_atomic_xchgptr error prompt, the workaround is: http://www.cnblogs.com/rnckty/p/4560262.html
V. Configuring Subversion
1, build the project's repository directory (/VAR/SVN) (can be set up, after the new library, the following items need to be reconfigured)
Mkdir-p/var/svn/web (Creating a repository directory for Web projects)
2. Set up SVN repository for Web projects
Svnadmin Create/var/svn/web
3. Modify the Repository configuration file
Vi/var/svn/web/conf/svnserve.conf
Each parameter function is described in the comments in the configuration file, which is configured as follows:
[General] anon-access = None # makes unauthorized users inaccessible auth-access = Write # gives authorized users Write permission password-db = passwd # indicates password file path authz-db = a Uthz # Access Control file
The other uses the default configuration. Each statement must be shelf write, the left can not leave a blank, otherwise there will be an error.
4. Configure users
vi/var/svn/web/conf/passwd
Enter the following:
[Users]
username1 = Password1
UserName2 = Password2
You can add multiple, this is the user name password pair.
5. Configure permissions
Vi/var/svn/web/conf/authz
This configuration file sets the authorization for each user.
Includes read-only R, read-write RW. If no users are listed, access is not allowed. You can also group users, please refer to the SVN manual, the following is a simple example:
#对仓库web根目录权限设置
[web:/]
User1 = RW
User2 = R
6. import files using Import
The new repository is empty and needs to be imported into the working directory.
This statement will import the files found under path/var/www/web into the Subversion repository you created.
SVN import/var/www/web/file:///var/svn/web/-M "comment"
Vi. Start-up service
svnserve-d-r/var/svn/-D daemon-R runs as root user
Vii. Project Check-out
SVN CHECKOUT, Svn://ip/web Enter user name and password
Viii. Articles of Reference
Http://www.linuxidc.com/Linux/2014-05/101232.htm
Https://wiki.archlinux.org/index.php/Subversion_Setup_ (%e7%ae%80%e4%bd%93%e4%b8%ad%e6%96%87)
Http://blog.51yip.com/server/291.html
Http://www.linuxidc.com/Linux/2012-02/53109.htm
Linux Standalone Installation subversion-1.8.18