Friday, February 17, 2012

Exim Commands.


  1. Log file is located at /var/log/exim/main_log
  2. To see some general stats: eximstats -nr /var/log/exim_mainlog
  3. To see current activity: exim -bp | exiqsumm
  4. To see output number of mails in the queue: exim -bpc, to list queued mails exim -bp
  5. To see undelivered messages in the queue: exim -bpu
  6. To see what the actual processes are doing: exiwhat
  7. Checking mailbox size: du -hsc * (run in /home)
  8. The configuration template is in /etc/exim/update-exim.conf. and the actual config file in in /var/lib/exim/config.auto generated.
  9. Regenerate the config file from the template: update-exim.conf
  10. Reload the configuration: invoke-rc.d exim reload
  11. Send a test message send "content" | mail -s "subject" user@example.com
  12. Send a message without "send": echo "body" | mail -s "subject" user@example.com
  13. Process the queue: exim -q -v
  14. Process the queue, ignoring retry times: exim -qf -v
  15. Process the queue, including even frozen messages: exim -qff -v or exim -qff -v -C /etc/exim.conf &
  16. To see the contents of a specific message: exim -Mvc message id
  17. To remove mails by id exim -v -Mrm ID
  18. To delete frozen mails exim -bp | awk '$6~"frozen" { print $3 }' | xargs exim -Mrm
  19. To freeze mails from sender exiqgrep -i -f (MAIL ADDRESS HERE) | xargs exim -Mf
  20. To remove mails from sender exiqgrep -i -f (MAIL ADDRESS HERE) | xargs exim -Mrm
  21. To find most emailing ip tail -1000 /var/log/exim_mainlog |grep '\[' |cut -d[ -f2 |cut -d] -f1|sort -n |uniq -c |sort -n or tail -2000 /var/log/exim_mainlog | grep public
  22. To find the mail in the queue with $name exim -bp|grep $name
  23. To view the message header exim -Mvh $MSGID
  24. To view the message body exim -Mvb $MSGID
  25. To Force deliver of message exim -M $MSGID
  26. To view the transact of message exim -v -M $MSGID
  27. To force exim update in cpanel server /scripts/eximup --force

Wednesday, February 15, 2012

Install phpshield on 32 or 64 bit linux machine

Php Shield module is used in servers using video scripts which makes the script to get encrypted and easy to use.

Steps.
1.-bash-3.2# arch
i686

It is used for checking the architecture.

2.-bash-3.2# which ps
/bin/ps
-bash-3.2#

3.-bash-3.2# file /bin/ps |grep bit
/bin/ps: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, stripped

4. 2. Make sure following parameters has appropriate value in php.ini file like :

# Thread Safety is disabled
# enable_dl is set to on
# The path to your extension_dir
# Path to your php.ini file

php.ini file path :

5.  -bash-3.2# php --ini
Configuration File (php.ini) Path: /usr/local/lib
Loaded Configuration File:         /usr/local/lib/php.ini
Scan for additional .ini files in: (none)
Additional .ini files parsed:      (none)


6. Execute following CMD via ssh:
        # mkdir ~/phpshield
        # cd ~/phpshield



7.Download the phpSHIELD loaders:

       # wget http://phpshield.com/loaders/phpshield.loaders.linux.zip //for 32bit machine
       # wget http://phpshield.com/loaders/phpshield.loaders.linux-64.zip //for 64 bit
8.    #unzip phpshield.loaders.linux.zip
9.    #cp phpshield.5.2.lin /usr/lib/php/extensions/no-debug-non-zts-20060613/

10. Add following line in php.ini file and restart webserver :

extension="phpshield.5.2.lin"
echo "extension="phpshield.5.2.lin"" >> /usr/local/lib/php.ini

or

extension="phpshield.5.2ts.lin"


11. You can now check it with

# -bash-3.2# php -m | grep -i shie
phpSHIELD