Posts

How to create repository in Redhat 7 Linux

Introduction

Repository is database of application installation and up-gradation of packages which are available on different Linux distributions. The packages of distros are available on official websites or you can extract them from official CD/DVD. We can easily install, upgrade or delete packages from repository.

Step 1: Mount ISO from DVD or Folder

In order to create repository, first mount ISO image from Official DVD or download it from given websites.

# cd /root
# mount -o loop RHEL-7.0 Server.x86_64-dvd.iso /mnt/	(For Redhat 7)
# mount -r -t iso9660 -o loop -v rhel-server-6.4-x86_64-dvd.iso /mnt	(For Redhat 6)

Step 2: Create Repository

To create repository follow the following steps.

# cd /etc/yum.repos.d/
# vi rhel7.repo
[rhel7]
name=Redhat
baseurl=file:///mnt/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

Step 3: Install Packages

Install Packages using yum command.

# yum clean all
# yum install ftp httpd gcc

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/mod_dav_svn.so
LoadModule authz_svn_module   modules/mod_authz_svn.so
<Location /svn>
   DAV svn
   SVNParentPath /var/www/svn
   AuthType Basic
   AuthName "Subversion User Authentication "
   AuthUserFile /etc/svn-auth-users
   Require valid-user
</Location>

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

http://Your-IP/svn/testrepo/

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.