If Not True Then False

Install SVN Server on Fedora 27/26, CentOS/RHEL 7.4/6.9 - Comment Page: 1

This is guide, howto install SVN (Subversion) server on Fedora 27/26/25/24/23, CentOS 7.4/6.9, Red Hat (RHEL) 7.4/6.9. 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 changed. In this...

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.

gb

hi, I installed subversion on fedora 13 following this guide, when i do “svn import -m ‘Initial import’ /tmp/svn-structure-template/ http://localhost/svn/testrepo/” ask me the root password Authentication realm: Subversion repositories
Password for ‘root’:
I typed any password and then ask me the username
Authentication realm: Subversion repositories
Username:
I typed testuser2
Password for ‘testuser2’:
ask me the password
I typed the password for testuser2, and send me this message
svn: Repository moved permanently to ‘http://localhost/svn/testrepo/’; please relocate
can you helpme

reply Reply
JR

Hi gb,

Sounds like some configuration error. Please post your subversion.conf file content. Do you have any other config for subversion or svn path?

Try to check out your repository on some test directory, like following:


mkdir /tmp/testrepo
cd /tmp/testrepo

svn co http://localhost/svn/testrepo/ .

Is this working ok?

reply Reply
gb

JR thanks for the answer

this is my subversion.conf

[myserver]#cat /etc/httpd/conf.d/subversion.conf
#############
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

#####################

i tryed
mkdir /tmp/testrepo
cd /tmp/testrepo
svn co http://localhost/svn/testrepo/ .

the result still this
[myserver]#svn co http://localhost/svn/testrepo/ .
Authentication realm: Subversion repositories
Password for ‘root’:

reply Reply
JR

Hi again,

Do you have

on your subversion.conf?

After Password for ‘root’: press return and then insert your username and password, is it working then ok?

reply Reply
gb

hi
I found the problem
I was using /var/www/html/ to create svn dir
I changed for /var/www/ and it works
I really appreciate your help

reply Reply
faruck

put root password and then it will ask you for svn repos username and password

reply Reply
Deepti

hii. my name is deepti and i m a trainee .i m working on Linux and my project is to setup a svn server for my office i understand your guidline but i m not able to connect with my clients will you help me..

reply Reply
JR

Hi Deepti,

Are you trying to connect to SVN server from the other office computers?

reply Reply
Deepti

hii.thanx’s for reply.No i m not connect to svn server from other office. but i have more problem in svn. in my office there is svn server but i m not able to lock the existing file in server and even if i enable auto-prop=yes in /root/subversion/conf then it only lock php file as a new file.please help me it’s really important for me my deadline is coming near.

reply Reply
jai

Hi Deepti,
Plz send me the complete practical of SVN server side and client side both. plz plz

reply Reply
raquel

Hello,

I have follow your instructions but when i try to execute the svn import:

svn import -m ‘Initial import’ /tmp/svn-structure-template/ http://localhost/svn/testrepo/
Reino de autentificación: Subversion repositories
password ‘root’:
Reino de autentificación: Subversion repositories
User: testuser
password ‘testuser’:
Reino de autentificación: Subversion repositories
User: testuser
password ‘testuser’:
svn: OPTIONS de ‘http://localhost/svn/testrepo’: authorization failed: Could not authenticate to server: rejected Basic challenge (http://localhost)

i have also tried:

mkdir /tmp/testrepo
cd /tmp/testrepo
svn co http://localhost/svn/testrepo/ .

But it is the same…i can do it…

My config file is:

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

I dont know why happens….please if you could help me.

Thanks

reply Reply
Anry

I try execute chcon -R -t httpd_sys_content_t /var/www/svn/testrepo :

chcon: can’t apply partial context to unlabeled file `db.lock’
chcon: can’t apply partial context to unlabeled file `db-logs.lock’
….

Why?

reply Reply
JR

Hi Parikshit Tiwari,

Try following instead:


chcon -h system_u:object_r:httpd_sys_content_t /var/www/svn/testrepo
chcon -R -h apache:object_r:httpd_sys_content_t /var/www/svn/testrepo/*

Looks like some reason you don’t have user or/and role…is this working for you?

reply Reply
MoJo1760

Good guide, I can connect locally, however I cannot connect to the server from a different computer.

I’ve added rules to the firewall config (and even tried disabling the firewall) however I still can’t reach the server from another system.

reply Reply
JR

Hi jyothi,

Did you tried just one time or multiple times?

Could you tell more specific are you using command line or are you using some graphical client?

reply Reply
ad

I tried the first initial import and this is what I get:

svn: access to ‘/svn/wvsrepo’ forbidden

I am not using a AuthzSVNAccessFile

Please help.

reply Reply
JR

Hi ad,

Could you post output of following commands:


ls -la /path/to/svn/wvsrepo

ls -la /path/to/svn
reply Reply
Aneek

Nice one, followed this one,
But after the “step 5. Create and configure SVN repository” please add the apache restart command. I know you do know this.
service httpd restart

I followed this one and had a working SVN repo.. Thanks..

reply Reply
Aneek

You are Most welcome JR..
I always keep following your linux based tutorials and articles…
Do you have anything about Samba Server.? I have a great interest in it.

reply Reply
JR

Thanks Aneek! :)

Nice to hear that you follow my Linux based tutorials and articles! ;)

I don’t have anything about Samba Server, because I don’t use Samba and I don’t have any Windows machines… :) But if you have some knowledge about Samba you can of course share it with us. :)

reply Reply
Brian

I have followed your tutorial to the letter however when I navigate to the repository via a web browser it does not prompt me for a password.

reply Reply
JR

Hi Brian,

Try to restart apache (as Aneek recommend) with following command:


/etc/init.d/httpd restart
## OR ##
service httpd restart

If it doesn’t help, then please let me know?

reply Reply
Talha

I’m having the same problem as raqeul. You didn’t replied to his question.

Please Reply whats the issue. I’m having the exact problem. when i use http:// to import it does not work.

I have follow your instructions but when i try to execute the svn import:

svn import -m ‘Initial import’ /tmp/svn-structure-template/ http://localhost/svn/testrepo/
Reino de autentificación: Subversion repositories
password ‘root’:
Reino de autentificación: Subversion repositories
User: testuser
password ‘testuser’:
Reino de autentificación: Subversion repositories
User: testuser
password ‘testuser’:
svn: OPTIONS de ‘http://localhost/svn/testrepo’: authorization failed: Could not authenticate to server: rejected Basic challenge (http://localhost)

reply Reply
JR

Hi Talha,

Did you create testuser with testuser password?

Did you enabled commits over http on step 5:


## Following enables commits over http ##
chcon -R -t httpd_sys_rw_content_t /var/www/svn/testrepo
reply Reply
JR

Hi Marvin,

Do you get any SELinux alerts, when you try to access your svn repo?

reply Reply
Marvin

Hi, JR.
when I accessed my svn repo, I didn’t get any SELinux alerts.

It seems as the basic auth don’t work either..

thank you!

reply Reply
Marvin

JR, by the way, when I get the status of my selinux, which is disabled.

reply Reply