web analytics

Category Installations

Install sphinx using yum CentOS/RedHat

Ouff, sphinx!!!! I used to sigh when someone talks to me about sphinx. But now I find it easy. Try it yourself.

yum install sphinxsearch  should do the trick normally.

If the above didn’t work, download the sphinx rpm from http://sphinxsearch.com/downloads/release/

My machine is centos5/32bit so I downloaded http://sphinxsearch.com/downloads/accept.php?file=sphinx-2.0.8-1.rhel5.i386.rpm

cd /usr/local/src

wget http://sphinxsearch.com/downloads/accept.php?file=sphinx-2.0.8-1.rhel5.i386.rpm

Now you can use yum to install this.

yum localinstall –nogpgcheck sphinx-2.0.8-1.rhel5.i386.rpm

Once it is installed, the sphinx config is available at /etc/sphinx.conf

You can start/stop sphinx using /etc/rc.d/init.d/sphinx start/stop

Indexer can be run as

/usr/bin/indexer –all

Read More

Install sphinx search engine Centos/RHEL from source

Installing sphinx from the source file is mentioned here. Installation with yum is available here

Download the sphinx source from http://sphinxsearch.com/downloads/release/

cd /usr/loca/src
wget http://sphinxsearch.com/downloads/accept.php?file=sphinx-2.0.8-release.tar.gz

If you are unable to get it through direct wget, you can download it to your local machine and ftp/scp to the server.

Now untar the file.

tar -xzvf sphinx-2.0.8-release.tar.gz

rm -fv sphinx-2.0.8-release.tar.gz

cd sphinx-2.0.8-release

./configure –prefix=/usr/local/sphinx

make install

This will install sphinx search engine. You can find if it is the correct version as follows.

# /usr/local/sphinx/bin/searchd -V
Sphinx 2.0.8-release (r3831)

You installed it at /usr/local/sphinx and the binaries are present at /usr/loca...

Read More

APE over SSL using stunnel in cpanel server

Refer To APE installation in cpanel server here

1) In order for APE to work with stunnel, make sure that the stunnel version in the server should be less than 4.3. Centos and RHEL 5 will most probably have stunnel installed already. If not, install stunnel.

2) Now we need to create a conf for ape.
vi /etc/stunnel/ape.conf and add the following to it.

cert = /etc/stunnel/stunnel.pem
debug = 7
output = /etc/stunnel/stunnel.log
;disable delay DNS lookup for ‘connect’ option
delay = no
;no time to wait for close_notify!
TIMEOUTclose = 0
accept =
connect =

Create a file for stunnel log.

# touch /etc/stunnel/stunnel.log

3) Now generate a CSR and key for *.ape.divya.com

# cd /etc/stunnel
# openssl req -nodes -newkey rsa:2048 -out csr.pem -keyout stunnel.pem

The ...

Read More

APE on port 80 – Installation and Setup in cpanel server

Version Installed – 1.1.1 and 1.1.2-dev are installed. Can switch as needed.
Config file – /usr/local/src/APE/bin/ape.conf

1) cd /usr/local/src

2) wget http://www.ape-project.org/stable/APE_Server-1.1.1.amd64.bin.tar.gz

3) tar -xzvf APE_Server-1.1.1.amd64.bin.tar.gz

4) cd APE_Server/bin

5) ./aped (notice it is a dot followed by a slash)

6) This will start APE. You may issue a Ctl+C and edit the file ape.conf in the same location as follows.

port = 80
daemon = yes
ip_listen = (put your IP address here)
domain = abc.com (put your domain name here)

7) Now we need to assign a dedicated IP address for ape.abc.com from WHM -> Edit DNS -> abc.com

8) DNS Functions -> Edit DNS zone -> abc.com and add the following entry

ape     14400     IN      A

Read More

Install Pagespeed in cpanel server

Version Installed :




Pagespeed requires deflate module, so that should be compiled already with 


Once deflate is enabled, do the following.


  1. cd /usr/local/src

  2. Check if the server is 32 bit or 64 bit and then download the corresponding pagespeed rpm. You can check it by issuing any of the following commands.


uname –m




getconf LONG_BIT


  1. mkdir mod-pagespeed

  2. cd mod-pagespeed

  3. rpm2cpio ../mod-pagespeed-beta_current_x86_64.rpm | cpio –idmv

  4. cp etc/httpd/conf.d/pagespeed.conf /usr/local/apache/conf/

  5. cp usr/lib64/httpd/modules/mod_pagespeed.so /usr/local/apache/modules/

  6. chmod 755 /usr/local/apache/module...

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.


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

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

Read More

Login to website using curl

Suppose there is a domain  divya.com which has a login form. You need to login to the site every hour, to make sure that the login is working. For that the following script helps, which can be run as a cron.

cd /root/test/abc/
> cjar
> test2.txt
> test3.txt
##Cookies will be stored in the file cjar##
curl –cookie-jar cjar –data “username=abc@gmail.com&password=12345” –location “http://abc.com/login/” > test2.txt

##Specify the cookie file and access another link to see if it works. If login works, you will get the code of this page, otherwise it will get redirected to the login page itself, returning a 302 status code##

curl -b cjar http://abc.com/save_org > test3.txt

CODE=$(grep -o “302 – Found” test3.txt)
if [ “$CODE” == “302 – Found” ]
echo “abc...

Read More

CHECK_NRPE: Error – Could not complete SSL handshake

While configuring and testing nagios monitoring, you may sometimes get the above error. Then check for the following.

In the remote server being monitored,

1) Check the file /etc/xinetd.d/nrpe. Make sure that the only_from field contains the nagios server IP, which is shown as x.x.x.x below.

# default: on
# description: NRPE (Nagios Remote Plugin Executor)
service nrpe
flags = REUSE
socket_type = stream
port = 5666
wait = no
user = nagios
group = nagios
server = /usr/local/nagios/bin/nrpe
server_args = -c /usr/local/nagios/etc/nrpe.cfg –inetd
log_on_failure += USERID
disable = no
only_from = x.x.x.x
2) In the remote server being monitored, make sure that the nagios IP is added to the allowed_hosts section of the file /usr/local/nagios/libexec/nrpe.cfg


Read More

X-Ham-Report in Cpanel

Cpanel now adds a spam/ham report to the email headers. If the message is not spam, it adds a ham report as follows.

X-Ham-Report: Spam detection software, running on the system “server.def.com”, has
identified this incoming email as possible spam. The original message
has been attached to this so you can view it (if it isn’t spam) or label
similar future email. If you have any questions, see
the administrator of that system for details.

Content preview: testing […]

Content analysis details: (-1.9 points, 5.0 required)

pts rule name description
—- ———————- ————————————————–
-0.0 SPF_PASS SPF: sender matches SPF record
-1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1%
[score: 0.0000]

Read More

/backup taking up space

Sometimes you may get a disk critical error, and if it is the cpanel backup that is taking space, the following may help. Sometimes the backup of a lot of terminated/cancelled accounts may be present in the backup which may be adding to the disk usage. The following scripts checks the monthly backup and if there are backups of inactive accounts in the server, deletes them to regain space.

1) Get the accounts in /etc/userdomains

cat /etc/userdomains | awk -F: ‘{print $2}’ > /root/list_domains

2) Get the ac...

Read More