Thursday, May 24, 2007

Installing IonCube Loader

1. Download the program and store it on your server using wget or FTP.

http://www.ioncube.com/loader_download.php

2. Unpack the program
tar -zxvf ioncube_loaders.tar.gz

3. cd ioncube

4. copy ioncube-install-assistant.php to a web directory such as your hosting directory and open it in your browser window.
cp ioncube-install-assistant.php /home/userdirectoryhere/www

5. Now lets move the iconcube directory to a permanent location:

cd ..
mv ioncube /usr/local

6. Now that you know the location of php.ini you need to edit it.
pico /usr/local/lib/php.ini

Now find where other zend extentions are in the file.
ctrl + w: zend_extension

Paste in your new line for ioncube loader
zend_extension = /usr/local/ioncube/ioncube_loader_lin_4.3.so

(NOTE) Check php version if it is 5.2 then entry should be ioncube_loader_lin_5.2.so

7. Save the changes
ctrl + X then Y and enter

8. Restart the web server to take effect.
/etc/init.d/httpd restart

Enjoy
Ninad S

Tuesday, May 22, 2007

What is RAID (Redundant Array of Independent Disks)?

RAID is a type of disk, where several physical disks are combined into an array for better speed and fault tolerance. RAID 0 implements data striping where file blocks are written to separate drives. RAID 0 does not provide fault tolerance, because failure of one drive will result in data loss. RAID 1 implements data mirroring. Data is duplicated on two drives either through software or hardware. It provides faster read performance than a single drive.

Enjoy
Ninad S

Monday, May 21, 2007

Cron to delete mails from Inbox

Here is the syntax for deleting all email in the inbox of the default email address for a website:

echo -n > /home/youraccount/mail/inbox

Enjoy
Ninad S

Send Email from a PHP Script Using SMTP Authentication

To connect to an outgoing SMTP server from a PHP script using SMTP authentication and send an email:

Adapt the example below for your needs. Make sure you change the following variables at least:
* from: the email address from which you want the message to be sent.
* to: the recipient's email address and name.
* host: your outgoing SMTP server name.
* username: the SMTP user name (typically the same as the user name used to retrieve mail).
* password: the password for SMTP authentication.
------------------------------------------------------------------------------------------------
require_once "Mail.php";

$from = "Bill Sender ";
$to = "Ninad Recipient ";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";

$host = "mail.example.com";
$username = "smtp_username";
$password = "smtp_password";

$headers = array ('From' => $from,
'To' => $to,
'Subject' => $subject);
$smtp = Mail::factory('smtp',
array ('host' => $host,
'auth' => true,
'username' => $username,
'password' => $password));

$mail = $smtp->send($to, $headers, $body);

if (PEAR::isError($mail)) {
echo("

" . $mail->getMessage() . "

");
} else {
echo("

Message successfully sent!

");
}
?>
------------------------------------------------------------------------------------------------
Enjoy
Ninad S

Saturday, May 19, 2007

Google AdSense Account Disabled

Hello Ninad Shirgaonkar,

It has come to our attention that invalid clicks and/or impressions
have been generated on the Google ads on your site(s). We have
therefore disabled your Google AdSense account. Please understand that
this was a necessary step to protect the interests of AdWords
advertisers.

As you may know, a publisher's site may not have invalid clicks or
impressions on any ad(s), including but not limited to clicks and/or
impressions generated by:

- a publisher on his own web pages
- a publisher encouraging others to click on his ads
- automated clicking or surfing programs, or any other deceptive
software
- a publisher altering any portion of the ad code or changing the
layout, behavior, targeting, or delivery of ads for any reason

These or any other such activities that violate Google AdSense Terms
and Conditions and program polices may have led us to disable your
account. The Terms and Conditions and program polices can be viewed at:

https://www.google.com/adsense/localized-terms?hl=en_US
https://www.google.com/adsense/policies?hl=en_US

If you have any questions about invalid activity or the action taken on
your account, please do not reply to this email. You can find more
information by visiting
https://www.google.com/adsense/support/bin/answer.py?answer=57153.

Sincerely,

The Google AdSense Team

How to increase file limit

Get current limit:

ulimit -n

cat /proc/sys/fs/file-nr

The default limit is 1024.

Get current number of open file descriptors:

lsof [-p pid] | wc -l

Increase the limit:

Edit /etc/security/limits.conf:

username hard nofile 32768

Enjoy

Ninad S

Friday, May 11, 2007

Postfix + ClamAV + MailScanner in OpenSuse 10.2

1) Install the anti virus software (Clamav) –> (here) http://rpm.pbone.net/
rpm -ivh clamav-db-0.88.2-1.i386.rpm
rpm -ivh clamav-devel-0.88.2-1.i386.rpm
rpm -ivh clamav-server-0.88.2-1.i386.rpm
rpm -ivh clamav-0.88.2-1.i386.rpm

/etc/init.d/clamd start

2. Once the anti-virus is install then we need to install the MailScanner software the RPM along with the source files can be found at
http://www.sng.ecs.soton.ac.uk/mailscanner/downloads.shtml

Now get ready to install the mailscanner, this is going to take a long time.

gzip -d MailScanner-4.46.2-2.rpm.tar.gz
tar -xvf MailScanner-4.46.2-2.rpm.tar
cd MailScanner-4.46.2-2
./install.sh

3. In your MailScanner.conf file in /etc/MailScanner, there are 5 settings you need to change. The settings are:

Run As User = postfix
Run As Group = postfix
Incoming Queue Dir = /var/spool/postfix/hold
Outgoing Queue Dir = /var/spool/postfix/incoming
MTA = postfix

4. You will need to ensure that the user “postfix” can write to

/var/spool/MailScanner/incoming and /var/spool/MailScanner/quarantine

chown postfix:postfix /var/spool/MailScanner/incoming
chown postfix:postfix /var/spool/MailScanner/quarantine

5. Edit file MailScanner.conf
Virus Scanners = clamav

6. Edit virus.scanners.conf
clamav /usr/lib/MailScanner/clamav-wrapper /var/lib/clamav

7. Now we need to edit the postfix main.cf file, go all the way to the bottom of the file and add the following
header_checks = regexp:/etc/postfix/header_checks

8. In the file /etc/postfix/header_checks add this line:
/^Received:/ HOLD

9. Set the servers to run on startup and then start them

chkconfig MailScanner on
chkconfig postfix on
chkconfig clamd on

/etc/init.d/Mailscanner start
/etc/init.d/postfix start
/etc/init.d/clamd start

Enjoy

Ninad S



View My Stats