Centos6.1 detailed setup of svn independent server

Source: Internet
Author: User
Tags install openssl
Centos6.1 detailed setup of svn independent server 1 prepare source package: Fuse source code installation directory:/usr/local/svn/version library user file directory/usr/local/svn/conf/passwd. con... centos6.1 detailed setup of svn independent server
1. prepare the source code package: two source code packages: subversion-1.6.20.tar.gzand subversion-deps-1.6.20.tar.gz.
Source code installation directory:/usr/local/svn/version library user file directory/usr/local/svn/conf/passwd. conf
The permission control file directory of the version Library:/usr/local/svn/conf/authz. conf requires glibc gcc libstdc ++ openssl-devel zlib
2 installation error
 

Solution: Mount the local iso image file and use the built-in installation package of centos6.1 to install and mount the local iso image.
./Configure-prefix =/usr/local/svn/-- with-neon = note that nothing is added
Note: openssl and openssl-devel must be installed before compilation and installation. Otherwise, the following error occurs:
Checking openssl/opensslv. h usability... no
Checking openssl/opensslv. h presence... no
Checking for openssl/opensslv. h... no
Configure: error: We require OpenSSL; try -- with-openssl
Configure failed for serf
Solution: yum-y install openssl-devel
3. after installation, add the environment variable PATH =/usr/local/svn/bin: $ PATH in/etc/profile.
4 source/etc/profile command/usr/local/svn/bin can be used
5. test whether the installation is successful.
 

6. create a version Library
1. create the version Library Directory mkdir-p/var/svndata/9000
Svnadmin create/var/svndata/9000. if you want to use svnadmin in any Directory, add the environment variable.
2. after creation, generate the following file. the conf directory contains the version Library configuration file svnserve. conf.
User password file passwd Group permission control file authz my user password configuration file and group permissions here
The file is stored in/usr/local/svn/conf/and is named passwd. conf authz. conf.

3. configure the version Library configuration file as follows:

4. Note that you do not need to restart svn to modify the user configuration file to take effect immediately.
5. automatically enable the svn service at/etc/rc. d/rc. local and add svnserve-d-r/var/svndata to enable automatic startup of svn.

Add another method to use svn as a server startup
SVN_HOME =/var/svndata 9. if [! -F "/usr/local/svn/bin/svnserve"] 10. then 11. echo "svnserver startup: cannot start" 12. exit 13. fi 14. case "$1" in 15. start) 16. echo "Starting svnserve... "17. /usr/local/svn/bin/svnserve-d -- listen-port 3690-r $ SVN_HOME # This 3690 is the default port 18. echo "Finished! "19 ..; 20. stop) 21. echo" Stoping svnserve... "22. killall svnserve 23. echo" Finished! "24 .;; 25. restart) 26. $0 stop 27. $0 start 28 .;; 29. *) 30. echo "Usage: svn {start | stop | restart}" 31. exit 1 32. esac 33. [root @ svn ~] # Chmod 755/etc/init. d/svn 34. [root @ svn ~] # Chkconfig svn on 35. [root @ svn ~] #/Etc/init. d/svn start
Note: If the script does not contain # chkconfig: Space-empty 85 spaces 15, the command "chkconfig-add svn" is displayed.
 

The correct settings are as follows:
 

After successful addition, the following information is displayed:

Set level 345 boot auto-start

I personally like the second method, which is simple and clear, but the principles are the same.
Enable the svn service: svnservice-d-r/var/svndata
Disable svn service: killall svnservice or kill-9 pid
Script to enable svn service: service svn start
Script to close the svn service: service svn stop
Script to restart svn service: service svn restart
Note: The error message "/etc/ini. d/svn" is returned. It was also reported that windows line breaks were deleted in windows Linux ^ M.
A problem found during startup: wa is reported for codes read in % c. It was later found to be related to scanf. In linux, % c reads the \ n and \ r characters. Therefore, delete the ^ M (that is, \ r) character.
There are many deletion methods.
Next: configure svn users and groups directly:

Password:
 
Below is the group
 
Note that the group here is suitable for large projects. I personally feel more organized.
Note that the svn configuration file must be written to the top level with spaces in the middle of the login user, for example: svnadmin = svnadmin
On the left is the login user name and on the right is the password
After the test is successful, the project is imported and the backup script is shown below.
To run the successful backup script, you must use ssh-kegen rsa and press enter to press Enter ..
Then use scp ~ /. Ssh/id_rsa.pub root@1xxx.xxx.xxx.xxx:/root/. ssh/authorized. keys copy id. rsa. pub to root/. ssh/on 240 and rename it authorized. keys

Then regularly execute the backup script
Crontab-e-u root

The following is the backup script content.

View the scheduled task crontab-l on the local machine
 
Check whether the remote server generates files. Note that the svnadmin hotcopy command in the script uses an absolute path.
 
The above process is tested and runs normally.

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.