Showing posts with label svn. Show all posts
Showing posts with label svn. Show all posts

Tuesday, November 4, 2008

creating svn repository in Fedora

Lets first install subversion (svn server packages) and Apache module for subversion:

$ yum -y install subversion mod_dav_svn

$cd /etc/httpd/conf.d/
$ vi subversion.conf

# Make sure you uncomment the following if they are commented out
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so

# Add the following to allow a basic authentication and point Apache to where the actual
# repository resides.

DAV svn
SVNPath /var/www/svn/repos
AuthType Basic
AuthName "SVN Access"
AuthUserFile /etc/httpd/conf.d/svnpassowrd
Require valid-user


Add user who can access the repository:
$ htpasswd -cm /etc/httpd/conf.d/svnpassowrd user1
(It will ask for the apssword for the user 'user1')

$ htpasswd -m /etc/httpd/conf.d/svnpassowrd user2
(It will ask for the apssword for the user 'user2')

Create the repository:

$ cd /var/www/
$ mkdir svn
$ cd svn
$ svnadmin create repos
$ chown -R apache:apache repos
$ service httpd restart

Access repository from a web browser:
http://ip-address/repos
(It will ask the apache authentication user and password, supply the user/pass we created using htpasswd command)

Imporing a project into repository:
$ svn import /home/sanjay/testproj/ file:///var/svn/repos/testptoj -m "initial testproject"

Here "repos" is the svn repository (created by svnadmin create command) and "testproj" is one project inside this repository.
/home/sanjay/testproj is the folder containing all the files we want to be in repos.

Adding a dir tree in the existing repository.
Case: Although we can use the svn add/commit but if the dir is too big and there is no UI access for svn repository then
better use the "import" command of svn.


Now if we want to add "wiki" folder into the "testproj" then use the import as below"

$ svn import /home/sanjay/testproj/wiki/ file:///var/svn/repos/testproj/wiki -m "wiki folder in testproj"

Friday, June 29, 2007

add svn repository

1. add one svn user and group

$ useradd svn -c "SVN Owner" -s /bin/false
(-c comment, -s shell , here no shell access)

2. If we want more than one repository then add group for each one.

$ groupadd reposgp
$ usermod -G reposgp svn
(Add this group to svn user/group)

3. Create a Subversion repository

We are creating it at /var ; svn will be the folder containing all repos
$ install -v -m 0755 -o svn -g svn -d /var/svn
$ svnadmin create --fs-type fsfs /var/svn/repos

(Here 'repos' will be our repos)

Now we can import some files/dir to the repos

$ svn import -m "Initial import." /path/to/source/tree
file:///var/svn/repos


Now change owner and group information on the repository, and add
an unprivileged user to the svn and reposgp groups:

$ chown -R svn:odotgp /var/svn/repos
$ chmod -R g+w /var/svn/repos
$ chmod g+s /var/svn/repos/db
$ usermod -G svn,repsogp sanjay

(here sanjay is already a user in the system)

We can verify the existing groups of user with the commands

$ groups sanjay

Whats new in Ajuby 0.5