Archive for January, 2013

更改 Exim 的发送IP

Thursday, January 31st, 2013

Anyone running a shared hosting server is probably now accustomed to dealing with constant complaints about blacklisting. It’s exim’s default setup on a cPanel server to use the shared IP of the server to send email, which means that all your clients on one server are sending out email on the same IP.  All it takes is for one spammer to send out a mailing list or one customer to get hacked and run a Darkmailer script, and suddenly everyone on your server seems to be complaining about getting their mail bounced.

You can change the server’s IP address for sending email. Assuming you already have an IP set up on your server with a valid PTR, you probably already saw on the cPanel forums or some other location that you can simply change the interface lines in your /etc/exim.conf file and restart exim: (more…)

cPanel安装Maldet杀毒

Thursday, January 31st, 2013

安装Maldet过程:


wget http://www.rfxn.com/downloads/maldetect-current.tar.gz
tar -xzvf maldetect-current.tar.gz
cd maldetect-*
sh install.sh

(more…)

cpanel的ClamAV用法

Thursday, January 24th, 2013

1.安装ClamAV
WHM > Cpanel Install Plugin > Enable Clamav Connector

DA面板的:

yum -y install epel-release
yum install –y clamav clamav-update

2.更新病毒数据库
freshclam
3.运行扫毒及显示感染文件
clamscan -r -i /home
4.删除感染文件及邮件
clamscan -r -i --remove /home

或者

clamscan –ri /home -l clamscan.log --remove

clamscan用法
$ clamscan myfile
$ clamscan -r -i /home
$ clamscan -r -i –exclude-dir=^/sys\|^/proc\|^/dev /

If you would like clamscan to remove the infected file use the –remove option in the command.

centos 5.9及基于xen pv-grub内核

Saturday, January 19th, 2013

最主要参考教程
http://www.vr.org/kb/6104/CentOS-58-CSF-and-xen-pv-grub-based-kernel.html
http://library.linode.com/custom-instances/pv-grub-custom-compiled-kernel
Xen VPS目前在用这个Linux 内核版本: 2.6.18-348.el5xen
升级到这个内核之后,cpanel的quotas,disk used显示正常了

ip对应网关

Friday, January 18th, 2013
CIDR Netmask IP Addresses
/13         255.248.0.0         524288
/14         255.252.0.0         262144
/15 255.254.0.0         131072
/16 255.255.0.0         65536
/17 255.255.128.0     32768
/18 255.255.192.0       16384
/19 255.255.224.0       8192
/20 255.255.240.0     4096
/21 255.255.248.0         2048
/22 255.255.252.0       1024
/23 255.255.254.0     512
/24 255.255.255.0       256
/25 255.255.255.128                128
/26 255.255.255.192                64
/27 255.255.255.224                32
/28 255.255.255.240                16
/29 255.255.255.248                8
/30 255.255.255.252                4
/31 255.255.255.254                2
/32 255.255.255.255                1

可用ip数,为(IP Addresses-3)

cpanel的“文件管理器”里面文件不能压缩成.zip格式

Wednesday, January 9th, 2013

解决办法:
在whm里面,
Software » Install an RPM
安装下zip

whm里面的Disk Used不能更新数据

Tuesday, January 8th, 2013

vi /etc/fstab   修改成下面的
LABEL=/ /       ext3    usrjquota=quota.user,jqfmt=vfsv0                0 0
LABEL=/boot             /boot                   ext3    defaults        0 0
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
LABEL=SWAP-hda2         swap                    swap    defaults        0 0
/usr/tmpDSK             /tmp                    ext3    defaults,usrquota,noauto        0 0

然后执行
/scripts/fixquotas

cpanel的scripts命令行

Sunday, January 6th, 2013

Using one many automation scripts available in the /scripts folder, allows you to quickly configure, troubleshoot and execute powerful commands on your cPanel & WHM server by using one of the many automation scripts available in the scripts folder. Here are some of the more popular command line scripts available via cPanel & WHM:

easyapache
This powerful script allows you to compile, upgrade, and re-install Apache, PHP, and various modules. EasyApache makes it simple to run multiple PHP versions on your server and compile Apache and PHP modules.
phpextensionmgr
The phpextensionmgr script allows you to control your server’s PHP extensions. You can install, uninstall, view the status of, and list the available extensions.
*up
The *up script is used to manually update the various services on your cPanel & WHM server using various forms such as mysqlup, phpup and eximup. Although you can configure your services to update with cPanel, *up can be used for finer control. (more…)

强制还原备份

Sunday, January 6th, 2013

/scripts/restorepkg –force username
即使存在相同的用户名的帐号,也会被已有备份覆盖

SSH Tricks In Exim To Remove Email Queue

Saturday, January 5th, 2013

SSH Tricks In Exim To Remove Email Queue
[1] Removing Bad Mail

for i in `exiqgrep -i -f nobody`; do exim -Mrm $i; done >> Removes Nobody Mail

for i in `exiqgrep -i -o 259200`; do exim -Mrm $i; done >> Removes Mail Older than 3 Days

for i in `exiqgrep -i -f “^<>$”`; do exim -Mrm $i; done >> Removes Mail with Weird Characters (Spam)

[2] Delete Mail by a Domain

for i in `exiqgrep -i -f domain.com`; do exim -Mrm $i; done

[3] Delete Mail for a Domain

for i in `exiqgrep -i -r domain.com`; do exim -Mrm $i; done

[4] Remove Whole Mail Queue

for i in `exiqgrep -i -f `; do exim -Mrm $i; done

[5] Run Mail Queue

runq -qqff&