In Linux, I have read a lot of blogs about subversion configuration on the Internet.
The above operation cannot be configured successfully, but it is not very clear. I would like to recommend the book "using subversion for Version Control". There is a Chinese electronic file on the Internet. This book provides a detailed introduction to subversion. If you are interested, you can take a look. Here I will only introduce the basic usage of subversion and the combination with Apache.
1. Basic usage
SVN command line Client Program
Svnversion this tool is used to display the working copy status
Svnlook tool for directly viewing the Subversion version Library
Svnadmin tool for creating, adjusting, and repairing the Subversion Library
Svndumpfilter
Svnserver is a separate server program that can be called as a daemon or by SSH.
Svnsync a program that uses a network incremental image version Library
Svnadmin create/mnt/websvn # create a version library websvn
SVN import myfile file: // MNT/websvn/Hello # the fastest way to import the last version file to the version library is to create an intermediary directory as needed
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/43/5F/wKiom1PZ-XWj1ZeQAABNoCp-XTQ251.jpg "Title =" Screenshot-2.png "alt =" wKiom1PZ-XWj1ZeQAABNoCp-XTQ251.jpg "/>
SVN list file: // MNT/websvn/Hello # list files in the version Library
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/43/5F/wKioL1PZ-qTDSI3tAAAajSf5VCg377.jpg "Title =" Screenshot-3.png "alt =" wKioL1PZ-qTDSI3tAAAajSf5VCg377.jpg "/>
SVN checkout file: // MNT/websvn/Hello # store the latest version of the file in the version library locally. After execution, a local Hello folder (also called a work copy) is generated ), -R + version number, which can be used to obtain the working copy of the specified version number. For example: SVN
Checkout-R 4 file: // MNT/websvn/Hello
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/43/5F/wKioL1PZ-ubgZ44vAABAnsA3BzU351.jpg "Title =" Screenshot-4.png "alt =" wKioL1PZ-ubgZ44vAABAnsA3BzU351.jpg "/>
SVN checkout file: // MNT/websvn/Hello/tmp/Hello # store the latest file version in the repository locally
SVN update # update your work copy and the latest version. Synchronize SVN Add/delete/copy/move # Make changes
SVN status/diff (-v) # verify the modification
A Indicates the files, directories, or symbolic chains to be added to the version library.
C Indicates a file conflict occurs. When the slave server is updated, it overlaps with the local version.
D indicates that files, directories, or symbolic links are deleted from the version library.
M indicates the file content has been modified.
SVN revert file # cancel some modifications to the file
SVN commit-M "TXT" # submit your changes to the version library. When you submit changes, you need to provide some log information that describes the modifications, your information will be attached to this revision. The-M option is used to provide this information.
SVN log # provides you with a record, including: Who made changes to files, directories, which revisions were made, the date and time of the revisions, and the log information you provided at that time
######### Common command line commands for SVN #############
########## SVN + Apache configuration ##############
1. Install software
Yum install subversion mod_dav_svn httpd-y
2. Configure Apache
CD/etc/httpd/CONF. d/
Vim subversion. conf
Loadmodule dav_svn_module/etc/httpd/modules/mod_dav_svn.so
Loadmodule authz_svn_module/etc/httpd/modules/mod_authz_svn.so
<Location/SVN> # request from/SVN for all URL paths of Apache proxy to SVN provider Dav
Dav SVN
Svnpath/mnt/Hello/websvn # Note path
Authtype basic
Authname "Authorization realm"
Authuserfile "/etc/httpd/CONF. d/authsvn" # httpd-based authentication
Require valid-user
</Location>
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/43/5F/wKiom1PZ-emyxWL1AAFlf56zZ2Q041.jpg "Title =" Screenshot-5.png "alt =" wKiom1PZ-emyxWL1AAFlf56zZ2Q041.jpg "/>
Htpasswd-CM/etc/httpd/CONF. d/authsvn test (enter the password twice) # generate the authentication File
3. Configure Subversion
Mkdir dir; CD dir
Touch file {1, 2, 3} {a, B, c}
Svnadmin create/mnt/Hello/websvn
SVN import dir file: // MNT/Hello/websvn/qwg
SVN list file: // MNT/Hello/websvn/qwg
SVN status-V
CD/mnt/Hello/websvn/CONF/
VI svnserver. conf
Svnpath/mnt/Hello/websvn/qwg
Anon-access = read
Auth-access = write
Password-DB = passwd
Authz-DB = authz
Realm = websvn
VI passwd
Test = westos (username = test, password = westos, same as the password executed by htpasswd)
VI authz
Admin = test
[/]
Admin = RW
* = R
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/43/5F/wKiom1PZ-gWy7LEeAACES-ruiKQ083.jpg "Title =" Screenshot-7.png "alt =" wKiom1PZ-gWy7LEeAACES-ruiKQ083.jpg "/>
4./etc/init. d/httpd start
/Etc/init. d/svnserver start
Access http: // 127.0.0.1/SVN to view the version library file.
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/43/5F/wKioL1PZ-32x3H0HAADDsKH6ftA932.jpg "Title =" Screenshot-8.png "alt =" wKioL1PZ-32x3H0HAADDsKH6ftA932.jpg "/>
The above only lists some simple usage and configuration methods of subversion. For more information about how to use and configure subversion, please refer to the recommended books. If you have any errors, please refer to them.