Thursday, 29 August 2013

How to setup an SVN Repository

# yum install httpd subversion mod_authz_ldap mod_dav_svn
 

# mkdir /var/www/svn
# cd /var/www/svn
 

# svnadmin create Project1
# ls Project1/
# cd /tmp/
 

# mkdir Project1
# cd Project1/
 

# mkdir branches tags trunk
# cd ..
 

# svn import Project1/ file:///var/www/svn/Project1 -m "Importing new project"
 

# svn list file:///var/www/svn/Project1/
# rm -rf Project1
# cd /var/www/svn/
 

# chown apache. -R *
# cd ..


# vim /etc/httpd/conf.d/subversion.conf
[
Location /Project1
DAV svn
SVNPath /var/www/svn/Project1

# Limit write permission to list of valid users.
# Require SSL connection for password protection.
# SSLRequireSSL

AuthType Basic
AuthzSVNAccessFile /etc/httpd/password/svnauthz.conf
AuthName "LDAP AUTHENTICATION"
AuthBasicProvider ldap
AuthLDAPURL ldap://192.168.0.20:389/ou=People,dc=my-domain,dc=com?uid?sub?(objectClass=*)
# AuthUserFile /path/to/passwdfile
Require valid-user
order allow,deny
Allow from all

Location
]


# mkdir /etc/httpd/password

# vim /etc/httpd/password/svnauthz.conf

[
[groups]
others = rick
linux = ctechz, btechz

[Project1:/]
@systemsteam = rw
@others = r

]

# service httpd restart


 SVN Client

tortoisesvn ------ for windows
smartsvn ------- for linux

# svn co http://192.168.0.20/Project1/trunk/
 

# cd trunk
# cp bin trunk
# svn add bin
 

# svn ci bin m "Adding project"
# svn ci test/ http://192.168.0.19/Project1/trunk/ -m "Adding project"
 

# cd
# svn import --username aby test/ http://192.168.0.19/Project1/trunk/ -m "Adding Project" ------ import to add a new project
 

# svn list http://192.168.0.19/Project1/trunk/

Setting UP a new SVN Project 

# cd /var/www/test
# ls
 

# svnadmin create PG_Script
 

# cd /tmp/
# mkdir PG_Script
# cd PG_Script/
 

# mkdir trunk branches tags
 

# ls
# cd
# cd /tmp/
 

# svn import PFG_Script/ file:///var/www/test/PG_Script/ -m "Importing Script"
 

# rm -rf PG_Script/
# cd /var/www/test
# ll
 

# chown apache.apache PFG_Script -R
 

# ll
# cd
 

# vim /etc/httpd/conf/httpd.conf
 

# vim /etc/httpd/passwd/svnauthz.conf
 

# /etc/init.d/httpd reload

# svn import --username aby test/ http://192.168.0.19/Project1/trunk/ -m "Adding Project" ------ import to add a new project


SVN check-out and check-in 

# svn co file:///var/www/svn/script/trunk/
# cp sqlbkp.sh /root/trunk/
# cd trunk/
 

# svn add sqlbkp.sh
# svn ci -m "import"


 Make a New dir

# mkdir dir
# cd dir/
# touch 1 2 3
# mkdir g t r
# cd .. 


# svn add dir
# svn ci -m "import"
# svn list file:///var/www/svn/script/trunk/

No comments:

Post a Comment