• Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial News Comments FAQ Related Articles

How to Install & Configure Apache Subversion (SVN) in CentOS 7

{{postValue.id}}

To Install & Configure Apache Subversion (SVN) in CentOS 7

Apache Subversion is an open source revision controlling program. It stores the historic source codes, documents, and web pages.Installation & configuration of SVN on CentOS 7 is explained in this article.


To install SVN & Apache Packages

Run the following command to install the svn & apache (http) packages.

[root@linuxhelp1 ~]# yum install httpd subversion mod_dav_svn
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: centos.webwerks.com
 * extras: centos.webwerks.com
 * updates: centos.webwerks.com
Resolving Dependencies
-->  Running transaction check
.
.
.
Installed:
  httpd.x86_64 0:2.4.6-40.el7.centos.1            mod_dav_svn.x86_64 0:1.7.14-10.el7           
  subversion.x86_64 0:1.7.14-10.el7              

Dependency Installed:
  apr.x86_64 0:1.4.8-3.el7                             apr-util.x86_64 0:1.5.2-6.el7          
  httpd-tools.x86_64 0:2.4.6-40.el7.centos.1           mailcap.noarch 0:2.1.41-2.el7          
  subversion-libs.x86_64 0:1.7.14-10.el7              

Complete!

To configure Apache Subversion

Open the configuration file in your favourite editor

[root@linuxhelp1 ~]# vim /etc/httpd/conf.modules.d/10-subversion.conf

Add the following lines.

Alias /svn /var/www/svn

DAV svn
SVNParentPath /var/www/svn/
AuthType Basic
AuthName " SVN Repository" 
AuthUserFile /etc/svn-auth-accounts
Require valid-user

Save and Quit the file.

To create SVN Users

Use htpasswd command in order to create SVN users.

[root@linuxhelp1 ~]# htpasswd -cm /etc/svn-auth-accounts linuxhelpuser
New password:
Re-type new password:
Adding password for user linuxhelpuser

The &ndash c option &rarr to create the password file
The &ndash m option &rarr to create MD5 encryption password for the user.

Utilise the following command to create & configure SVN Repository.

[root@linuxhelp1 ~]# mkdir /var/www/svn
[root@linuxhelp1 ~]# cd /var/www/svn
[root@linuxhelp1 svn]# svnadmin create repo
[root@linuxhelp1 svn]# chown apache.apache repo/
[root@linuxhelp1 svn]# chcon -R -t httpd_sys_content_t /var/www/svn/repo/
[root@linuxhelp1 svn]# chcon -R -t httpd_sys_rw_content_t /var/www/svn/repo/

Add the http and https services in the firewall

[root@linuxhelp1 svn]# firewall-cmd --permanent --zone=public --add-service=http
success
[root@linuxhelp1 svn]# firewall-cmd --permanent --zone=public --add-service=https
success
[root@linuxhelp1 svn]# firewall-cmd --reload
success

Enable and start the http services

[root@linuxhelp1 svn]# systemctl enable httpd.service
ln -s ' /usr/lib/systemd/system/httpd.service'  ' /etc/systemd/system/multi-user.target.wants/httpd.service' 
[root@linuxhelp1 svn]# systemctl restart httpd.service

Open the web browser and try to access SVN repo using https://< IP_address> /svn/repo
Install-Configure-Apache-Subversion-SVN-revision-controlling-program-stores-historic-source-codes-documents-web-pages-CentOS7-access-SVN-repo

Install-Configure-Apache-Subversion-SVN-revision-controlling-program-stores-historic-source-codes-documents-web-pages-CentOS7-repo-revision0

To disable anonymous access on SVN Repository

Open the svnserve.conf file.

[root@linuxhelp1 svn]# vim /var/www/svn/repo/conf/svnserve.conf

Add the following lines.

anon-access = none
authz-db = authz

To import project directory’ s content to SVN repository.

[root@linuxhelp1 svn]# cd /mnt/
[root@linuxhelp1 mnt]# mkdir linuxhelpproject
[root@linuxhelp1 mnt]# cd linuxhelpproject/
[root@linuxhelp1 linuxhelpproject]# touch testfile_1   touch testfile_2
[root@linuxhelp1 linuxhelpproject]#

Run the SVN command to import the linuxhelpproject to the repo.

[root@linuxhelp1 linuxhelpproject]# svn import -m " First SVN Repo"  /mnt/linuxhelpproject/ file:///var/www/svn/repo/linuxhelpproject
Adding         testfile_1
Adding         testfile_2

Committed revision 1.

Open the browser and navigate to https://< IP_address> /svn/repo
Install-Configure-Apache-Subversion-SVN-revision-controlling-program-stores-historic-source-codes-documents-web-pages-CentOS7-Open-browser

Install-Configure-Apache-Subversion-SVN-revision-controlling-program-stores-historic-source-codes-documents-web-pages-CentOS7-testfiles

Tags:
noah
Author: 

Comments ( 1 )

shankar
I had committed from client machine to svn repo , i had created repo in /var/www/svn/ after committing the project structure is not visible . But when i had checked in browser the status was updated. Please help me to solve
Add a comment
{{postCtrl.cmtErrMsg}}

Frequently asked questions ( 5 )

Q

Installation procedure for Fedora, please?

A

Run the following command,
# dnf install httpd subversion mod_dav_svn

Q

Under htpasswd for svn what type of authentication is used?

A

This is basic authentication which undergoes base64 encoding

Q

I wanna enable only for certain users?

A

disable anonymous access on SVN Repository,
" /var/www/svn/repo/conf/svnserve.conf"
anon-access = none
authz-db = authz

Q

How to import already created project to it?

A

Gfirst mount your project under a mount point and then follow svn import -m "First SVN Repo" /mnt/linuxhelpproject/ file:///var/www/svn/repo/linuxhelpproject

Q

How do I check out the Subversion code?

A

Use the Subversion client:
# svn co http://svn.apache.org/repos/asf/subversion/trunk subversion

Back To Top!
Rank
User
Points

Top Contributers

userNamenaveelansari
135850

Top Contributers

userNameayanbhatti
92510

Top Contributers

userNamehamzaahmed
32150

Top Contributers

1
userNamelinuxhelp
31040

Top Contributers

userNamemuhammadali
24500
Can you help Isaac ?
How to run windows application in linux

I need to run the windows application in my Linux machine, instead of installing from yum repo or any other repos. How to do that..??

Networking
  • Routing
  • trunk
  • Netmask
  • Packet Capture
  • domain
  • HTTP Proxy
Server Setup
  • NFS
  • KVM
  • Memory
  • Sendmail
  • WebDAV
  • LXC
Shell Commands
  • Cloud commander
  • Command line archive tools
  • last command
  • Shell
  • terminal
  • Throttle
Desktop Application
  • Linux app
  • Pithos
  • Retrospect
  • Scribe
  • TortoiseHg
  • 4Images
Monitoring Tool
  • Monit
  • Apache Server Monitoring
  • EtherApe 
  • Arpwatch Tool
  • Auditd
  • Barman
Web Application
  • Nutch
  • Amazon VPC
  • FarmWarDeployer
  • Rukovoditel
  • Mirror site
  • Chef
Contact Us | Terms of Use| Privacy Policy| Disclaimer
© 2025 LinuxHelp.com All rights reserved. Linux™ is the registered trademark of Linus Torvalds. This site is not affiliated with linus torvalds in any way.