Posts

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.

How to Compress file/folder in Linux

Introduction

A backup, or the process of backing up, refers to the copying and archiving of computer data so it may be used to restore the original after a data loss event. The verb form is to back up in two words, whereas the noun is backup. Backups have two distinct purposes.

  • The primary purpose is to recover data after its loss, be it by data deletion or corruption.
  • Data loss can be a common experience of computer users.

Following are the methods through which we can compress the file and folders.

1) ZIP a file/folder

#zip file.zip file1 file2
#zip file.zip dir1
#zip -option file.zip dir1

How to zip a file with excluding file/folder

zip -r conference_01-01-2015_14-30.zip /var/www/conference/* -x home_backup/

2) TAR a file/folder

tar -cvf /backup/etc.tar /etc/*
tar -cvf /backup/etc.tar

3) GZIP a file/folder

gzip is the preferred compression tool for Linux. To compress the tar file using gzip, following is the command:

gzip etc.tar

To decompress the tar file using gzip, following is the command:

gzip -d etc.tar.gz

4) BZIP2 a file/folder

There is also another tool that is rapidly gaining acceptance in the Linux world: bzip2. This is supposed to become the official way of doing it in the near future, so it may be a good idea to get to know ‘bzip2’
To compress the tar file using bzip2, following is the command:

bzip2 etc.tar

To decompress the tar file using bzip2, following is the command:

bzip2 -d etc.tar.bz2