If Not True Then False

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

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.

JR

Hi Marvin,

Could tell more specific, do you get some error (on browser) when you try to access http://localhost/svn/testrepo/ address?

I tested this guide on clean Fedora 15 install and it’s working just as it should be. So I suggest you try again!

Then if you can’t get it working you could post your /var/log/httpd/error_log to pastebin…

reply Reply
marvin

JR, Thank you very much. I reinstalled my fedora 15 system, and reinstalled subversion accorded to your doc. It’s working.

thank you again!

reply Reply
wx

Help>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
chcon: can’t apply partial context to unlabeled file
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
when I input

chcon -R -t httpd_sys_content_t /var/www/svn/testrepo

>>>>>>>>>>>>>>>>>>
Any advice ? Thanks
>>>>>>>>>>>>>>>>>>>>

reply Reply
JR

Hi wx,

Could you post full error message and output of following commands:


ls -laZ /var/www/

ls -laZ /var/www/svn

ls -laZ /var/www/svn/testrepo
reply Reply
Abdul

Hi JR,

everything is fine and working good for me as you instructed. But i want to restrict the few users to access some of the directories in the project.

Can you help me how can i do that.

Regards,
Abdul.

reply Reply
Ravindra

Hi JR,

I followed the above steps what you have written on this page and with your help I am able to see my repository working fine.

Now I want to use my stsyem ip address instead of localhost and want to access from other computers. what will be the command.

I really appreciate your help.
Thank you.

reply Reply
JR

Hi Ravindra,

Nice to hear that you got SVN working! :)

To enable remote connections to Apache HTTP Server (this case to SVN) –> Open web server port (80) on iptables firewall:

1. Edit /etc/sysconfig/iptables file and add following line before COMMIT:


-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT

2. Restart Iptables Firewall:


service iptables restart
## OR ##
/etc/init.d/iptables restart
reply Reply
Ravindra

Hi JR,
I am getting the below mentioned error when I restart Apache web server.

service httpd restart
Stopping httpd: [ OK ]
Starting httpd: [Thu Jan 19 10:41:33 2012] [warn] module dav_svn_module is already loaded, skipping
[Thu Jan 19 10:41:33 2012] [warn] module authz_svn_module is already loaded, skipping
httpd: apr_sockaddr_info_get() failed for geovas
httpd: Could not reliably determine the server’s fully qualified domain name, using 127.0.0.1 for ServerName
[ OK ]

reply Reply
Ravindra

testrepo – Revision 1: /

* branches/
* tags/
* trunk/

Powered by Subversion version 1.6.11 (r934486).

how to add directories and folders instead of branches, tags and trunk for different-2 users. so that the users can save their files into their particular folder.

Please help me out. I’m running short of time.

Thanks

reply Reply
Ravindra

Hi JR,
I have commented two lines in the subversion.conf file i.e. as shown below
#LoadModule dav_svn_module modules/mod_dav_svn.so
#LoadModule authz_svn_module modules/mod_authz_svn.so

And after that when I restart Apache web server, I’m getting the following:

Stopping httpd: [ OK ]
Starting httpd: httpd: apr_sockaddr_info_get() failed for geovas
httpd: Could not reliably determine the server’s fully qualified domain name, using 127.0.0.1 for ServerName
[ OK ]

Please help me out JR.

reply Reply
JR

Hi Ravindra,

Load module errors:


Starting httpd: [Thu Jan 19 10:41:33 2012] [warn] module dav_svn_module is already loaded, skipping
[Thu Jan 19 10:41:33 2012] [warn] module authz_svn_module is already loaded, skipping

Just because you have loaded modules multiple times.

httpd: apr_sockaddr_info_get() failed for error:


Starting httpd: httpd: apr_sockaddr_info_get() failed for geovas
httpd: Could not reliably determine the server’s fully qualified domain name, using 127.0.0.1 for ServerName

Apache fails to match hostname via current hostname. Easiest way to solve this is setup your hostname to /etc/hosts file.

Then your SVN problem, so you have 2 different user, but are those users doing different projects? This branches/ tags/ trunk/ is SVN default setup and almost always all svn repos have such a structure…

reply Reply
Ravindra

Hi JR,

I’m getting the following error while restarting httpd.

Starting httpd: httpd: Syntax error on line 221 of /etc/httpd/conf/httpd.conf: Could not open configuration file /etc/httpd/conf.d/.conf: No such file or directory

reply Reply
JR

Hi Ravindra,

So question is, what you have in /etc/httpd/conf/httpd.conf file line 221?
And what you have /etc/httpd/conf.d/ directory?

Apache try to open /etc/httpd/conf.d/.conf conf file. File with full name .conf.

reply Reply
Naka

Hi JR,

I follow your step but when I log in I got the following error:

Could not open the requested SVN filesystem

Could you please help me with this. I have been googling but no help.
Some background info:
The server is a virtual server and I access it from a remote machine. The OS is CentOS 6 and I use SVN version 1.6.11.

reply Reply
JR

Hi Naka,

Are you using exactly this setup on your system?

reply Reply
Naka

Hi JR,

Yes I followed the set up listed above. However, in step 5, because i have the same problem with Parikshit Tiwari above, so I use the chcon commands in the comment box which you provided for her in your comment above, not the original one in your post.

Hope to hear from you soon.
Thank you,
Naka

reply Reply
JR

Hi again Naka,

Could you post output of following commands:


cat /etc/httpd/conf.d/subversion.conf

ls -laZ /var/www/

ls -laZ /var/www/svn

ls -laZ /var/www/svn/testrepo
reply Reply
Naka

Hi JR,
This is the output of the commands:

-Out put for “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

#
# Example configuration to enable HTTP access for a directory
# containing Subversion repositories, “/var/www/svn”. Each repository
# must be both:
#
# a) readable and writable by the ‘apache’ user, and
#
# b) labelled with the ‘httpd_sys_content_t’ context if using
# SELinux
#

#
# To create a new repository “http://localhost/repos/stuff” using
# this configuration, run as root:
#
# # cd /var/www/svn
# # svnadmin create stuff
# # chown -R apache.apache stuff
# # chcon -R -t httpd_sys_content_t stuff
#

#
# DAV svn
# SVNParentPath /var/www/svn
#
# # Limit write permission to list of valid users.
#
# # Require SSL connection for password protection.
# # SSLRequireSSL
#
# AuthType Basic
# AuthName “Authorization Realm”
# AuthUserFile /path/to/passwdfile
# Require valid-user
#
#

DAV svn
SVNParentPath /home/naka/svn
AuthType Basic
AuthName “Subversion repos”
AuthUserFile /etc/svn-auth-users
#AuthUserFile /etc/httpd/conf/htpasswd.users
Require valid-user

-Output for “ls -laZ /var/www/”

drwxr-xr-x root root ? .
drwxr-xr-x root root ? ..
drwxr-xr-x root root ? cgi-bin
drwxr-xr-x root root ? error
drwxr-xr-x root root ? html
drwxr-xr-x root root ? icons

For the second command, I m not sure whether you want to use the directory /var/www or you want to use the parent directory of svn. So, in case you want /www/var, it’s the one above, in case you want the parent directory of svn, it’s the one below.

ls -laZ /home/naka

drwx—— naka naka ? .
drwxr-xr-x root root ? ..
-rw-r–r– naka naka ? .bash_logout
-rw-r–r– naka naka ? .bash_profile
-rw-r–r– naka naka ? .bashrc
-rw-r–r– naka naka ? .emacs
drwxr-xr-x root root ? svn
drwxr-xr-x root root ? svntest

-Output for ls -laZ /var/www/svn ( I put my repository at a different place other than /var/www/svn, so I substitute my own path for it. The command is changed to: “ls -laZ /home/naka/svn”)

drwxr-xr-x root root ? .
drwx—— naka naka ? ..
drwxr-xr-x. apache apache suste_u:object_r:httpd_sys_content_t svndb
drwxr-xr-x. apache apache system_u:object_r:httpd_sys_content_t testrepo

-Output for ls -laZ /var/www/svn/testrepo (again using my own path: ls -laZ /home/naka/svn/testrepo)
drwxr-xr-x. apache apache system_u:object_r:httpd_sys_content_t .
drwxr-xr-x root root ? ..
drwxr-xr-x. apache apache apache:object_r:httpd_sys_content_t conf
drwxr-sr-x. apache apache apache:object_r:httpd_sys_content_t db
-r–r–r–. apache apache apache:object_r:httpd_sys_content_t format
drwxr-xr-x. apache apache apache:object_r:httpd_sys_content_t hooks
drwxr-xr-x. apache apache apache:object_r:httpd_sys_content_t locks
-rw-r–r–. apache apache apache:object_r:httpd_sys_content_t README.txt

reply Reply
Naka

Hi JR,

I just realized that I did not set the correct access right for the parent directory of svn (I did not let anybody read except for the owner). I set it to 755 and now it works.

I cant believe this stuff takes me 3 days to solve.

Thank you very much for your time. I really appreciate it.

reply Reply
JR

Hi Naka,

I was just answering your question… :) And it’s very good to hear that you got it working.

Normally this style problems are always permission problems. :) And yes home directory is tricky place to keep web server content…normally it’s better do example /svn or /data/svn dir, instead of using any user home dir :)

Actually Apache user dir guide would have solved your home dir problem also. :)

reply Reply
germain

hi

i followed the whole tut, but when trying to import , i get the following error message :

svn: Can’t open file ‘/var/www/svn/csp/db/txn-current-lock’: Permission denied

can you tell me what i am doing wrong ?

Thanks

reply Reply
Germain

Hi
i followed the whole tutorial step by step, but when i try to import, i get the following error message :

svn: Can’t open file ‘/var/www/svn/csp/db/txn-current-lock’: Permission denied

any idea ?

thanks

reply Reply
JR

Hi Germain,

You followed guide and used csp repo name? Did you set right permissions and modified right files based on your repo name?

And you did try to import over http protocol?

reply Reply
Germain

everywhere where you put testrepo, i put csp, so i only changed that name. , and yes, i did try to import over http

reply Reply
JR

Could you post output of following commands:


cat /etc/httpd/conf.d/subversion.conf

ls -laZ /var/www

ls -laZ /var/www/svn

ls -laZ /var/www/svn/csp
reply Reply
Germain

I found the problem

i had in httpd.conf

user nobody
group nobody

changed it back to apache and it worked !

reply Reply
JR

Excellent to hear that you got problem solved! It sounded like a permission problem, and that’s what it was then. ;)

reply Reply