Sunday 19 June 2011

How to install spam log.


///** Following are the steps to install Spam_log   **/// :--

-------------************----************--------------
 1>  Login to your server & su - to root.



 2> Turn off exim while we do this so it doesn't freak out :-

#/etc/init.d/exim stop



 3> Backup your original /usr/sbin/sendmail file, On systems using Exim MTA, the sendmail file is just basically a pointer to Exim itself :-

#mv /usr/sbin/sendmail /usr/sbin/sendmail.hidden



4> Create the spam monitoring-script for the new sendmail :-

#pico /usr/sbin/sendmail

Paste in the following:-

#!/usr/local/bin/perl
# use strict;
use Env;
my $date = `date`;
chomp $date;
open (INFO, ">>/var/log/spam_log") || die "Failed to open file ::$!";
my $uid = $>;
my @info = getpwuid($uid);
if($REMOTE_ADDR) {
print INFO "$date - $REMOTE_ADDR ran $SCRIPT_NAME at $SERVER_NAME n";
}
else {

print INFO "$date - $PWD - @infon";

}
my $mailprog = '/usr/sbin/sendmail.hidden';
foreach (@ARGV) {
$arg="$arg" . " $_";
}

open (MAIL,"|$mailprog $arg") || die "cannot open $mailprog: $!n";
while (<STDIN> ) {
print MAIL;
}
close (INFO);
close (MAIL);



 5> Change the new sendmail permissions :-

#chmod +x /usr/sbin/sendmail



6> Create a new log file to keep a history of all mail going out of the server using web scripts :-

#touch /var/log/spam_log

chmod 0777 /var/log/spam_log



7> Start Exim up again :-

#/etc/init.d/exim start



8> Monitor your spam_log file for spam, try using any formmail or script that uses a mail function - a message board, a contact script :

#tail - f /var/log/spam_log

Sample Log Output

Mon Apr 11 07:12:21 EDT 2005 - /home/username/public_html/directory/subdirectory - nobody x 99 99 Nobody / /sbin/nologin

Log Rotation Details :-
Your spam_log file isn't set to be rotated so it might get to be very large quickly, Keep an eye on it and consider adding it to your logrotation.

#pico /etc/logrotate.conf

FIND :-

/var/log/wtmp {
monthly
create 0664 root utmp
rotate 1
}

**// ADD BELOW //** :-

# SPAM LOG rotation
/var/log/spam_log {
monthly
create 0777 root root
rotate 1
}

Saturday 11 June 2011

Step to install YUM


[Note] - Please first Download the .tar source & Set it up it is not hard read the read-me file in it.

**Just use this scripts given below ** :--

As root,
cd ~
mkdir setups
cd setups
tar -xvzf yum-2.0.7.tar.gz
cd yum-2.0.7
./configure
make
make install


Thursday 9 June 2011

How To Transfer Account Manually


----//  To transfer an account using shell is as follows  //------ :-

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

1)-Commands to run on the "Old Server".

/scripts/pkgacct (user name)

Change permmissions to 755.

Change owner to nobody.nobody.

move tar file to /usr/local/apache/htdocs

*********************************************************

2)-Commands to run on "New Server".


---------------------------------***************---------------------------------------

Sunday 5 June 2011

Max connection to MySql


**To set Max-connections for mysql just add this following lines :-

-----------------------
max-connections=150

below

#old_passwords=1
---------------------

Saturday 4 June 2011

How to install Mytop


//** To Install Mytop Fire this Command on the Server  **// :--
 
*******************-----------*******************


tar -zxvf mytop-1.4.tar.gz

cd mytop-1.4

perl Makefile.PL

make

make test

make install

*******************----------***********************

*Note :- To Access MyTop Fire is this command on the sever :-

[root@mss ~]#mytop

*******************----------***********************

Thursday 2 June 2011

Path of Httpd for individual user.


< Its so simple just fire this command on server > :-
 
 
****---------------------------------------------****

Path of Individual Httpd Files :-

[root@fs5 /usr/local/apache/conf/sites/

*************----------------------**************

Wednesday 1 June 2011

Server replied 110 can't open SMTP Stream

**[ If you get following kind of Error ]:--

---------
Error display on the screen :-

Connection timed out
Server replied: 110 Can't open SMTP stream.

---------

1>
 
  I found the config for cpanel's SM:-

/usr/local/cpanel/base/3rdparty/squirrelmail/config/config.php

---------

2>

  Just changed:-

$useSendmail = false;

to:-

$useSendmail = true;

[Around line 33]

*Note :-(This will probably get written over with the next cpanel update, but it at least helps get my users sending mail again.

That's it try out this will resolve your problem)

******************************---------******************************