How to Install SubVersion in Linux

Subversion is a free/open-source version control system.

Step 1: Prerequisites

Step 2: Install Subversion

Use following command to install subversion and mod_dav_svn packages.

# yum install mod_dav_svn subversion

Step 3: Configure Subversion with Apache

Create a file and edit the file with following changes:

# touch /etc/httpd/conf.d/subversion.conf
# vim /etc/httpd/conf.d/subversion.conf

LoadModule dav_svn_module     modules/
LoadModule authz_svn_module   modules/
<Location /svn>
   DAV svn
   SVNParentPath /var/www/svn
   AuthType Basic
   AuthName "Subversion User Authentication "
   AuthUserFile /etc/svn-auth-users
   Require valid-user

Step 4: Create SVN User

# htpasswd -cm /etc/svn-users test_user

Step 5: Create SVN Repository

Use following command to create your fist svn repository.

# cd /var/www/svn
# svnadmin create testrepo
# chown -R apache.apache testrepo
# chcon -R -t httpd_sys_content_t /var/www/svn/testrepo/
# chcon -R -t httpd_sys_rw_content_t /var/www/svn/testrepo/

Step 6: Open Page on Browser

Test the SVN repository on your favorite browser


Step 7: Configure svnserve.conf file

Edit the svnserve.conf file and make the following changes:

# vi /var/www/svn/testrepo/conf/svnserve.conf
anon-access = none authz-db = authz

Step 8: Create sample directories

Create sample subversion directories

# mkdir subversion_templates
# cd subversion-templates/
# mkdir packages
# mkdir patches
# mkdir downloads

Step 9: Import the Subversion repository

Import the Subversion repository.

# svn import -m 'Initial import' subversion-templates/ http://Your-IP-Address/svn/repo/
Adding         subversion-templates/packages
Adding         subversion-templates/patches
Adding         subversion-templates/downloads
Committed revision 2.

How to Configure Multiple Domains in Web Server

Step 1: Prerequisite

Step 2: Add Domains in Apache Configuration File

To add multiple domains in web server edit /etc/http/conf/httpd.conf file and create virtual hosts.

# vi /etc/http/conf/httpd.conf
<VirtualHost *:80>
    DocumentRoot /var/www/html/
    ErrorLog /var/log/
    CustomLog /var/log/ common
<VirtualHost *:80>
    DocumentRoot /var/www/html/
    ErrorLog /var/log/
    CustomLog /var/log/ common
<VirtualHost *:80>
    DocumentRoot /var/www/html/
    ErrorLog /var/log/
    CustomLog /var/log/ common

Step 3: Restart Apache Server

After the changes have made, Restart the apache server:

# service httpd restart
# /etc/rc.d/init.d/httpd restart

How To Install Apache (Web Server) in Linux

For Fedora / RHEL / Cent OS Linux

Step 1: Install apache

# yum install httpd

Step 2: Start apache

To start the Apache/httpd, run:

# /etc/init.d/httpd start
# service httpd start

Also configure httpd service to start on system start.

# chkconfig httpd on

Note: The default directory in Fedora / RHEL / Cent OS Linux operating system is “/var/www/html”

Step 3: Verify apache Port

To verify the httpd port is open or not use the command:

# netstat -antp | grep :80

For Debian / Ubuntu

Step 1: Install apache

Use the apt-get command:

# apt-get install apache2

Step 2: Start apache

# /etc/init.d/apache2 start

Note: The default directory in Debian / Ubuntu Linux operating system is /var/www/

Installation from CD/DVD

We can also install httpd from CDROM with rpm command:

# rpm -ivh httpd*