OS = RHEL/CentOS/Fedora
1. Install LAMP or at least httpd and php
yum install httpd php php-common
yum install php-pecl-apc php-cli php-pear php-pdo php-mysql php-pgsql php-pecl-mongo php-sqlite php-pecl-memcache php-pecl-memcached php-gd php-mbstring php-mcrypt php-xml
start apache:
Start apache server:
/etc/init.d/httpd start ## use restart after update ## OR ## service httpd start ## use restart after update chkconfig --levels 235 httpd on |
Add following content to /var/www/html/test.php file to test php
<?php phpinfo(); ?>
2. then install svn:
yum install mod_dav_svn subversion
Add following config to /etc/httpd/conf.d/subversion.conf file:
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
<Location /svn>
DAV svn
SVNParentPath /var/www/svn
AuthType Basic
AuthName "Subversion repositories"
AuthUserFile /etc/svn-auth-users
Require valid-user
</Location>
|
Add subversion users:
## Create testuser ##
htpasswd -cm /etc/svn-auth-users testuser
New password:
Re-type new password:
Adding password for user testuser
## Create testuser2 ##
htpasswd -m /etc/svn-auth-users testuser2
New password:
Re-type new password:
Adding password for user testuser2
|
Create and configure SVN repository
Restart Apache:
Goto http://localhost/svn/testrepo address and you should see something like following, write username and password:
6. Configure repository
To disable anonymous access and enable access control add following rows to testrepo/conf/svnserve.conf file:
7. Create trunk, branches and tags structure under testrepo
Create “template” directories with following command:
Then import template to project repository using “svn import” command:
Check results on browser and see testrepo revision 1:
svnadmin create /var/www/svn/iphone-mirror
chown -R apache.labtools /var/www/svn/iphone-mirror
vi /var/www/svn/iphone-mirror/hooks/pre-revprop-change
#!/bin/sh
USER="$3"
if [ "$USER" = "user-who-is-allowed-to-do-the svnsync" ]; then exit 0; fi
echo "Only the svnsync user can change revprops" >&2
exit 1
chmod 755 /var/www/svn/iphone-mirror/hooks/pre-revprop-change
svnsync init --username cccc file:///var/www/svn/iphone-mirror svn://xx.xx.xx.121:3692/
svnsync sync --username cccc file:///var/www/svn/iphone-mirror
------------------------------------------------------------------------------------------
more URL's
http://svn.apache.org/repos/asf/subversion/trunk/notes/svnsync.txt
http://josephscott.org/archives/2010/01/setting-up-svnsync-and-svn-notify/
http://www.kirkdesigns.co.uk/mirror-svn-repository-svnsync
https://blogs.oracle.com/ashamash/entry/using_svnsync_to_migrate_an
http://blogs.collab.net/subversion/mirroring-repos
Schedule a cron job to run the sync periodically, say once every hour (on a nice odd number like 17 after the hour):
17 * * * * /usr/local/bin/svnsync --non-interactive sync file:///home/svn/repo-name
No comments:
Post a Comment