Today started set up a svn for our final year project (BPEL-Mora). I tried to setup a svn server as apache 2 module.In that case svn repository is available to the client through the WebDAV/DeltaV protocol.
Version Contorl with Subversion book (by Ben Collins-Sussman,Brian W. Fitzpatrick & C. Mic\hael Pilato) was very useful to me when I struggle with the svn. The e-version of the book also available for free. I found it on my debian box
/usr/share/doc/subversion/book.
Url of the book: http://svnbook.red-bean.com/
First I installed apache2 using apt-get
#apt-get apache2
then subversion
#apt-get subversion
inorder to setup subversion with apache2 , we need to have mod_dav_svn plugin, In here I tried to use (or used rather) pre-compiled version from the debian repositories because otherwise the process get more complicated.
/**
*If you really need to compile apache2 and subversion you'r self following link might help you. But I *didn't get my dirty with it. :)
* http://www.linuxjournal.com/article/7655
**/
Now I need to install mod_dav_svn plugin, then tried serveral searches using aptitude. Then found out that libapache2-svn library is to provide mod_dav_svn plugin. Then I installed it.
#apt-get install libapache2-svn
Most interesting part is , when we install pre-compiled package using apt-get or aptitude they edit configaration files accordingly.
When we let to install apache2 to apt-get it install configuration fil\es to the /etc/apache2 , modules /usr/lib/apache2/modules. Most of the time apache2's default location is /usr/local/apache2
In normal installation the we found only httpd.conf for managing htt\pd server's configuration but in here debian manipulate two configuration files namely "apache2.conf" and "httpd.conf".
then as book stated I edited httpd.conf as following
LoadModule dav_module /usr/lib/apache2/modules/mod_dav.so
LoadModule dav_svn_module /usr/lib/apache2/modules/mod_dav_svn.so
and then restarted httpd server, it said
debian:/etc/apache2# /etc/init.d/apache2 restart
Forcing reload of web server: Apache2[Sun Mar 05 20:21:41 2006] [warn] module dav_module is already loaded, skipping
[Sun Mar 05 20:21:41 2006] [warn] module dav_svn_module is already loaded, skipping
[Sun Mar 05 20:21:42 2006] [warn] module dav_module is already loaded, skipping
[Sun Mar 05 20:21:42 2006] [warn] module dav_svn_module is already loaded, skipping
.
it seems that module already loaded then , I commented out that newly added two lines (little devation from the book).
debian:/etc/apache2# /etc/init.d/apache2 restart
Forcing reload of web server: Apache2.
since my intention to have more repositories in the svn,I added following lines to the apache2.conf
<Location /svn >
DAV svn
# any "/svn/foo" URL will map to a repository /usr/local/svn/foo
SVNParentPath /home/dinesh/svn (absolut path to repository)
</Location >
then created repository using 'svnadmin'
$svnadmin create file:///home/dinesh/svn/repos
then created directory in that repository
$svn mkdir file:///home/dinesh/svn/repos/guththila
first tried to acces repository using http:// protocole but it didn't work
when I tried acces repositoy using http:
dinesh@debian:~/tmp$ svn checkout http://127.0.0.1/svn/repos/guththila project
svn: PROPFIND request failed on '/svn/repos/guththila'
svn:
Could not open the requested SVN filesystem
Then tried to acces this repository using web http://127.0.0.1/svn/repos/guththila
<d:error>
<c:error>
<m:human-readable errcode="160029">
Could not open the requested SVN filesystem
</m:human-readable>
</c:error>
</d:error>
and apache error log in /var/log/apache/error.log said
[Sun Mar 05 20:40:02 2006] [error] [client 127.0.0.1] (20014)Error string not specified yet: Berkeley DB error while opening 'nodes' table for filesystem /home/dinesh/svn/repos/db:\nPermission denied
It seems that there was a problem in permissions. I found out following post
svnforum post
same problem :) .. Then I set permissions of the svn reposotory to the 777
#chmod -R 777 svn
then I was able to acces the repository through the web browser
http://127.0.0.1/svn/repos/
at one time I came across a database crashing , apache error log
[Sun Mar 05 17:23:51 2006] [error] [client 127.0.0.1] (20014)Error string not specified yet: Berkeley DB error while opening environment for filesystem /home/dinesh/svn/repos/db:\nDB_RUNRECOVERY: Fatal error, run database recovery, referer: http://127.0.0.1/svn/repos/
after seaching on the web found a similler kind of problem it said to goto repository db folder and run db_recovery.
search relusts
$cd ~/svn/repos/db
dinesh@debian:~/svn/repos/db$ db4.2_recover
then it recovered the database.
Now everything works fine but when I tried to commit into the repository
$svn commit -m "test"
svn: Commit failed (details follow):
svn: MKACTIVITY of '/svn/repos/!svn/act/3033bdb6-400e-0410-9aed-b2743e91598e': 500 Internal Server Error (http://localhost)
this happened because of I didn't have authontication method for my svn repository.
http://svn.haxx.se/dev/archive-2003-07/0925.shtml
http://svn.haxx.se/users/archive-2005-02/0548.shtml
then I entered basic authentication type
# htpasswd -cm /etc/svn-passwd dinesh
New password:
Re-type new password:
Adding password for user dinesh
# htpasswd /etc/svn-passwd -m thilina
New password:
Re-type new password:
Adding password for user thilina
and added following lines to the /etc/apache2.conf
<Location /svn >
DAV svn
SVNParentPath /usr/local/svn
AuthType Basic
AuthName "Subversion repository"
AuthUserFile /etc/svn-passwd
</ Location >
In this method , the problem is password is transmitted as plain text over the network.
Now I'm able to acces and commit svn repository over the network
Need to configure svn repository to use with ssl. Ill post the steps that I followed to
configure svn with ssl also
Version Contorl with Subversion book (by Ben Collins-Sussman,Brian W. Fitzpatrick & C. Mic\hael Pilato) was very useful to me when I struggle with the svn. The e-version of the book also available for free. I found it on my debian box
/usr/share/doc/subversion/book.
Url of the book: http://svnbook.red-bean.com/
First I installed apache2 using apt-get
#apt-get apache2
then subversion
#apt-get subversion
inorder to setup subversion with apache2 , we need to have mod_dav_svn plugin, In here I tried to use (or used rather) pre-compiled version from the debian repositories because otherwise the process get more complicated.
/**
*If you really need to compile apache2 and subversion you'r self following link might help you. But I *didn't get my dirty with it. :)
* http://www.linuxjournal.com/article/7655
**/
Now I need to install mod_dav_svn plugin, then tried serveral searches using aptitude. Then found out that libapache2-svn library is to provide mod_dav_svn plugin. Then I installed it.
#apt-get install libapache2-svn
Most interesting part is , when we install pre-compiled package using apt-get or aptitude they edit configaration files accordingly.
When we let to install apache2 to apt-get it install configuration fil\es to the /etc/apache2 , modules /usr/lib/apache2/modules. Most of the time apache2's default location is /usr/local/apache2
In normal installation the we found only httpd.conf for managing htt\pd server's configuration but in here debian manipulate two configuration files namely "apache2.conf" and "httpd.conf".
then as book stated I edited httpd.conf as following
LoadModule dav_module /usr/lib/apache2/modules/mod_dav.so
LoadModule dav_svn_module /usr/lib/apache2/modules/mod_dav_svn.so
and then restarted httpd server, it said
debian:/etc/apache2# /etc/init.d/apache2 restart
Forcing reload of web server: Apache2[Sun Mar 05 20:21:41 2006] [warn] module dav_module is already loaded, skipping
[Sun Mar 05 20:21:41 2006] [warn] module dav_svn_module is already loaded, skipping
[Sun Mar 05 20:21:42 2006] [warn] module dav_module is already loaded, skipping
[Sun Mar 05 20:21:42 2006] [warn] module dav_svn_module is already loaded, skipping
.
it seems that module already loaded then , I commented out that newly added two lines (little devation from the book).
debian:/etc/apache2# /etc/init.d/apache2 restart
Forcing reload of web server: Apache2.
since my intention to have more repositories in the svn,I added following lines to the apache2.conf
<Location /svn >
DAV svn
# any "/svn/foo" URL will map to a repository /usr/local/svn/foo
SVNParentPath /home/dinesh/svn (absolut path to repository)
</Location >
then created repository using 'svnadmin'
$svnadmin create file:///home/dinesh/svn/repos
then created directory in that repository
$svn mkdir file:///home/dinesh/svn/repos/guththila
first tried to acces repository using http:// protocole but it didn't work
when I tried acces repositoy using http:
dinesh@debian:~/tmp$ svn checkout http://127.0.0.1/svn/repos/guththila project
svn: PROPFIND request failed on '/svn/repos/guththila'
svn:
Could not open the requested SVN filesystem
Then tried to acces this repository using web http://127.0.0.1/svn/repos/guththila
<d:error>
<c:error>
<m:human-readable errcode="160029">
Could not open the requested SVN filesystem
</m:human-readable>
</c:error>
</d:error>
and apache error log in /var/log/apache/error.log said
[Sun Mar 05 20:40:02 2006] [error] [client 127.0.0.1] (20014)Error string not specified yet: Berkeley DB error while opening 'nodes' table for filesystem /home/dinesh/svn/repos/db:\nPermission denied
It seems that there was a problem in permissions. I found out following post
svnforum post
same problem :) .. Then I set permissions of the svn reposotory to the 777
#chmod -R 777 svn
then I was able to acces the repository through the web browser
http://127.0.0.1/svn/repos/
at one time I came across a database crashing , apache error log
[Sun Mar 05 17:23:51 2006] [error] [client 127.0.0.1] (20014)Error string not specified yet: Berkeley DB error while opening environment for filesystem /home/dinesh/svn/repos/db:\nDB_RUNRECOVERY: Fatal error, run database recovery, referer: http://127.0.0.1/svn/repos/
after seaching on the web found a similler kind of problem it said to goto repository db folder and run db_recovery.
search relusts
$cd ~/svn/repos/db
dinesh@debian:~/svn/repos/db$ db4.2_recover
then it recovered the database.
Now everything works fine but when I tried to commit into the repository
$svn commit -m "test"
svn: Commit failed (details follow):
svn: MKACTIVITY of '/svn/repos/!svn/act/3033bdb6-400e-0410-9aed-b2743e91598e': 500 Internal Server Error (http://localhost)
this happened because of I didn't have authontication method for my svn repository.
http://svn.haxx.se/dev/archive-2003-07/0925.shtml
http://svn.haxx.se/users/archive-2005-02/0548.shtml
then I entered basic authentication type
# htpasswd -cm /etc/svn-passwd dinesh
New password:
Re-type new password:
Adding password for user dinesh
# htpasswd /etc/svn-passwd -m thilina
New password:
Re-type new password:
Adding password for user thilina
and added following lines to the /etc/apache2.conf
<Location /svn >
DAV svn
SVNParentPath /usr/local/svn
AuthType Basic
AuthName "Subversion repository"
AuthUserFile /etc/svn-passwd
</ Location >
In this method , the problem is password is transmitted as plain text over the network.
Now I'm able to acces and commit svn repository over the network
Need to configure svn repository to use with ssl. Ill post the steps that I followed to
configure svn with ssl also
3 comments:
Did you already configure svn with ssl?
#apt-get apache2
then subversion
#apt-get subversion
----
# apt-get install apache2
# apt-get install subversion
#apt-get apache2
then subversion
#apt-get subversion
----
# apt-get install apache2
# apt-get install subversion
Post a Comment