How to Disable Directory Browsing on Website or Blog

There are two ways to disable or turn off the directory browsing in on your linux server. The main reason for this is to secure your websites and prevent anyone from simply access your installation folders and directories. If the directories or files are exposed to view, this will bring serious security risk.

Follow below steps to disable directory browsing:

1. Turn off directory browsing using httpd.conf:-

–>Open your httpd.conf, vi /etc/httpd/conf/httpd.conf
–>on your Virtual Host and your documentroot setting, find “Options Indexes”
–>Modify exisitng Indexes to -Indexes if any. Else add the Options -Indexes
–>Restart your apache server
–>Finish

Options All -Indexes

2. Turn off directory browsing using .htaccess:-

–>Go to your documentroot directory
–>Create or open your existing .htacces file and look for Options Indexes
–>Modify exisitng Indexes to -Indexes if any. Else add the Options -Indexes
–>Finish

Options All -Indexes

How to Install GForge Advanced Server on CentOS 5.5 Server

In this post, i will show you on how to install GForge Advanced Server on CentOS 5.5 Server.

    [root@server ~]# wget http://gforge.org/download/install-gforge-as-571-src.zip
    [root@server ~]# unzip install-gforge-as-571-src.zip
    [root@server ~]# cd gforge-as-571-src
    [root@server gforge-as-571-src] yum install php*
    [root@server gforge-as-571-src]# yum install -y postgresql-server postgresql svn wget poppler-utils wv php-pgsql php-gd php-ldap php-xml php-mbstring
    [root@server gforge-as-571-src]# php check-deps.php
    -=# Welcome to GForge DB-Installer v5.0 #=-
    -=# GForge Dependencies Checker #=-
    
    Checking PHP version... Ok (5.1.6)
    Checking... cvs
    /usr/bin/cvs
    Checking... psql
    /usr/bin/psql
    Checking... svn
    /usr/local/bin/svn
    Checking... ssh
    /usr/bin/ssh
    Checking... wget
    /usr/bin/wget
    Checking... pdftotext
    /usr/bin/pdftotext
    Checking... wvText
    /usr/bin/wvText
    Checking... apache
    /etc/init.d/httpd
    Checking PHP support for... PostgreSQL
    Found
    Checking PHP support for... GD
    Found
    Checking PHP support for... LDAP
    Found
    Checking PHP support for... MultiByte
    Found
    Checking classes... DOMDocument
    Found
    
    All dependencies seem to be installed
    Starting postgresql service:                               [  OK  ]
    
    [root@server gforge-as-571-src]# php install-gforge-1-deps.php CENTOS5
    
    -=# Welcome to GForge Pre-Installer v5.0 #=-
    Do you want to perform an (I)nitial installation or an (U)pgrade of the system [I/u]?
    I
    [root@server gforge-as-571-src]# php install-gforge-2-db.php
    [root@server gforge-as-571-src]# php install-gforge-3.php CENTOS5
    [root@server gforge-as-571-src]# crontab crontab.in
    

How to Fix “You could try using –skip-broken to work around the problem” Error

Question :
When I issue the command yum on CentOS server / RHEL , the message below appears and I can not continue with the next installation steps :

    You could try using --skip-broken to work around the problem
    You could try running: package-cleanup --problems
    package-cleanup --dupes
    rpm -Va --nofiles --nodigest
    The program package-cleanup is found in the yum-utils package.
    

Answer : You just need to run below command to install the yum utilities if never installed and cleaning up list of fastest mirrors:
1. Run Yum install :

[root@server ~]# yum install yum-utils
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * addons: centos.ipserverone.com
 * base: centos.ipserverone.com
 * extras: centos.ipserverone.com
 * updates: centos.ipserverone.com
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package yum-utils.noarch 0:1.1.16-14.el5.centos.1 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

==========================================================================================
 Package            Arch            Version                           Repository     Size
==========================================================================================
Installing:
 yum-utils          noarch          1.1.16-14.el5.centos.1            base           69 k

Transaction Summary
==========================================================================================
Install       1 Package(s)
Upgrade       0 Package(s)

Total download size: 69 k
Is this ok [y/N]: y
Downloading Packages:
yum-utils-1.1.16-14.el5.centos.1.noarch.rpm                        |  69 kB     00:04
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : yum-utils                                                          1/1

Installed:
  yum-utils.noarch 0:1.1.16-14.el5.centos.1

Complete!

2. Run Below command :

[root@server ~]# yum clean all
Loaded plugins: fastestmirror
Cleaning up Everything
Cleaning up list of fastest mirrors

How to Install the Dependencies for GForge Community Edition and GForge Advanced Server

Question : How install dependencies for GForge Community Edition and GForge Advanced Server?

-=# GForge Dependencies Checker #=-

Checking PHP version... Ok (5.1.6)
Checking... cvs
/usr/bin/cvs
Checking... psql
which: no psql in (/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)
Not Found
Checking... svn
/usr/local/bin/svn
Checking... ssh
/usr/bin/ssh
Checking... wget
which: no wget in (/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)
Not Found
Checking... pdftotext
which: no pdftotext in (/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)
Not Found
Checking... wvText
which: no wvText in (/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)
Not Found
Checking... apache
/etc/init.d/httpd
Checking PHP support for... PostgreSQL
Not Found
Checking PHP support for... GD
Not Found
Checking PHP support for... LDAP
Not Found
Checking PHP support for... MultiByte
Not Found
Checking classes... DOMDocument
Not Found

The following dependencies were not found: psql, wget, pdftotext, wvText, PHP PostgreSQL, PHP GD, PHP LDAP, PHP MultiByte, PHP-Class DOMDocument

Answer : Please run below yum command on your CentOS/RHEL server
Prerequisites
a)How to Prepare Other Yum Repositories For RHEL/CentOS 5
b)How to Resolved Dependencies Related with wvText
Install the dependencies using yum command :

[root@server ~]# yum install -y php* postgresql-server postgresql svn wget poppler-utils wv php-pgsql php-gd php-ldap php-xml php-mbstring

How to Fix “dependencies were not found: PHP MultiByte” in Linux Server

Question : During the installation such as gforge Collaborative development, the following dependencies were not found: PHP MultiByte. How to install PHP MultiByte into my linux server ? What php extention should i use?

Answer : You just need to run below yum command to install PHP MultiByte on your linux server such as CentOS or RHEL. This will PHP with mbstring support.

    [root@server ~]# yum install php-mbstring
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
     * addons: centos.maulvi.net
     * base: centos.maulvi.net
     * extras: centos.maulvi.net
     * updates: centos.maulvi.net
    Setting up Install Process
    Resolving Dependencies
    --> Running transaction check
    ---> Package php-mbstring.i386 0:5.1.6-27.el5_5.3 set to be updated
    --> Finished Dependency Resolution
    
    Dependencies Resolved
    
    ==========================================================================================
     Package                Arch           Version                       Repository      Size
    ==========================================================================================
    Installing:
     php-mbstring           i386           5.1.6-27.el5_5.3              base           995 k
    
    Transaction Summary
    ==========================================================================================
    Install       1 Package(s)
    Upgrade       0 Package(s)
    
    Total download size: 995 k
    Is this ok [y/N]: y
    Downloading Packages:
    php-mbstring-5.1.6-27.el5_5.3.i386.rpm                             | 995 kB     00:33
    Running rpm_check_debug
    Running Transaction Test
    Finished Transaction Test
    Transaction Test Succeeded
    Running Transaction
      Installing     : php-mbstring                                                       1/1
    
    Installed:
      php-mbstring.i386 0:5.1.6-27.el5_5.3
    
    Complete!
    

How to Automatically Forward Gmail Emails to Other Email Address

In this post, i would like to share on how to forward the gmail emails to other Email address like yahoo or hotmail. Gmail has built-in email forwarding which can be configure through two condition :
a) Forward all email from Gmail mailbox to other email address
b) Create filter and only selected email will be forwarded to other email address

a) To do forward all gmail email to other email address, you just need to follow this steps
1. Login to Gmail
2. Go to setting, the click “Forwarding and POP/IMAP” tab
3. On the “Forwarding:”, Click “Add a forwading address”

b) To do forwarding filter, follow below steps:
1. Login to Gmail
2. Go to setting, the click “Filters” tab
3. Click “Create a new filter”
4. You can now create a filter to only forward select messages, or if you want to forward all messages you can enter the current account’s email address in the ‘To:’ field. Then Click ‘Next Step’.
5. In the next screen, check the Forward it to: box and enter one of the desired email addresses in the box. Don’t worry, we’ll add the other addresses in the next step. Click Create Filter.
6. Repeat steps 1 until 5 for any additional email addresses you want to forward messages to.

How to Fix “Failed to Install VMware Tools” Error

Question : I am trying to install VMware tools on CentOS and RHEL but failed and return below error:

    Searching for a valid kernel header path...
    The path "" is not valid.
    Would you like to change it? [yes]
    

Answer : This is because your server have not installed required dependencies or any of the required compiler. To fix this issue, please run below command to install required dependencies.

[root@server ~]# yum -y install gcc make perl kernel-headers kernel-devel

How to Set Password for RAR File

Question : How to protect the RAR file using password. So that only authorised person can extract the file.
Answer : Please follow these step to set the password on your RAR file

1. Right click on the file or folder you want to set a password and select “Add to archive” (choosing winrar).
2. When rar opens up go to “Advanced” tab
3. Then click “Set a password”
4. Enter and Re-enter the password for verification then click ok

How to Install Subversion 1.6.17 on CentOS 5.5 Server

As mentioned in the previous post, Subversion is a open source version control system that will manages files and will keep the changes made to the files. Subversion 1.6.17 has been released on 1st June 2011.For those who have installed subversion 1.6.16, they can simply upgrade the version to subversion 1.6.17. Make sure you have backup the repository before run manual upgrade which mean uninstall the old version and install the latest version.

Prerequisite : How to Install Apache Httpd Web Server on Linux

To install the subversion, follow below steps:

1. Download the latest subversion rpm packages :

[root@server ~]# wget http://opensource.wandisco.com/centos/5/RPMS/i386/mod_dav_svn-1.6.17-1.i386.rpm http://opensource.wandisco.com/centos/5/RPMS/i386/subversion-1.6.17-1.i386.rpm http://opensource.wandisco.com/centos/5/RPMS/i386/subversion-devel-1.6.17-1.i386.rpm http://opensource.wandisco.com/centos/5/RPMS/i386/subversion-perl-1.6.17-1.i386.rpm http://opensource.wandisco.com/centos/5/RPMS/i386/subversion-python-1.6.17-1.i386.rpm http://opensource.wandisco.com/centos/5/RPMS/i386/subversion-tools-1.6.17-1.i386.rpm
--2011-07-09 22:43:25-- http://opensource.wandisco.com/centos/5/RPMS/i386/mod_dav_svn-1.6.17-1.i386.rpm
Resolving opensource.wandisco.com... 212.7.198.163
Connecting to opensource.wandisco.com|212.7.198.163|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 80073 (78K) [application/x-redhat-package-manager]
Saving to: `mod_dav_svn-1.6.17-1.i386.rpm'

100%[================================================>] 80,073 37.3K/s in 2.1s

2011-07-09 22:43:28 (37.3 KB/s) - `mod_dav_svn-1.6.17-1.i386.rpm' saved [80073/80073]

--2011-07-09 22:43:28-- http://opensource.wandisco.com/centos/5/RPMS/i386/subversion-1.6.17-1.i386.rpm
Reusing existing connection to opensource.wandisco.com:80.
HTTP request sent, awaiting response... 200 OK
Length: 2197278 (2.1M) [application/x-redhat-package-manager]
Saving to: `subversion-1.6.17-1.i386.rpm'

100%[================================================>] 2,197,278 9.69K/s in 2m 50s

2011-07-09 22:46:18 (12.6 KB/s) - `subversion-1.6.17-1.i386.rpm' saved [2197278/2197278]

--2011-07-09 22:46:18-- http://opensource.wandisco.com/centos/5/RPMS/i386/subversion-devel-1.6.17-1.i386.rpm
Reusing existing connection to opensource.wandisco.com:80.
HTTP request sent, awaiting response... 200 OK
Length: 3413350 (3.3M) [application/x-redhat-package-manager]
Saving to: `subversion-devel-1.6.17-1.i386.rpm'

100%[================================================>] 3,413,350 11.1K/s in 5m 18s

2011-07-09 22:51:37 (10.5 KB/s) - `subversion-devel-1.6.17-1.i386.rpm' saved [3413350/3413350]

--2011-07-09 22:51:37-- http://opensource.wandisco.com/centos/5/RPMS/i386/subversion-perl-1.6.17-1.i386.rpm
Reusing existing connection to opensource.wandisco.com:80.
HTTP request sent, awaiting response... 200 OK
Length: 1106258 (1.1M) [application/x-redhat-package-manager]
Saving to: `subversion-perl-1.6.17-1.i386.rpm'

100%[================================================>] 1,106,258 9.18K/s in 2m 4s

2011-07-09 22:53:42 (8.71 KB/s) - `subversion-perl-1.6.17-1.i386.rpm' saved [1106258/1106258]

--2011-07-09 22:53:42-- http://opensource.wandisco.com/centos/5/RPMS/i386/subversion-python-1.6.17-1.i386.rpm
Reusing existing connection to opensource.wandisco.com:80.
HTTP request sent, awaiting response... 200 OK
Length: 1289255 (1.2M) [application/x-redhat-package-manager]
Saving to: `subversion-python-1.6.17-1.i386.rpm'

100%[================================================>] 1,289,255 7.12K/s in 2m 26s

2011-07-09 22:56:08 (8.60 KB/s) - `subversion-python-1.6.17-1.i386.rpm' saved [1289255/1289255]

--2011-07-09 22:56:08-- http://opensource.wandisco.com/centos/5/RPMS/i386/subversion-tools-1.6.17-1.i386.rpm
Reusing existing connection to opensource.wandisco.com:80.
HTTP request sent, awaiting response... 200 OK
Length: 392647 (383K) [application/x-redhat-package-manager]
Saving to: `subversion-tools-1.6.17-1.i386.rpm'

100%[================================================>] 392,647 14.4K/s in 34s

2011-07-09 22:56:43 (11.3 KB/s) - `subversion-tools-1.6.17-1.i386.rpm' saved [392647/392647]

FINISHED --2011-07-09 22:56:43--
Downloaded: 6 files, 8.1M in 13m 15s (10.4 KB/s)

2. Install the rpm packages :

[root@server ~]# rpm -Uvh mod_dav_svn-1.6.17-1.i386.rpm subversion-tools-1.6.17-1.i386.rpm subversion-python-1.6.17-1.i386.rpm subversion-perl-1.6.17-1.i386.rpm subversion-devel-1.6.17-1.i386.rpm subversion-1.6.17-1.i386.rpm
warning: mod_dav_svn-1.6.17-1.i386.rpm: Header V4 DSA signature: NOKEY, key ID 3bbf077a
Preparing... ########################################### [100%]
1:subversion ########################################### [ 17%]
2:subversion-devel ########################################### [ 33%]
3:subversion-perl ########################################### [ 50%]
4:mod_dav_svn ########################################### [ 67%]
5:subversion-tools ########################################### [ 83%]
6:subversion-python ########################################### [100%]

3. Check and verify the subversion version using below command :

[root@server ~]# svn --version
svn, version 1.6.15 (r1038135)
   compiled Jan 15 2011, 23:26:01

Copyright (C) 2000-2009 CollabNet.
Subversion is open source software, see http://subversion.apache.org/
This product includes software developed by CollabNet (http://www.Collab.Net/).

The following repository access (RA) modules are available:

* ra_neon : Module for accessing a repository via WebDAV protocol using Neon.
  - handles 'http' scheme
* ra_svn : Module for accessing a repository using the svn network protocol.
  - handles 'svn' scheme
* ra_local : Module for accessing a repository on local disk.
  - handles 'file' scheme
* ra_serf : Module for accessing a repository via WebDAV protocol using serf.
  - handles 'http' scheme
  - handles 'https' scheme

Complete installation : Complete Installation of Subversion

How to Backup and Restore the Subversion Repository

In this post, i will show you on how to backup and restore the subversion repository using svnadmin command.

To backup the repository, run below command :

     
    [root@server ~]# mkdir /mysvnbackup
    [root@server ~]# svnadmin dump /svn/repos/testsvn > /mysvnbackup/testsvn.svndump
    * Dumped revision 0.
    

To restore the repository, run below command :

    [root@server ~]# rm -rf /svn/repos/testsvn
    [root@server ~]# svnadmin create /svn/repos/newtestsvn
    [root@server ~]# chown -R apache:apache /svn/repos/newtestsvn
    [root@server ~]# svnadmin load /svn/repos/newtestsvn < /mysvnbackup/testsvn.svndump