main logo

How to install Setup an Apache Subversion (SVN) on CentOS 7 server

Subversion (SVN) is an extensively used version control answer which assistance in storing files of many versions, similar source code and documents.

In this object, I will show you how to setup SVN server on a CentOS 7 server instance.

Update the Centos 7 server: –

yum update -y

once update complete reboot the server.

Reboot

install firewalld:-

yum install firewalld -y

To enable firewalld, run the following command as root:

systemctl enable firewalld

Start Firewalld

To start firewalld, run the following command as root:

systemctl start firewalld

Check the Status of Firewalld

To check the status of firewalld, run the following command as root:

systemctl status firewalld

Install Apache(httpd):-

yum install httpd

Remove Apache’s httpd default page:-

sed -i ‘s/^/#&/g’ /etc/httpd/conf.d/welcome.conf

Stop Apache httpd from showing records in the “/var/www/html” directory:-

sed -i “s/Options Indexes FollowSymLinks/Options FollowSymLinks/” /etc/httpd/conf/httpd.conf

Install SVN and the mod_dav_svn module:-

yum install subversion mod_dav_svn

Configure SVN:-

vi /etc/httpd/conf.modules.d/10-subversion.conf

Add the following section:-

DAV svn

SVNParentPath /svn

AuthName “SVN Repos”

AuthType Basic

AuthUserFile /etc/svn/svn-auth

AuthzSVNAccessFile /svn/authz

Require valid-user

Save and quit:-

:wq!

Create an SVN repo:-

mkdir /svn

cd /svn

svnadmin create repo1

chown -R apache:apache repo1

Setup SVN user accounts:-

mkdir /etc/svn

htpasswd -cm /etc/svn/svn-auth user1

chown root:apache /etc/svn/svn-auth

chmod 640 /etc/svn/svn-auth

If you want to create more SVN user accounts, refer to the following commands:

sudo htpasswd -m /etc/svn/svn-auth user2

sudo htpasswd -m /etc/svn/svn-auth user3

Setup permissions for users:-

cp /svn/repo1/conf/authz /svn/authz

vi /svn/authz

Add the following section:-

[groups]

admin=user1

repo1_user=user2

repo1_trainee=user3

[/]

@admin=rw

[repo1:/]

@repo1_user=rw

@repo1_trainee=r

Save and quit:-

:wq!

Start Apache and modify firewall rules:-

Start Apache:-

sudo systemctl start httpd.service

sudo systemctl enable httpd.service

Open the HTTP service port:

sudo firewall-cmd –zone=public –permanent –add-service=http

sudo firewall-cmd –reload

Finally, use the following path to access the SVN repo “repo1” on your server from an SVN client:

http://your ip/svn/repo1

That concludes our blog.

Rakshitha
Rakshitha
Rakshitha is a cloud hosting expert who helps businesses get the most out of their cloud services. She has experience setting up and managing cloud environments to improve performance and scalability. With her cloud certification, Rakshithe provides clear advice on how to use cloud solutions effectively for better business results.
Share
Contents

Related Articles

medhacloud logo
USA:
Medha Cloud Solutions LLC
30 N Gould St Ste R, Sheridan, WY 82801,
Phone: +1 646 775 2855

India:
Medha Cloud Solutions Private Limited
#74, 7th Cross, Krishna Garden InCity Layout. Chikka Kammanahalli, Banneraghatta Road, Bangalore 560083
Phone:+91 93536 44646

E-Mail: support@medhahosting.com
©Medha Cloud 2024. All rights reserved.