home   |   about us   |   our network   |   services   |   affiliates   |   contact
 
Services
» Web Hosting
» Reseller Hosting
» Dedicated Servers
» Windows/ASP.net Hosting
» Managed Web Hosting
» Server Security / Auditing
» Remote Backup / Storage
» Linux VDS
» Windows VDS
 
Support
» Support Desk
» Client Login
» Forums
» FAQs
» Help Files
» Acceptable Use Policy
» Client Testimonials
» Blog
 
Tutorials
» Dedicated Server Tutorial
» Website Optimization
» Search Engine Optimization
» Web Hosting Tutorials
» Web Programming Tutorials
» Networking Tutorials
» Virtual Server Tutorials
» Resources

The Crucial Blog - Archive

September 2, 2008

Using Subversion/SVN on cPanel Servers

is a free/open-source version control system. This article will explain you about how to use in servers mainly cpanel servers. Subversion uses copy-modify-merge model for its working.

Access Methods :

Subversion repositories can be accessed using different methods.

Syntax             Access Method
————————————
1. file:///    direct repository access (on local machine)
2. http://            access via WebDAV protocol to Subversion-aware Apache server
3. https://    same as http://, but with SSL encryption.
4. svn://            access via custom protocol to an svnserve server
5. svn+ssh://    same as svn://, but through an SSH tunnel.
————————————

1. If you are accesssing the subversion repository from the local machine, use the following syntax to access the file.

$ svn list file:///path/to/repos.

For eg: If you have ssh access to the server, login to the shell and repository contents can be listed as,

$svn list file:///home/testuser/testrepo

The command ‘list’ will display the repository contents.

2. We can use http URLs to access svn repository.

$svn list http://domainname/path/to/repository

If you have any space in the URLs used, give the URLs in quotes,

$svn list “http://domainname/path with space /to/repository”

This will take the URL as a single argument to svn program.

Note : As we are not using a Subversion-aware Apache server, it is not possible to access repository from our server directly using http(or https).

3. You can access the svn repository from our server using svn+ssh method, like

$svn list svn+ssh://username@domainname/home/username/public_html/testrepo/

Creating a new subverion repository in your home directory on our server:

$svnadmin create /path/to/repository

You can have your own working copy of a project. Your working copy is your own private work area. Subversion will never add other people’s changes, nor make your own changes available to others, until you explicitly do so. After making changes to the working copy, you can publish the changes to the repository. You can also merge the changes made by other people to your working directory.

You can create a private copy of an existing project using ‘checkout’ command.

$svn checkout /path/to/project

Usually we start working on a project by using a working copy.

To publish changes, use the ‘commit’ command.

$svn commit <modified file name> -m “changes made in file”

After -m, we are mentioning a note of the changes made to the file.

If you want to update others changes to your working copy, use the ‘update’ command.

$svn update

You can add new files to the subversion repository using the import command.

$svn import <file/directory> file:///path/to/repos -m “Initial import”

For eg, to import files in your local machine to a repository created by you on our server,

$svn import -m ‘Initial Import’ <path to file/directory to be copied from local machine> svn+ssh://username@domainname/home/username/testrepo

You will get error “svn: ‘.’ is not a working copy” if the path mentioned for the repository is not correct.

Recommended repository layout :

Subversion’s flexibility allows you to create your repository in any way, but the recommended way is to create a trunk directory to hold the “main line” of development, a branches directory to contain branch copies, and a tags directory to contain tag copies, like

$svn list file:///path/to/repos
/trunk
/branches
/tags

A small description of svn commands :

* Update your working copy
$svn update

* Make changes
$svn add  <filename>

Add file, directory, or symbolic link to the existing repository.

$svn delete <filename>

Delete file, directory, or symbolic link from the repository.
$svn copy <file1> <file2>

Create a new file file2 as a duplicate of file1 and automatically schedule file2 for addition.

$svn move

This command is exactly the same as running svn copy file1 file2; svn delete file1.

* Examine your changes
$svn status
$svn diff

* Possibly undo some changes
$svn revert

* Resolve Conflicts (Merge Others’ Changes)
$svn update
$svn resolved

* Commit your changes
$svn commit

Creating users to access the subversion repository using authentication(Using Access Method 4):
————————————————————————-

We can give access to some authenticated users to the repository using the
svnserve daemon. Suppose that you have created a test repository /home/username/testrepo.
Add the following lines in /home/username/testrepo/conf/svnserve.conf.

======================
[general]
anon-access = read
auth-access = write
realm = Test Repository
password-db = passwd
======================

By this anonymous users will have read access and only authenticated users will have write access to the repository. The realm is a name that you define. The authenticated user’s details are mentioned in the file ‘passwd’ in the same directory as that of the configuration file(/home/username/testrepo/conf/passwd).

passwd file :
======================
Username = testpass
======================

Now users can use these login details to write to the repository from shell. For this, svnserve daemon should be running on the server. If it is not running serverwide, you can start svnserve daemon as follows.

#svnserve -d -r /home/username/testrepo/

Using the -r option effectively modifies the location that the program treats as the root of the file system space it can access.

Now you can access the repository as follows.
==================================
# svn import -m ‘Initial Import’ test svn://domainname/testrepo/
Authentication realm: <svn://domainname:3690> Test Repository
Password for ‘root’:
Authentication realm: <svn://domainname:3690> Test Repository
Username: Username
Password for ‘Username’:
Adding test/test.html

Committed revision 1.
==================================

At first when it prompt for root password, just enter without giving anything. Then you can give username and password. Svn will cache the login from a particular IP and will not prompt for password every time that user access the repository. The passwords are cached in the directory /home/username/.subversion/auth. It is not insecure as the ‘auth/’ caching area is permission-protected so that only the user(owner) can read data from it, not the world at large. If that’s still not safe for you, you can disable credential caching by uncommenting the line ‘store-auth-creds = no’ in the file /home/username/.subversion/config.

Note :
Currently we are not running svnserve daemon all the time on the server. If we are permitting users to run the svnserve daemon to a particular repository, it will make a conflict if another user try to run this daemon under their repository.

To ensure that the svnserve gets started whenever the server is booted, we must add a @reboot line to the root crontab as follows.

———————————
@reboot svnserve -d -r /home/
———————————

Now any user’s repository under /home can be accessed using svnserve daemon by authentication.

Reference :

http://svnbook.red-bean.com/en/1.4/svn.intro.whatis.html

Tags: , ,

No Comments

Filed under: Uncategorized by — aaron @ 5:26 pm


February 13, 2008

Installing Subversion Using yum on CentOS 5 (Error: Missing Dependency: perl(URI) >= 1.17 is needed by package subversion)

While attempting to install via today, I received the following error:

[root@sXXX ~]# yum install subversion
Loading “installonlyn” plugin
Setting up Install Process
Setting up repositories
extras 100% |=========================| 1.1 kB 00:00
updates 100% |=========================| 951 B 00:00
base 100% |=========================| 1.1 kB 00:00
addons 100% |=========================| 951 B 00:00
Reading repository metadata in from local files
Excluding Packages in global exclude list
Finished
Parsing package install arguments
Resolving Dependencies
–> Populating transaction set with selected packages. Please wait.
—> Downloading header for subversion to pack into transaction set.
subversion-1.4.2-2.el5.i3 100% |=========================| 42 kB 00:00
—> Package subversion.i386 0:1.4.2-2.el5 set to be updated
–> Running transaction check
–> Processing Dependency: libaprutil-1.so.0 for package: subversion
–> Processing Dependency: perl(URI) >= 1.17 for package: subversion
–> Processing Dependency: libneon.so.25 for package: subversion
–> Processing Dependency: libapr-1.so.0 for package: subversion
–> Restarting Dependency Resolution with new changes.
–> Populating transaction set with selected packages. Please wait.
—> Downloading header for apr-util to pack into transaction set.
apr-util-1.2.7-6.i386.rpm 100% |=========================| 7.3 kB 00:00
—> Package apr-util.i386 0:1.2.7-6 set to be updated
—> Downloading header for neon to pack into transaction set.
neon-0.25.5-5.1.i386.rpm 100% |=========================| 6.7 kB 00:00
—> Package neon.i386 0:0.25.5-5.1 set to be updated
—> Downloading header for apr to pack into transaction set.
apr-1.2.7-11.i386.rpm 100% |=========================| 10 kB 00:00
—> Package apr.i386 0:1.2.7-11 set to be updated
–> Running transaction check
–> Processing Dependency: libpq.so.4 for package: apr-util
–> Processing Dependency: perl(URI) >= 1.17 for package: subversion
–> Restarting Dependency Resolution with new changes.
–> Populating transaction set with selected packages. Please wait.
—> Downloading header for postgresql-libs to pack into transaction set.
postgresql-libs-8.1.11-1. 100% |=========================| 16 kB 00:00
—> Package postgresql-libs.i386 0:8.1.11-1.el5_1.1 set to be updated
–> Running transaction check
–> Processing Dependency: perl(URI) >= 1.17 for package: subversion
–> Finished Dependency Resolution
Error: Missing Dependency: perl(URI) >= 1.17 is needed by package subversion

Steps to resolve this:

1. Download the perl(URI) with version greater than 1.17 using the following command.

wget http://fr.rpmfind.net//fedora/core/3/x86_64/os/Fedora/RPMS/perl-URI-1.30-4.noarch.rpm

2. Install the specified package using the follwing command.

rpm -i perl-URI-1.30-4.noarch.rpm

3. Install subversion using “yum”.

yum install subversion
You should now have successfully installed Subversion:

[root@sXXX ~]# svn help
usage: svn [options] [args]
Subversion command-line client, version 1.4.2.
Type ‘svn help ‘ for help on a specific subcommand.
Type ‘svn –version’ to see the program version and RA modules
or ‘svn –version –quiet’ to see just the version number.

Most subcommands take file and/or directory arguments, recursing
on the directories. If no arguments are supplied to such a
command, it recurses on the current directory (inclusive) by default.

Available subcommands:
add
blame (praise, annotate, ann)
cat
checkout (co)
cleanup
commit (ci)
copy (cp)
delete (del, remove, rm)
diff (di)
export
help (?, h)
import
info
list (ls)
lock
log
merge
mkdir
move (mv, rename, ren)
propdel (pdel, pd)
propedit (pedit, pe)
propget (pget, pg)
proplist (plist, pl)
propset (pset, ps)
resolved
revert
status (stat, st)
switch (sw)
unlock
update (up)

Subversion is a tool for version control.
For additional information, see http://subversion.tigris.org/

Tags: , , , ,

No Comments

Filed under: Uncategorized by — aaron @ 7:17 pm




     

Quick Links: Debian Dedicated Servers, Direct Deposit Hosting, Unmetered Dedicated Servers, Virtual Dedicated Servers, Windows Server Management, High Traffic Web Hosting - Load Balanced Clusters, Windows 2008 Server Virtual Dedicated Servers