Showing posts with label Parallels. Show all posts
Showing posts with label Parallels. Show all posts

How to run CGI scripts anywhere in the server, Plesk.

0 comments

# cd /etc/httpd/conf/


# cp -p httpd.conf httpd.conf.bak


# vi httpd.conf


uncomment AddHandler cgi-script .cgi


# service httpd restart



or
Create an .htaccess file in your cgi-bin directory, that file should have the following

AddType text/x-server-parsed-html .html
AddType application/x-httpd-cgi .cgi .p
l

Make sure you upload it in ASCII format, not binary.


set the permissions on your scripts correctly


# chmod   755   XXXX

Stats not working in Plesk

0 comments
This summary is not available. Please click here to view the post.

How to Track Spammers in Plesk

0 comments

You need to first Install qmhandle-1.3.2 from:




wget http://downloads.sourceforge.net/sourceforge/qmhandle/qmhandle-1.3.2.tar.gz?use_mirror=nchc











wget http://downloads.sourceforge.net/sourceforge/qmhandle/qmhandle-1.3.2.tar.gz?use_mirror=nchc


cd qmhandle-1.3.2
./qmHandle -s

shows the stats of mails.


To view the mails in queue, please do



# /var/qmail/bin/qmail-qstat
messages in queue: 758
messages in queue but not yet preprocessed: 0

Let’s examine the queue with qmail-qread. Seeing a bunch of strange email addresses in the recipient list usually it’s meaning spam.


# /var/qmail/bin/qmail-qread


Please examine the email content of the emails in the queue using vi or cat  command. Firstly we should find message’s id using qmail-qread, then find the file holding the email in/var/qmail/queue with find command.


# find /var/qmail/queue/ -name (msg id)


Find the IP address from the mail header and remove spam from the queue using qmail-remove


Now, remove spams, they all will end up in the/var/qmail/queue/yanked directory :


# /etc/init.d/qmail stop


# qmail-remove -r -p ‘mail@address.com’


In a few minutes we do have more emails with the same patterns from the same ip address. That’s great, we do have opportunity to examine smtp traffic from the spammer’s ip address. Run tcpdumpand wait a few minutes.


# tcpdump -i eth0 -n src xxx.xxx.xxx.xxx \or dst xxx.xxx.xxx.xxx -w smtp.tcpdump -s 2048


Examining log file with vi we found that spammer is sending spam using LOGIN authentication:


220 ulise.domain.com ESMTP



ehlo User
250-ulise.domain.com
250-AUTH=LOGIN CRAM-MD5 PLAIN
250-AUTH LOGIN CRAM-MD5 PLAIN
250-STARTTLS
250-PIPELINING
250 8BITMIME
AUTH LOGIN
334 VXNlcm5hbWU6
dGVzdA==
334 UGFzc3dvcmQ6
MTIzNDU=
235 go ahead

Then decode the user/pass to see which account is used:


# perl -MMIME::Base64 -e ‘print decode_base64(”dGVzdA==”)’ test


# perl -MMIME::Base64 -e ‘print decode_base64(”MTIzNDU=”)’ 12345


So, someone created a test account with a weak password and someone else guessed it and is sending spam through the server.


Let’s find the domain owning of the mailbox:


# mysql -uadmin -p`cat /etc/psa/.psa.shadow` psa



mysql> SELECT m.mail_name, d.name, a.password FROM mail AS m LEFT JOIN (domains AS d, accounts AS a) ON (m.dom_id = d.id AND m.account_id = a.id) WHERE m.mail_name=’test’ AND a.password=’12345?;
+———–+————+———-+
| mail_name | name       | password |
+———–+————+———-+
| test      | example.com | 12345    |
+———–+————+———-+
1 row in set (0.01 sec)

Next step is to delete test mailbox and send a warning to client.



To improve your server’s security you’ll need to enable:
Server -> Mail -> Check the passwords for mailboxes in the dictionary

Reference : http://www.cherpec.com/2008/07/plesk-howto-debug-spam-problems/

How to install Zend Optimizer

0 comments
Here is a quick installtion guide to install Zend Optimizer-3.0.1 on a Plesk  or on any plain server.

# cd /usr/local/src

#  wget http://www.eth0.us/files/ZendOptimizer-3.0.1-linux-glibc21-i386.tar.gz

#  tar -zxf ZendOptimizer-3.0.1-linux-glibc21-i386.tar.gz

# cd ZendOptimizer-3.0.1-linux-glibc21-i386

# ./install

Now just hit enter a few times until it is done.....

Please check and make sure that below lines are exist in /etc/php.ini

zend.ini section looks like this,
[Zend]
zend_extension_manager.optimizer=/usr/local/Zend/lib/Optimizer-3.3.0
zend_extension_manager.optimizer_ts=/usr/local/Zend/lib/Optimizer_TS-3.3.0
zend_optimizer.version=3.3.0a
zend_extension=/usr/local/Zend/lib/ZendExtensionManager.so
zend_extension_ts=/usr/local/Zend/lib/ZendExtensionManager_TS.so


Now you need  to  restart apache service

#  service httpd restart

OR


# /etc/init.d/httpd restart



Please check and verified output:

[root@PKS Hosting ~]# php -v
PHP 5.1.6 (cli) (built: May 9 2007 11:29:06)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
with the ionCube PHP Loader v3.1.28, Copyright (c) 2002-2007, by ionCube Ltd., and
with Zend Extension Manager v1.2.2, Copyright (c) 2003-2007, by Zend Technologies
with Zend Optimizer v3.3.0, Copyright (c) 1998-2007, by Zend Technologies

*** Now everything will work, and Zend will be properly displayed in php.ini
Go_GrEen^ThiNk_GReeN~LoVE_GreEn - Pushkar