Archive for November, 2008

curl_exec error 60 SSL certificate problem

Wednesday, November 19th, 2008

The problem :
=================
curl_exec error 60 SSL certificate problem
=================
This is mainly caused because the curl root certificates file does not contain the particular root certificate chain.The best method would be add the correct root certificate to the file obtained by running the command

curl-config –ca
or a quick dirty trick would be add the following line
===================

curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, [...]

Clamd Startup error

Tuesday, November 18th, 2008

Error:
===============
[root@localhost ~]# /etc/rc.d/init.d/clamd start
Starting Clam AntiVirus Daemon: LibClamAV Error: cli_loaddbdir(): Can’t open directory /var/clamav
ERROR: Unable to open file or directory
[FAILED]
===============

This is caused by an enforcing SELinux policy

Disable selinux using setenforce=0

Passing mails to a script using Postfix

Thursday, November 13th, 2008

Imagine a scenario in which you would have to pipe mails to a local user to a php/perl script and you are using Postfix as the MTA . In Postfix this can be setup using procmail as the command for local delivery
==========================
postconf -e ‘mailbox_command = /usr/bin/procmail’
postfix reload
===========================
You should also verify that mail for the root [...]

Setting up mail service behind a firewall using fetchmail

Thursday, November 13th, 2008

Imagine that you are asked to setup a local mail server for n number of users who are behind a firewall and the only way they can access their mail over the internet is using proxy servers like squid . Just like squid retrieves a copy of the webpage and passes on the http data [...]

Cpanel Hooks and custom configurations

Wednesday, November 12th, 2008

Modifying the source code of cpanel control panel is prohibited by End User License Agreement (EULA)
So how would you implement some custom fucnctionality?
Cpanel provides something called hooks! for this purpose .Hooks are basically files that are checked and if present executed after some  internal cpanel process like account creation,termination etc
I would provide the example of [...]

Ruby On Rails Hosting -A Laymans Approach

Monday, November 10th, 2008

Recently there is a lot of Hype in Ruby On Rails commonly called ROR . Ruby On Rails  claims to be a platform with Rapid development .The problem arises when when people used to the PHP hosting world switch to Rails Hosting . Then people start to realize whey there are millions of WebHosts offering [...]

Apache 2.2.10 + php 4.4.9 ( cgi ) + php5.2.6 ( dso ) Compilation

Thursday, November 6th, 2008

After Apache Compilation , download php4 and php5 source and untar the same. Go to php4 source dir :-
PHP4 as CGI
==========
cd /usr/local/php-4.4.9
./configure –prefix=/usr/local/php4 –with-mysql=/var/lib/mysql –with-mysql-sock=/var/lib/mysql/mysql.sock
make
make install
edit httpd.conf
==========
uncomment ScriptAlias /cgi-bin/ “/usr/local/apache/cgi-bin/”
cd /usr/local/apache/cgi-bin
ln /usr/local/bin/php php
edit php.conf
=========
Action application/x-httpd-php4 /cgi-bin/php
AddType application/x-httpd-php4 .php4
AddHandler application/x-httpd-php4 .php4
Give include_path in php.ini as  /usr/local/php4/lib/php
PHP 5 as CLI
==========
cd /usr/local/php-5.2.26
./configure –with-apxs2=/usr/local/apache/bin/apxs –enable-ftp
make
make install
Check for LoadModule [...]