Subversion
Install Subversion that is the software for version control.
For this example, Use Subversion with WebDAV function, so httpd is required and SSL settings is also done. |
|
[1] | Install and Configure Subversion. |
[root@www ~]#
yum -y install subversion mod_dav_svn
[root@www ~]#
vi /etc/httpd/conf.d/subversion.conf
# line 26-39: uncomment and change like follows
DAV svn SVNParentPath /var/www/svn
# # Limit write permission to list of valid users.
# Require SSL connection for password protection. SSLRequireSSL
AuthType Basic
AuthName "Authorization Realm" AuthUserFile
/etc/httpd/conf/.htpasswd
# specify access control file
AuthzSVNAccessFile /etc/svnusers
Require valid-user
[root@www ~]#
vi /etc/svnusers
# set access right like an example below
[site:/]
# all users are writable
* = rw
# cent is writable
[site:/directory] cent = rw
# userB is readable
userB = r
# userC is not permitted
userC =
mkdir -p /var/www/svn/site
[root@www ~]#
svnadmin create /var/www/svn/site
# create a repository
[root@www ~]#
chown -R apache. /var/www/svn
[root@www ~]#
htpasswd -c /etc/httpd/conf/.htpasswd cent
# add a user
New password:
# set password
Re-type new password: Adding password for user cent [root@www ~]#
/etc/rc.d/init.d/httpd restart
Stopping httpd:
[ OK ]
Starting httpd:
[ OK ]
|
This is Client Settings. For example, Install TortoiseSVN on Windows 7. .NET Framework 4 is required. Download and Install
TortoiseSVN.
|
|
[1] | After installation, Execute "Import" first to click a folder you'd like to set under version control follows. |
![]() |
[2] | Specify repository's URL like follows. [ "https://(hostname or IP address)/repos/(repository name)" ] |
![]() |
[3] | Click "Accept Permanently", it's no ploblem, it's shown because certificates are signed by yourself. |
![]() |
[4] | Authentication required. Login as a user you set in htpasswd. |
![]() |
[5] | After authentication, importing starts. |
![]() |
[6] | Execute "Cherckout" next. Create a working folder and right click "SVN Checkout" on the menu. |
![]() |
[7] | Select repository's URL and checkout directory and click "OK". |
![]() |
[8] | Click OK to finish. |
![]() |
[9] | These are Basic usage to manage version control by TortoiseSVN. |
This is the how to for updating repository.
|
|
[1] | Configure for automatic properties first. Click "Setting". |
![]() |
[2] | Click "Edit" button. |
![]() |
[3] | Scroll down to lower of the file, then uncomment the line (1), next, add extensions for automatic properties. |
![]() |
[4] | Move to working directory and try to update files. Then, the color of icon edited just turns like follows. |
![]() |
[5] | Click the file edited with right button and select "SVN Commit" to update repository from this updating. |
![]() |
[6] | Updating files are listed like follows. Check boxes for files you'd like to update in repository. |
![]() |
[7] | Repository is just updated. |
![]() |
[8] | These are how to update repository. |
![]() |
Subversion
Subversion - Update Data from Repository
|
This is how to update data on server from Subversion's repository. For
this example, Update data under /var/www/html from repository.
This example based on that there are no data under the directory on server in initial operation.
|
|
[1] | It's necesarry to checkout to the data-directory as an initial operation on server. |
# svn co [repository] [a directory you'd like to update]
[root@www ~]#
svn co file:///var/www/svn/site /var/www/html
|
[2] | Operate like follows to update data from repository. |
[root@www ~]#
svn update /var/www/html
U /var/www/html/policy.html Updated to revision 4. |
[3] | If you'd like to change properties of files, create a script like follows. |
[root@www ~]#
vi svn-update.sh
# update data and also change owner and permission of files
# this is an example #!/bin/bash svn update /var/www/html find /var/www/html -type d -print0 | xargs -0 chmod 705 chown -R fermi. /var/www/html while read FILE PERM do find /var/www/html -name "$FILE" -type f -print0 | xargs -0 chmod $PERM done <
chmod 700 svn-update.sh
[root@www ~]#
./svn-update.sh
U /var/www/html/note.cgi Updated to revision 9. |
Subversion