Thursday, 2 January 2014

Frequently used Exim Command

Frequently used Exim Command

============================================
============================================

#Print the total number of mail in mail queue.

 exim -bpc

#Print list of mails in the queue

 exim -bp

#Print summary of messages in queue

 exim -bp | exiqsumm

#Print what exim is currently doing now

 exiwhat

#Print message header

 exim -Mvh <message id>

#Print message's body

 exim -Mvb <message-id>

#Print a message logs

 exim -Mvl <message-id>

#It shows top 50 domains using mail server with options.

 eximstats -ne -nr /var/log/exim_mainlog

------------------------------------------------------------------------------------------------------------------------------------

#To remove a message from the queue

 exim -Mrm <message-id>

#To freeze a message

 exim -Mf <message-id>

#To remove all frozen mails in the queue

 exim -bp | grep frozen | awk '{ print $3 }' | xargs exim -Mrm

#To check how exim will route a given address

 exim -bt user@remotehost.com

#To search the queue for messages from a specific sender

  exiqgrep -f user@domain.com

#To search the queue for messages for a specific recipient/domain

  exiqgrep -r user@domain.com

#To print messages older than the specified number of seconds.

  exiqgrep -o <sec>

#To print messages that are younger than the specified number of seconds.

  exiqgrep -y <sec>

#To print the message-id of the entire queue

 exiqgrep -i

#To print a count of messages

  exiqgrep -c

#To remove all messages older than 10 day.

 exiqgrep -o 86400 -i | xargs exim -Mrm

#To freeze all queued mail from a given sender

 exiqgrep -i -f user@domain.com | xargs exim -Mf

# To remove all mail delivery failure mails.

   exiqgrep -i -f '<>'  | xargs exim -Mrm

Find Spam Mail in Cpanel server:Exim

Find Spam Mail in Cpanel server:Exim
====================================
====================================


#summary of mails in the mail queue.

 exim -bpr | exiqsumm -c | head

#To get all Message-ids of a Particular user

 exiqgrep -f <userid@mail.com>| grep '<' |cut -d"<" -f1 |awk '{print $3}'

 Provide username in above script

#Print message header

 exim -Mvh <message id>

#Print message's body

 exim -Mvb <message-id>

#To Delete all mail queue of a user by Message-id

exiqgrep -f <userid@mail.com>| grep '<' |cut -d"<" -f1 |awk '{print $3}' |xargs exim -Mrm

===================================================================
#To check the script that will originate spam mails:

 tail -f /var/log/exim_mainlog | grep cwd

 grep "cwd=/home" /var/log/exim_mainlog | awk '{for(i=1;i<=10;i++){print $i}}' | sort | uniq -c | grep cwd | sort -n

 awk '{ if ($0 ~ "cwd" && $0 ~ "home") {print $3} }' /var/log/exim_mainlog | sort | uniq -c | sort -nk 1

 grep 'cwd=/home' /var/log/exim_mainlog | awk '{print $3}' | cut -d / -f 3 | sort -bg | uniq -c | sort -bg

#To find exact spamming script currently running

  ps auxwwwe | grep <user> | grep --color=always "<location of script>" | head

  Provide username and location of script in above script

#Once you find the script ,following script will help you to find the ip address which is reponsable for the spamming.You can block the IP address 
 in  firewall

 grep "<script_name>" /home/username/access-logs/domain.com | awk '{print $1}' | sort -n | uniq -c | sort -n

 Provide Scriptname,username and domainname in above script

========================================================================

#In order to find “nobody” spamming, use the following command

 ps -C exim -fH ewww | awk '{for(i=1;i<=40;i++){print $i}}' | sort | uniq -c | grep PWD | sort -n

#To remove all frozen mails in the queue

 exim -bp | grep frozen | awk '{ print $3 }' | xargs exim -Mrm


#To remove a message from the queue

 exim -Mrm <message-id>

Tuesday, 4 December 2012

Install Sun jdk in Ubuntu 12.10

-->

Step 1 : Instal Java jdk version 7 from Repository

sudo apt-get install sun-java7-jdk.

If already installed an jdk version Go to step 2

Step 2 : Download sdk

Step 3 : Extract tar -xvf jdk-7u4-linux-x64.tar.gz

Step 4 : Move extracted folder to /usr/lib/jvm/
                     sudo mv jdk1.7.0_04 /usr/lib/jvm/

Step 5 : Install new java source , update-alternative is used when multiple version of same application is used and you want to pick one defailt version.
sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.6.0_32/bin/javac 1
 
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.6.0_32/bin/java 1 
 
sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.6.0_32/bin/javaws 
 
 
Step 6 : If default java verion one to be used, for that sudo update-alternatives –config is used : 
 
sudo update-alternatives --config javac
sudo update-alternatives --config java
sudo update-alternatives --config javaws 
 
Step 7 : Check Java Version
              java -version
Step 8: Update Java Home Directory for that Edit .bashrc
vim ~/.bashrc
add following line to it.
export JAVA_HOME=/path/your/jdk
export PATH=$JAVA_HOME/bin:$PATH





Saturday, 1 December 2012

Tomcat-Apache Installation

Step1: Install tomcat and apache package from Repository.
  • apt-get install tomcat7
  • apt-get install apache2
 
Step 2: Configure the connection between Tomcat and apache

         Step 2.1: Enable ajp module in Apache
  •  a2enmode proxy proxy_ajp
     
    Step 2.2: Add the below lines in configuratin file  /etc/apache2/sites-available/default 
             ProxyPass / ajp://localhost:8009/
 
             ProxyPassReverse / ajp://localhost:8009
    Step 2.3: To enable ajp module, uncomment the following line in /etc/tomcat7  /server.xml
            Connector port="8009" redirectPort="8443" protocol="AJP/1.3"
 
 
Step 3: To enable tomcat users edit configuration file  etc/tomcat7/tomcat-users.xml   
 <tomcat-users>
 
<role rolename="manager-gui"/> 
 
 <role rolename="admin-gui"/> 
 <user name="admin" password="secret_password" roles="manager-gui,admin-gui"/> 
 </tomcat-users>


 Step 4: Restart Tomcat and apache Services service 
service apache2 restart  
service tomcat7 restart
 
Step 5: Check Installation and configuration is fine
http://<ip>:80  
http://<ip>:8080 
http://<ip>:8080/manager/html
                                                                                                                                                                                                                                                                                                                                                                                                                               

Tuesday, 23 October 2012

Filezilla Error "Please check your filetype assosiation error"

When i try Edit .php extension file with Dreamweaver in  filezilla following error occured




I can open and Edit files in Desktop,but with in filezilla Software i cant open it
at all.When i try open php extension file, File type error come

Solution:

Step 1: Open Filezilla then go to

             Edit >>> Setting  >>> Transfers >> Filetype.

           Add php file type by clicking "Add" Button

Step2 : In filezilla go to
 
            Edit >>> Setting >>> File Editing

           In File Editing Click "Use Custom Editor "
and add the following url
 php "C:\Program Files\Adobe\Adobe Dreamweaver CS3\Dreamweaver.exe" -open








Saturday, 20 October 2012

TroubleShooting Server Issue


Approach to Server Troubleshooting
-----------------------------------------------------------
Step 1 :Gather Information
        Try to gather information about OS Version,program  
        Details,Login Details,changes currently made.
       

Step 2 :Check the Error log
        Try to identify the error,Symptoms which cause the Error,If 
        more than one symptom cause the error 

Step3 :Take the Action
       Check if the problem had occured Earlier,I think Documentation
       will be help you in that,So try to regularly keep 
       Documantaion of Errors and solutions.If not then try to solve
       the solution

Step4 :After error is solved,check if any other issue occured due to
       changes we made if then go to step 2 to 3

Step :Check all Server service running serive.All issues are solved


Comment if any changes to be made!!!!!
 

Tuesday, 16 October 2012

Import or Export Bookmark of Chrome in Ubuntu

To Import and export Bookmarks in Chrome, Follow the step given Below

Step 1 : Press Ctl+Shft+b

then a pop up will show,say
for quick access place your bookmarks here on the bookmarks bar. Import bookmark's now




Step 2:Click the  Import Bookmark's now option