If Not True Then False

Install SVN Server on Fedora 25/24, CentOS/RHEL 7.3/6.8/5.11 - Comment Page: 8

This is guide, howto install SVN (Subversion) server on Fedora 25/24/23/22/21/20, CentOS 7.3/6.8/5.11, Red Hat (RHEL) 7.3/6.8/5.11. What is SVN (Subversion)? Subversion is a free/open-source version control system. Subversion manages files and directories, and the changes made to them, over time. This allows you to recover older versions of your data, or examine the history of how your data...

311 Comments

Leave a Comment

Your email address will not be published. Required fields are marked *

Input your comment.
help

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Input your name.

Shaikh Zahid Hossain

I am following this step but Last IMPORT command Not relocalted

root@atomix# svn import -m ‘Initial import’ /tmp/svn-structure-template/ http://114.134.91.91/svn/testrepo/
Authentication realm: Subversion repositories
Password for ‘root’:
Authentication realm: Subversion repositories
Username: sk
Password for ‘sk’:
svn: Repository moved permanently to ‘http://114.134.91.91/svn/testrepo/’; please relocate
[root@atomix ~]#

Can’t import “trunk,branches,tags”
pls help any one

reply Reply
JR

Hi Shaikh Zahid Hossain,

Could you post your config files example to http://pastebin.com

And output of following commands here:


ls -ladZ /var/www/svn

ls -laZ /var/www/svn

I assume here, that you have used /var/www/svn location for repos.

reply Reply
Adi

Hi JR,

First of all I wann thank you for your useful blog.

I have same issue as Max.

I have tried below two commnads

1. chcon -R -t httpd_sys_content_t /var/www/svn/repository

Above commnad went through fine

2. chcon -R -t httpd_sys_rw_content_t /var/www/svn/repository

This Command Gave me Error:

chcon: failed to change context of /var/www/svn/repository to system_u:object_r:httpd_sys_rw_content_t: Invalid argument
chcon: failed to change context of /var/www/svn/repository/format to system_u:object_r:httpd_sys_rw_content_t: Invalid argument

Then I tried the commands as suggested to MAX

1. chcon -h system_u:object_r:httpd_sys_rw_content_t /var/www/svn/repository

Error: chcon -h system_u:object_r:httpd_sys_rw_content_t /var/www/svn/repository
chcon: failed to change context of /var/www/svn/repository to system_u:object_r:httpd_sys_rw_content_t: Invalid argument

2. chcon -R -h apache:object_r:httpd_sys_rw_content_t /var/www/svn/repository/*

Error: chcon -R -h apache:object_r:httpd_sys_rw_content_t /var/www/svn/repository/*
chcon: failed to change context of /var/www/svn/repository/conf to apache:object_r:httpd_sys_rw_content_t: Invalid argument
chcon: failed to change context of /var/www/svn/repository/conf/authz to apache:object_r:httpd_sys_rw_content_t: Invalid argument

My Machine details:

uname -a
Linux adc6140502 2.6.18-164.0.0.0.1.el5xen #1 SMP Wed Sep 2 22:48:20 EDT 2009 i686 i686 i386 GNU/Linux

lsb_release -a
LSB Version: :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch
Distributor ID: EnterpriseEnterpriseServer
Description: Enterprise Linux Enterprise Linux Server release 5.4 (Carthage)
Release: 5.4
Codename: Carthage

rpm -qa coreutils\* selinux\* |sort
coreutils-5.97-23.el5
selinux-policy-2.4.6-255.el5
selinux-policy-devel-2.4.6-255.el5
selinux-policy-minimum-2.4.6-255.el5
selinux-policy-mls-2.4.6-255.el5
selinux-policy-strict-2.4.6-255.el5
selinux-policy-targeted-2.4.6-255.el5

Please help

reply Reply
Steve

First off thanks for the directions. I’m up and running but having an issue on commit:
In my checked out dir, I first did an ADD for a bunch of new files and directories. svn status reports ok that files are ready to add. Upon attempting my first commit I get:

svn: Commit failed (details follow):
svn: Server sent unexpected return value (503 Service Temporarily Unavailable) in response to PROPFIND request…

when I did all of your steps I did as my own user but sudo’ed to root.
I did checkout, add, and attempting commit as my own user ‘steve’. All files and directories in my checked out dir are permissioned for me.

Been googling around on this error and can’t find a solutions for my case. Please help.

reply Reply
JR

Hi Steve,

When you checkout repo example over http, then you can use repo as any user. Did you added your user and password AuthUserFile? If you use exactly this guide then you have to do commits as testuser and use testuser password.

Could you also check what errors you see on httpd access and erros logs?

reply Reply
Yusof

I think this one is important too, to start your SVN services

svnserve -d -r /var/www/svn

reply Reply
Vasu

Thanks People for this useful blog. I could install SVN in my Linux server successfully but when I try to launch it through console (http://localhost/svn/testrepo) I get login screen but the credentials fail. I gave testuser as the login, similar to the example given above. Sucessful Users, Please advice.

reply Reply
JR

Hi Vasu,

Did you used exactly same password that you used on step 4.?

You could of course create some other user, set password and try again.

reply Reply
Vasu

Thanks for replies.. Yes, I used the same password, even i tried by creating another and using it. It didnt work..

I came across a file in net /etc/svn-access-control . Should we do any changes into svn-access-control file for making the credentials work..?

reply Reply
JR

Excellent, just want to first make sure that there wasn’t any mistake on users or passwords…

So do you have enabled SVN Access Control?

If yes, could you then post content of /etc/httpd/conf.d/subversion.conf and /etc/svn-access-control files?

reply Reply
Vasu

How can we enable SVN Access Control..? Please find below /etc/svn-access-control File for your reference.

[groups]
testgroup = testuser1, testuser2
testgroup2 = testuser3, testuser4, testuser5
testgroup3 = testuser6, testuser7

[/]
* = r
@testgroup = rw
testuser4 = rw

[testrepo:/]
@testgroup2 = rw
testuser6 = rw

[testrepo2:/trunk]
@testgroup3 = rw
testuser5 = rw

[testrepo2:/tags]
@testgroup3 = r
testuser5 = rw

reply Reply
Vasu

Also please let me know the purpose of authz and passwd files under /var/www/svn/testrepo/conf

It contains Username and passwords.. Do we need to enter into it.?

reply Reply
JR

Hi Vasu,

Could you post content of following files /etc/httpd/conf.d/subversion.conf and testrepo/conf/svnserve.conf, example to http://pastebin.com

Normally it’s better test installation without access control to make sure, where the problem is. If basic setup is not working, then it’s wise to try fix it first without any additional configurations.

reply Reply
Vasu

Good Morning..:)
Please find content of /etc/httpd/conf.d/subversion.conf below

LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so

DAV svn
SVNParentPath /var/www/svn
AuthType Basic
AuthName “Subversion repositories”
AuthUserFile /etc/svn-auth-users
Require valid-user

testrepo/conf/svnserve.conf Content is
anon-access = none
autzh-db = authz
[general]
anon-access = read
auth-access = write
password-db = passwd
authz-db = authz

I also want to know from which file the credentials are loaded while we login…..

reply Reply
Vasu

People, the issue is resolved by changed two files like below:

/etc/svn-access-control data:

[groups]
testgroup = testuser,testuser1,testuser2,testuser3,testuser4

[/]
* = rw
@testgroup = rw

[testrepo:/]
@testgroup = rw

[testrepo:/trunk]
@testgroup = rw

[testrepo:/branches]
@testgroup = rw

[testrepo:/tags]
@testgroup = rw

Type the below commands to add Users:

htpasswd -cm /etc/svn-auth-users testuser2
New Password:
Retype Password:

This encrypts and stores password and username at /etc/svn-auth-users file

reply Reply
JR

Hi kaku,

If you are following exactly this guide, then you need to create /var/www/svn directory.

reply Reply
Leslie Satenstein

Before starting the installation, I would like to know what are the prerequisites?

I use Fedora desktop to write C code. I would like to use svn for my version management. Until now, I only downloaded compilers and editors, and some Dropbox links that I use for backup. What I would very much like to do is have svn working on my local network (3 systems).

Please advise, for single or network, to host svn, what are the prerequisites?

reply Reply
JR

Hi Leslie,

Do you mean system requirements to host svn?

If you could run Apache it’s almost enough, but if you have very big repositories or thousands of users, then you need of course more processing power and RAM. So local network svn for 3 systems just need machine which could run Apache, if you have reasonable size repositories.

reply Reply
lideth

Hi J R

thank for share this.
after i install SVN ready by following these step i get an error in log file
“configuration error: couldn’t perform authentication. AuthType not set!: /svn/repo”

do you know what kind of that error.
thank in advance!

reply Reply
lideth

hi J R,

i’ve got an error in log file
“configuration error: couldn’t perform authentication. AuthType not set!: /svn/repo”

pls help.thank you

reply Reply
JR

Hi lideth,

Could you post content of your subversion.conf file?

reply Reply