If Not True Then False

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

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.

JD
# 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

reply Reply
JR

I believe that your configuration is okay :D This is some WP thing, it allows admin post any tags and filter all other poster tags. I have to take a look that later… :)

But yes, could you try following (on remote machine):


mkdir /tmp/testrepo

cd /tmp/testrepo

svn co http://your_ip/svn/testrepo .

echo "test" > test.txt

svn add test.txt

svn ci -m 'Test commit'
reply Reply
JD

# svn co http://localhost/svn/testrepo .
Authentication realm: Subversion repositories
Password for 'root':
Authentication realm: Subversion repositories
Username: jp
Password for 'jp':
svn: Repository moved permanently to 'http://localhost/svn/testrepo/'; please relocate
[root@subversion-server testrepo]#

reply Reply
JR

@JD

Looks like everything is okay, but it’s not still working…I just tested this on clean installed CentOS 6.2 and Fedora 16 and this guide is working normally for me…

Could you still post output of following commands:


ls -laZ / |grep var

ls -laZ /var |grep www
reply Reply
JD

I’m also using Fedora 16.

# ls -laZ / |grep var
drwxr-xr-x. root root system_u:object_r:var_t:s0 srv
drwxr-xr-x. root root system_u:object_r:var_t:s0 var
# ls -laZ /var |grep www
drwxr-xr-x root root ? www

Clean install the best option? :)

reply Reply
JR

Thanks and actually problem might be with security context of /var/www directory, try to set httpd_sys_content_t also to /var/www dir, with following command:


chcon -h system_u:object_r:httpd_sys_content_t /var/www

Then try svn checkout, import, commit, etc? :)

First maybe svn repos clean install, before whole system clean install… :D

reply Reply
Will

I modified your install instructions slightly and wanted to share them with you. These have been used over and over again without problem. The only real difference is that I created OS level accounts for each user and changed some permissions. The most important part was adding apache to the svnusers group because it’s really that account that is running the svn commands and not the actual user.

Note: I am running this in an Oracle VM. To gain access to the repo on my host machine’s browser I had to change the network adapter to Bridged. For my CentOS wired connection I had to remove the “Require IPv4 addressing for this connection to complete”. This will give you the IP address you need to use instead of trying the http://localhost

Create OS user accounts for each user (this is normal for my environment anyway)
repoadm is my svn repo administrator account
Created OS group account called svnusers
Add all accounts that will access the svn repo to svnusers group
Add apache account to the svnusers group

As root, install the mod_dav and subversion
yum install mod_dav_svn subversion
Update the subversion.conf file as you described

As root, create and modify the svn authorized user file

htpasswd -cm /etc/svn-auth-users repoadm (-cm is only used this one time)
htpasswd -m /etc/svn-auth-users testuser (-m to modify the svn-auth-users file)

Create the repo directory structure

mkdir /var/www/svn
chown -R repoadm.svnusers /var/www/svn

As repoadm, create SVN repository

cd /var/www/svn
svnadmin create repo
chown -R repoadm.svnusers repo

Run secure linux commands against the repo

chcon -R -t httpd_sys_content_t /var/www/svn/repo
chcon -R -t httpd_sys_rw_content_t /var/www/svn/repo

As root

Modify the repo permissions and restart apache service

cd /var/www/svn
chmod -R g+w repo
service httpd restart

reply Reply
JR

Thanks again Will, excellent work! :)

If you want to, then you can post this guide to If !1 0 Forums and I can add link to it from this guide as an alternative installation method.

reply Reply
Rajeev

i am not able to open multiple svn repository configured with ldap active directory authentication one repos is working file but another have same configuration but i am not able to browse others only one repos is going fine.

will anyone is help me out.

reply Reply
Rajeev

i am not able to browse more than one svn repository. i have configured svn with ldap (active directory) authentication but not able to more than one repos. i have checked my httpd.conf, subversion.conf, and every repos have same configuration file one is opened fine with username & passwd of active directory user. another repos gave the error ….

Not Found

The requested URL /1000 was not found on this server.

Apache/2.2.3 (CentOS) Server at 10.0.0.108 Port 80

reply Reply
Rajeev

i am not able to browse more than one svn repository. i have configured svn with ldap (active directory) authentication but not able to more than one repos. i have checked my httpd.conf, subversion.conf, and every repos have same configuration file one is opened fine with username & passwd of active directory user. another repos gave the error ….

Not Found

The requested URL /1000 was not found on this server.

Apache/2.2.3 (CentOS) Server at 10.0.0.108 Port 80

reply Reply
Kiran

Hi,

Getting Conflict error message while trying to commit a file from different PCs and logged in as different Users. Please help to resolve the issue.

reply Reply
JR

Hi Kiran,

Could you post full error message and your svn configuration?

reply Reply
rajeev

first check the permission.. what permission the user have.. than after check the same file or folder is there already exists…

reply Reply
Maroje Sardelich

i did easyapache update to dav,installed subversion via yum but when installing mod_dav_svn i get this:

root@alpha [~]# yum install mod_dav_svn
Loaded plugins: rhnplugin
Setting up Install Process
Resolving Dependencies
–> Running transaction check
—> Package mod_dav_svn.x86_64 0:1.6.11-2.el6.4 will be installed
–> Processing Dependency: httpd-mmn = 20051115 for package: mod_dav_svn-1.6.11-2.el6.4.x86_64
–> Finished Dependency Resolution
Error: Package: mod_dav_svn-1.6.11-2.el6.4.x86_64 (cloudlinux-x86_64-server-6)
Requires: httpd-mmn = 20051115
You could try using –skip-broken to work around the problem
** Found 5 pre-existing rpmdb problem(s), ‘yum check’ output follows:
bandmin-1.6.1-5.noarch has missing requires of perl(bandmin.conf)
bandmin-1.6.1-5.noarch has missing requires of perl(bmversion.pl)
bandmin-1.6.1-5.noarch has missing requires of perl(services.conf)
exim-4.77-1.x86_64 has missing requires of perl(SafeFile)
frontpage-2002-SR1.2.i386 has missing requires of libexpat.so.0

it is apache 2.2.22 cpanel with centos 6.2×64

reply Reply
JR

Hi Maroje,

Could you please post output of following commands:


rpm -qa httpd\*

yum list httpd\*
reply Reply
Thuan Nguyen

The same problem with Maroje Sardelich. Output commands:

root@vps1 [~]# rpm -qa httpd\*
root@vps1 [~]# yum list httpd\*
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
* base: mirrors.xmission.com
* extras: mirror.san.fastserv.com
* updates: mirrors.sonic.net
Error: No matching Packages to list

Can you help me? Thanks!

reply Reply
Maroje Sardelich

root@alpha [~]# rpm -qa httpd\*
root@alpha [~]# yum list httpd\*
Loaded plugins: rhnplugin
cloudlinux-x86_64-server-6 | 1.0 kB 00:00
Error: No matching Packages to list

this is the output.first command doesnt output anything.i forgot to tell,it is cloudlinux.

reply Reply
JR

@Thuan and @Maroje

Could you both post output of following commands:


lsb_release -a

yum repolist
reply Reply
Maroje Sardelich

root@alpha [~]# yum repolist
Loaded plugins: rhnplugin
repo id repo name status
cloudlinux-x86_64-server-6 CloudLinux Server 6 x86_64 8,896+619
repolist: 8,896

lsb_release says command not found

reply Reply
Maroje Sardelich

LSB Version: :core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: CloudLinuxServer
Description: CloudLinux Server release 6.2
Release: 6.2
Codename: n/a

reply Reply
JR

Hi Maroje,

Sorry for long wait…I forgot to check this, but looks like your repos doesn’t have httpd package at all… :/ Maybe you should use some external repo to get httpd installed.

reply Reply
Maroje

well since it is a cpanel server working perfectly,I’m not sure what do you mean with httpd,since yum works just fine…

reply Reply
JR

I’m not sure what web server CloudLinux cpanel is using, but CloudLinux repo does not have httpd package which is dependency for mod_dav_svn package.

reply Reply
Maroje

cloudlinux is just an kernel replacement,nothing else is touched,httpd is standard cpanel compiled httpd,therefore it is not updated thru yum,but only via inbuilt easyapache in cpanel.So I have to go around that dependency to get it installed?

reply Reply
JR

Okay, now I understand. You could try to install mod_dav_svn manually without yum if you then can get it running with your easyapache installation.

reply Reply
Kiran

Hi,

The Trunk folder is missing while taking the svn folder locally from the system(linux) itself and with shares(samba). But this folder and the files inside it are showing while connecting with TortoiseSVN and Web-Browser. Please give an solutions for fixing this issue.

reply Reply
JR

Hi Kiran,

So if you just list local files from repo directory, could you then see trunk directory? Could you checkout your trunk normally?

reply Reply
Kiran

Hi JR,

We are using SVN for centralize the files of our projects. So that once the project is completed we can upload the files directly from our SVN server to the Live web server which is located in remote location, using FTP client. But since the files are stored in Trunk folder and we are not able to see this folder locally on the server(But we are able to see this folder using browser or using Tortoise SVN). It is difficult for us to upload the files to the webserver using FTP clients. Please suggest a solution for this issue.

reply Reply