Friday, March 26, 2010

clamav scan

clamscan -r path ==>>this will gives the all sucees files

clamscan -r path --infected ===>> this will give a infected files

freshclam

clamscan -r -i --move=identfied (dir)

============
If you wish to run clamscan in /home :-

Log into server as root. Issue the command : cd /home
Issue the command : clamscan -i > infectedfiles.txt

After the scan is run the infected files will be listed in infectedfiles.txt.
============

To find out apache down time

locate httpd.pid
[root@server 02]# ll -d /usr/local/apache/logs/httpd.pid
-rw-r--r-- 1 root root 6 Feb 24 14:05 /usr/local/apache/logs/httpd.pid
[root@server 02]#

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


How to find out when apache last restarted

ll /usr/local/apache/logs/httpd.pid

root@a24uall [~]# ll /usr/local/apache/logs/httpd.pid
-rw-r–r– 1 root root 6 Feb 25 07:01 /usr/local/apache/logs/httpd.pid
root@a24all [~]#

Also

root@a24uall [~]# grep “SIGHUP received” /usr/local/apache/logs/error_log

To set no. of emails for particular domains in hour

ll /var/cpanel/maxemailsperdomain/
create the domainname
then enter the number
i.e vreate domain.com
566

mail comand

mail -v email id -s subjeact
body

Unable to add IP in WHM

error :IP is already added.

Solution:
The issue is due to the fact that the ip "192.200.50.51" is already present in the file /etc/ips and we have removed the ip from the file and try to add once again.You can use the following commands

================
1. vi /etc/ips and remove the IP
2. /etc/init.d/ipaliases reload
3. /scripts/rebuildippool
===============

http error while sending mail via horde in Internet Explorer

till the same error.. heres the browser message


The website cannot display the page
HTTP 500
Most likely causes:
•The website is under maintenance.
•The website has a programming error.

What you can try:
Refresh the page.

Go back to the previous page.

More information

This error (HTTP 500 Internal Server Error) means that the website you are visiting had a server problem which prevented the webpage from displaying.

For more information about HTTP errors, see Help.


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

Solution:

Can you please disable the following option in IE and try to recreate the error and let me know what you get?

From 'Tools' menu --> 'Internet Options' and select 'Advanced' tab.

Under 'Settings' section, please disable (uncheck) 'Show friendly HTTP error messages'

Now restart your browser and check it again. If the issue persists, please provide me with the steps to recreate the issue along with the error now IE is showing so that I can check this issue at my end.

Please note that the steps I have provided is for checking what exact error the server is returning while sending out emails. Currently IE is displaying a friendly error message. It would help us in troubleshooting this issue faster.

/tmp read only

You can fix it without rebooting the server.

Here's how:

root@orchard [~]# umount /tmp
umount: /tmp: device is busy
umount: /tmp: device is busy
root@orchard [~]# umount -l /tmp (umount -l forces an umount, even if
it's busy)
root@orchard [~]# df -
root@orchard [~]# fsck -yf /dev/sda2 (y = answer yes to everything)
fsck 1.39 (29-May-2006)
e2fsck 1.39 (29-May-2006)
/tmp1: recovering journal
Clearing orphaned inode 64 (uid=100, gid=101, mode=0100600, size=0)
Clearing orphaned inode 37 (uid=100, gid=101, mode=0100600, size=0)
Clearing orphaned inode 36 (uid=100, gid=101, mode=0100600, size=0)
Clearing orphaned inode 35 (uid=100, gid=101, mode=0100600, size=0)
Clearing orphaned inode 34 (uid=100, gid=101, mode=0100600, size=0)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Entry 'eaccelerator-3502.67023312' in /eaccelerator/6/0 (131177) has
deleted/unused inode 133882. Clear? yes

Pass 3: Checking directory connectivity
/lost+found not found. Create? yes

Pass 4: Checking reference counts
Pass 5: Checking group summary information

/tmp1: ***** FILE SYSTEM WAS MODIFIED *****
/tmp1: 3183/524288 files (1.8% non-contiguous), 75363/524120 blocks
root@orchard [~]# fsck -yf /dev/sda2 (run it a second time to double check)
fsck 1.39 (29-May-2006)
e2fsck 1.39 (29-May-2006)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 3A: Optimizing directories
Pass 4: Checking reference counts
Pass 5: Checking group summary information

/tmp1: ***** FILE SYSTEM WAS MODIFIED *****
/tmp1: 3183/524288 files (1.8% non-contiguous), 75335/524120 blocks
root@orchard [~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda5 223G 35G 176G 17% /
/dev/sda1 190M 22M 159M 13% /boot
/dev/sdb1 231G 116G 104G 53% /backup
tmpfs 1014M 0 1014M 0% /dev/shm
root@orchard [~]# mount /dev/sda2 /tmp
root@orchard [~]# touch /tmp/hello
root@orchard [~]# all fine!

Allow access for all users to a folder in a server

1.All users on the server had access to the directory /home/shared2/ , Now, They do not have access anymore. I don't know why, Please - Add permissions to ALL users on NETMPIRE server to access /home/shared2/
error:
/bin/ls: .: Permission denied

==========================
Solution:
First create a group and add all the usernames under that group
and
set the permission of the specified folder to 2755
2755: for security reasons
===========================

zip error

checkdir error: cannot create icons

solution:
~/public_html/images/icons.zip

check the permission of images
change it as 777

cpanel downloads empty mysql backup

Empty MySQL Backup – 20 bytes
Thursday, October 29th, 2009

If you login to cpanel, download a mysql backup and the backup is empty, try this:

Go to your home directory. You can use cpanel’s File Manager. Or you can access your home directory through ftp. Find a file called my.cnf. Rename it to my.cnf.backup.

What will happen? You probably changed your cpanel password. The new password was not updated in my.cnf. By deleting this file, the next time you login to cpanel, it will have to recreate it with your new password. And that will solve your mysql backup problem.

The mysql backup process uses that file to access the mysql databases. If the password is incorrect, the cpanel process will be denied access to those databases. You will not see any error, because it’s not logged in your cpanel interface. But you will get an empty database backup instead.

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

solution:

If the file is not present there then create a file and put cpanel username and passwd there
file is created under
/home/username
filename .my.cnf

Create a domain name via konsole

/scripts/wwwacct