Total Pageviews

Sunday, January 18, 2009

tmp showing 100% even after removing file!!!

root@server [/tmp]# lsof +aL1 /tmp | awk '{print $2}' | xargs kill -9

Number of connection to port 80 from different IP's

netstat -plan | grep :80 | awk '{print $5}' | cut -d: -f 1 | sort | uniq -c | sort -n

Exim commands

1) To delete mails in the mail queue older than a day
exiqgrep -o 86400 -i | xargs exim -Mrm

2)exim -bp|grep $name Will show the mail in queue for $name
exim -Mvh $MSGID View message header
exim -Mvb $MSGID View message body
exim -M $MSGID Force delivery of message
exim -v -M $MSGID View the transact of message

3)Force delivery of one message
exim -M email-id

4)Force another queue run
exim -qf

5)Force another queue run and attempt to flush the frozen message
exim -qff

6)View the log for the message
exim -Mvl messageID

7)View the body of the message
exim -Mvb messageID

8)View the header of the message
exim -Mvh messageID

8)Remove message without sending any error message
exim -Mrm messageID

9)Giveup and fail message to bounce the message to the Sender
exim -Mg messageID

10)How much mail in the queue?
exim -bpr | grep "<" | wc -l


11)How many Frozen mails in the queue
exim -bpr | grep frozen | wc -l


12)Deleteing Frozen Messages
exim -bpr | grep frozen | awk {'print $3'} | xargs exim -Mrm


13)To find out, how many messages are there in the mail queue:
exim -bpc

14)To check the mails in the queue:
exim -bp

15)To force exim update:
/scripts/eximup --force

Saturday, January 17, 2009

To check whether ASP is avaliabe in server

/usr/local/apache/bin/httpd -l |grep mod_mono

To change Maximum emails perhour for a domain

1) Check [root@server ~]#vi /var/cpanel/maxemailsperhour to increase the value

2)[root@server ~]# vi /var/cpanel/maxemails
# If you update this file you must run /scripts/build_maxemails_config
domain.com=500
site.net=1000

3) To check the change
[root@server ~]#cat /var/cpanel/maxemailsperdomain/domain.com
500

Php info page not showing changes??

1)Copy /usr/local/cpanel/cgi-sys/php5.cgi to /home/username/ public_html/cgi-bin

2)Add the below given script

root [/home/username/public_html/cgi-bin]# vi phpini.cgi
#!/bin/sh
export PHPRC=/home/username/public_html
exec /home/username/public_html/cgi-bin/php5.cgi

3)And added a php.ini in the location (/home/username/public_html)

4)In the .htaccess put the following.

AddHandler php-cgi .php
Action php-cgi /cgi-bin/phpini.cgi

5) Permission of phpini.cgi should be 755

Block IP using IP tables

iptables -A INPUT -s IP -j DROP
iptables -A OUTPUT -d IP -j DROP

Php Suexec

To check whether php suexec is enabled in the server

/usr/local/cpanel/bin/rebuild_phpconf --current

Script to change premission of files and folders

To change the permission of files to 644
find /home/$i/public_html -type f -exec chmod 644 '{}' \;

To change the permission of folders to 755
find /home/$i/public_html -type d -exec chmod 755 '{}' \;

Outlook Express

Steps to configure Outlook express

1) Go to the Tools menu and select Accounts.
2) In the Internet Accounts window, click the Add button and select the Mail option.
3) Enter your name as you would like it to appear on your email in Display name: field.
4) Click the Next button.
5) Fill in E-mail address.
6) Click the Next button.
7) For Incoming mail (POP3, IMAP, or HTTP) server put your e-mail server(mail.DOMAIN.COM)
8) Click the Next button.
9) Enter the Account name: (test@DOMAIN.COM)
10) Enter the Password which corresponds to this account.
11) Do NOT select Log on using Secure Password Authentication (SPA).
12) Click the Next button.
13) Click the Finish button.
14) In the Internet Accounts window, click the Mail tab, then double-click your account name, this will open the properties window.
15) In the Account Properties window, click the Servers tab.
16) Under Outgoing Mail Server, check next to My server requires authentication.
17) Click the Advanced tab, disable the option Leave a copy of message in the server.
18)Then click apply and then Ok.

Linux

Hi!!! :)