Wednesday, March 14, 2012

Raid Weirdness

After rebooting a node with a spare drive in the raid, I got errors saying that the spare drive was an inoperable unit.

//cps1> info c0

Unit  UnitType  Status         %RCmpl  %V/I/M  Stripe  Size(GB)  Cache  AVrfy
u0    RAID-5    OK             -       -       64K     1862.61   ON     OFF
u1    RAID-5    INOPERABLE     -       -       64K     1862.61   OFF    OFF    

Port   Status           Unit   Size        Blocks        Serial
p0     OK               u0     465.76 GB   976773168     WD-WCANU2126397
p1     OK               u0     465.76 GB   976773168     WD-WCANU2051520
p2     OK               u1     465.76 GB   976773168     WD-WCANU2030999
p3     OK               u0     465.76 GB   976773168     WD-WCAS84739115
p4     OK               u0     465.76 GB   976773168     WD-WCANU2114264
p5     OK               u0     465.76 GB   976773168     WD-WCANU2051215
p6     NOT-PRESENT      -      -           -             -
p7     NOT-PRESENT      -      -           -             -
To fix this, I just deleted the unit (u1) and added the disk back as a spare.
//cps1> /c0/u1 del
Deleting /c0/u1 will cause the data on the unit to be permanently lost.
Do you want to continue ? Y|N [N]: Y
Deleting unit c0/u1 ...Done.

Tuesday, March 13, 2012

How to Enable the memcache Extension in php?

MemCached is a high-performance, distributed memory object caching
system, generic in nature, but intended for use in speeding up dynamic
web applications by alleviating database load.

Here i have showed how to install the memcached and extension for php.

1.Install Memcached:

Download the repo from the EPEL.

#rpm -Uhv

And use yum to install the memcahed

#yum -y install memcached

After installing you can start the memcached service as follow.

#/etc/init.d/memcached start

2.Install the memcached php extension :

Download The memcached.


#tar -zxvf memcached

#cd memcache-3.0.6

#phpize && ./configure --enable-memcache && make

#make install

After installing the memcache php enable the extension on php.ini as

#vim /etc/php.ini


And restart the httpd server.

Friday, March 2, 2012

How to configure the proftpd as sftp ?

    ProFTPD is a high-performance, extremely configurable, and most of all a secure FTP server, featuring Apache-like configuration syntax, modules, and a highly customizable server infrastructure, including support for multiple ‘virtual’ FTP servers, anonymous FTP, and permission-based directory visibility. Here , i showed, how to configure the proftpd as secure ftp that is sftp for that i have used proftpd-1.3.4a.tar.gz

You can download it from the below link.


root@mughil:~#tar -zxvf proftpd-1.3.4a.tar.gz

root@mughil:~#cd proftpd-1.3.4a

Run Autoconf(Configure):

Thursday, March 1, 2012

How to Compile and Install Apache from the Source Package?

  Apache provides a facility to extend its functionality using separate modules. Because, When PHP is compiled as Apache shared module its object code is not included in httpd binary. Instead, it works as a separate module which can be loaded by Apache and can also be disabled.So,I have build Apache as shared module.
  You can download the apache from the below url.
   Here i have used httpd-2.4.1.tar.bz2

root@mughil:~# cd /usr/src

root@mughil:~# tar -jxvf httpd-2.4.1.tar.bz2

root@mughil:~# cd httpd-2.4.1

Run Autoconf(Configure):

root@mughil:~# ./configure --prefix=/usr/local/apache2/ --enable-mods-shared=all

  Here, prefix option tells the location to install the apache and second option enable-mods-shared tells to compile and install all modules as shared DSO libraries,so that we can easily enable and disable them in the httpd.conf file.

Compiling the Apache:

root@mughil:~# make

Installing the Apache:

root@mughil:~# make install