Qadry
unixcop Admin

How to Install Subversion & USVN (Apache SVN) on CentOS 8

Introduction

Subversion is an open source version control system. Founded in 2000 by CollabNet, Inc., the Subversion project and software have seen incredible success over the past decade. Subversion has enjoyed and continues to enjoy widespread adoption in both the open source arena and the corporate world.

User-Friendly USVN is a web interface written in PHP used to configure Subversion repositories.It’s goal is to ease the creation of new projects without having to use the command line interface, therefor, maybe without privileged access to the server. USVN will then generate the list of users allowed to access your source code. This enable the delegation of rights to administrate Subversion repositories.

Install Apache Subversion (SVN)

USVN required a web server for deployment. So we will install Apache HTTP Server.

# yum install -y httpd

Start and enable httpd service.

# systemctl start httpd 
# systemctl enable httpd

Disable Welcome page of Apache HTTP Server.

# mv /etc/httpd/conf.d/welcome.conf /etc/httpd/conf.d/welcome.conf.org

Disable directory indexes in Apache HTTP Server configurations then restart httpd service with the following commands:

# cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.org
# sed -i "s/Options Indexes FollowSymLinks/Options FollowSymLinks/" /etc/httpd/conf/httpd.conf
# systemctl restart httpd

Then you have to allow http service through firewalld service with commands :

# firewall-cmd --permanent --add-service=http 
# firewall-cmd --reload

Also USVN requires a MySQL database to be a backend-database. So, we will install mariadb database and php .

# yum install php mariadb-server php-mysql -y

Start and enable mariadb service.

# systemctl start mariadb 
# systemctl enable mariadb

Configure mariadb server with command:

[root@unixcop ~]# mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none): 
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] Y
New password: 
Re-enter new password: 
Password updated successfully!
Reloading privilege tables..
 ... Success!


By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] Y
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] Y
 ... Success!

By default, MariaDB comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] Y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] Y
 ... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!
[root@unixcop ~]#

Also Edit the timezone in php settings :

# vim /etc/php.ini

And add the time zone to this line

date.timezone = 

Like that

date.timezone = Africa/Cairo

Install Apache Subversion and Apache HTTP server module

You can download them with this command below:

# yum install -y subversion mod_dav_svn

Install User-Friendly SVN (USVN)

Download and extract USVN on Apache HTTP Server. Just follow the commands in the steps below:

# cd /var/www/html
[root@unixcop html]# wget https://github.com/usvn/usvn/archive/1.0.7.tar.gz
--2021-08-24 07:28:42--  https://github.com/usvn/usvn/archive/1.0.7.tar.gz
Resolving github.com (github.com)... 192.30.255.113
Connecting to github.com (github.com)|192.30.255.113|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://codeload.github.com/usvn/usvn/tar.gz/1.0.7 [following]
--2021-08-24 07:28:42--  https://codeload.github.com/usvn/usvn/tar.gz/1.0.7
Resolving codeload.github.com (codeload.github.com)... 192.30.255.120
Connecting to codeload.github.com (codeload.github.com)|192.30.255.120|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/x-gzip]
Saving to: ‘1.0.7.tar.gz’

    [    <=>                                                                                                      ] 4,577,871   5.77MB/s   in 0.8s   

2021-08-24 07:28:43 (5.77 MB/s) - ‘1.0.7.tar.gz’ saved [4577871]

[root@unixcop html]#

Extract the downloaded tar file:

[root@unixcop html]# tar xvf 1.0.7.tar.gz 

Rename the extracted file to usvn:

[root@unixcop html]# mv usvn-1.0.7 usvn

Then go to usvn directory and create files directory with setting some required folder permissions with commands below:

[root@unixcop html]# cd usvn
[root@unixcop usvn]# mkdir files
[root@unixcop usvn]# chmod -R g+w {public,files,config}
[root@unixcop usvn]# chgrp -R apache /var/www/html/usvn
[root@unixcop usvn]# restorecon -R /var/www/html/usvn

Finally, Configure USVN application on Apache Server.

[root@unixcop usvn]# vim /etc/httpd/conf.d/usvn.conf 

Then add the following:

<Directory /var/www/html/usvn/>
AllowOverride All
Require all granted
</Directory>

In browser open http://ip_address/usvn/public/install.php to start the installation.

Or open http://svn-server.unixcop.com/usvn/public/install.php , and start USVN installation.

Select your language and timezone.

Check I understand and accept this license then Click on Next Step.

Click on Next Step.

Provide database password and check on Create database ? then click next.

Create a USVN Admin then click on Next Step.

Disable auto checks for updated versions of USVN or Allow it.

You will be redirected to the login page with admin user. So please enter username (admin) and correct password that you just created.

Conclusion

So We have successfully installed (USVN) Application and Apache Subversion (SVN) .

This Tutorial to learn How to Install Subversion & USVN (Apache SVN) on CentOS 8.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest articles

x