web analytics

Monthly Archives April 2013

Secure /tmp, /var/tmp, /dev/shm in Cpanel Server

Secure /tmp

—————–
You can use the cpanel script /scripts/securetmp to secure tmp partition.

Otherwise follow the steps below. First take a backup of the fstab file, just so that you would be able to revert it to a working copy in case of any issues.

[root@abc ~]# cp –pv /etc/fstab /etc/fstab.bak


Make a 3G file for /tmp and check the current filesystem type of /tmp


[root@abc ~]# dd if=/dev/zero of=/var/tempFS bs=1024 count=3072000
[root@abc ~]# /sbin/mkfs.ext3 /var/tempFS


Now, create a backup of current /tmp


[root@abc ~]# cp -Rpf /tmp /tmpbackup


Mount the new /tmp and set required permissions


[root@abc ~]# mount -o loop,noexec,nosuid,rw /var/tempFS /tmp
[root@abc ~]# chmod 1777 /tmp


Copy the old /tmp data and edit fstab


[root@abc ~]# cp -Rpf /tmpbackup/* /tmp/
[root@abc ~]# vi /...
Read More

APC in cpanel server

Version Installed – APC-3.1.9

  1. cd /usr/local/src

  2. wget http://pecl.php.net/get/APC-3.1.9.tgz

  3. tar -zxvf APC-3.1.9.tgz

  4. cd APC-3.1.9

  5. phpize

  6. ./configure –enable-apc –enable-apc-mmap –with-apxs –with-php-config=/usr/local/bin/php-config

  7. make

  8. make test

  9. make install

  10. Now, enable the apc module in php.ini

vi /usr/local/lib/php.ini

Add the following lines to it.

extension=”apc.so”
apc.enabled=1
apc.shm_segments=1
apc.shm_size=128

  1. Now restart apache for the changes to get into effect

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

Read More

configure: error: Cannot find libsphinxclient headers ERROR: `/tmp/pear/temp/sphinx/configure –with-sphinx’ failed

Installing SphinxClient
———————————
In a linux machine, you can install sphinx client using pecl install sphinx

But when I tried, it was hitting the error as follows:

configure: error: Cannot find libsphinxclient headers
ERROR: `/tmp/pear/temp/sphinx/configure –with-sphinx’ failed

After a lot of googling, I was about to solve it which is explained below.

1) Download sphinx source from sphinx site
    cd /usr/local/src/
    wget http://sphinxsearch.com/downloads/accept.php?file=sphinx-2.0.4-release.tar.gz

2) Untar it
   tar -xzvf sphinx-2.0.4-release.tar.gz

3) cd sphinx-2.0.4-release/api/libsphinxclient

4) ./configure

5) Once ./configure succeeds it is a common procedure to run make, make install to build the binaries. But here, don’t do it.

6) Instead, install a package named check...

Read More