หน้าเว็บ

About me

Hi, I'm cheer. My interest relates to artificial intelligence, machine learning, computer vision, network communication, security algorithm.

วันอังคารที่ 6 กรกฎาคม พ.ศ. 2553

SVN set up & simple usage

1. apt-get install subversion
2. apt-get install libapache2-svn
3. nano /etc/apache2/mods-enabled/dav_svn.conf


DAV svn
SVNParentPath /home/svn
AuthType Basic
AuthName "Subversion Repository"
AuthUserFile /etc/subversion/dav_svn.passwd
#AuthzSVNAccessFile /etc/subversion/dav_svn.authz
Require valid-user


4. htpasswd -cm /etc/subversion/dav_svn.passwd zmc1

password : ******
re-type password : ******

5. nano /etc/subversion/dav_svn.authz

[groups]
developer = tee, pond


[test:/]
@developer = rw
testuser = r

[test:/doc]
@developer = rw
testuser = rw
* = r

6. mkdir /home/svn/
7. svnadmin create /home/svn/test
8. chown -R www-data: /home/svn/test
9. /etc/init.d/apache2 restart


SVN Server Setup

1. create directory in SVN server

svn mkdir http://localhost/svn/test/trunk
svn mkdir http://localhost/svn/test/branches
svn mkdir http://localhost/svn/test/tags

2. import project to SVN server directory (trunk)

svn import / http://localhost/svn/test/trunk

3. retrieve project from SVN server directory (trunk)

svn checkout http://localhost/svn/test/trunk //trunk

4. change owner to apache(www-data) in order to let apache can update files automatically

chown -R www-data: //trunk

5. activate auto-update for working directory

cp /home/svn/test/hooks/post-commit.tmpl /home/svn/test/hooks/post-commit
chmod +x /home/svn/test/hooks/post-commit
nano /home/svn/test/hooks/post-commit

add the following command at the bottom of this file

/usr/bin/svn update //trunk

6. hidden .svn file in working directory to web user

nano /etc/apache2/apache2.conf

/.svn/">
Order deny,allow
Deny from all




SVN Client Setup

1 Check out

$ svn checkout http://[ตรงนี้ใส่ ip หรือ host name ของ server]/svn/test/trunk/ //trunk


Credit :
1. http://www.ubuntuclub.com/node/1513
2. http://alephzarro.com/blog/2007/01/07/installation-of-subversion-on-ubuntu-with-apache-ssl-and-basicauth/
2.