标签:Directadmin

directadmin.conf 丢失解决方案

操作不慎导致 directadmin.conf 丢失,
google了一下看到了directadmin.conf在 /usr/local/directadmin/data/templates/ 存在副本,
随后将/usr/local/directadmin/data/templates/directadmin.conf 内容复制到 /usr/local/directadmin/conf/directadmin.conf 下,稍微修改NS和HOSTNAME即可
重启DA就恢复了。

DirectAdmin modsecurity 解决WordPress后台暴力扫描问题

cd /usr/local/directadmin/custombuild
./build update
./build set modsecurity yes
./build set modsecurity_ruleset comodo
./build modsecurity

vi /usr/local/cwaf/tmp/rules/workdir1/rules


SecAction phase:2,nolog,pass,initcol:ip=%{REMOTE_ADDR},initcol:user=%{REMOTE_ADDR},id:5000134  
<Locationmatch “/wp-login.php”>  
    # Setup brute force detection.  
    # React if block flag has been set.  
    SecRule user:bf_block “@gt 0” “deny,status:401,log,id:5000135,msg:’ip address blocked for 5 minutes, more than 10 login attempts in 3 minutes.'”  
    # Setup tracking. On a successful login, a 302 redirect is performed, a 200 indicates login failed.  
    SecRule RESPONSE_STATUS “^302” “phase:5,t:none,nolog,pass,setvar:ip.bf_counter=0,id:5000136”  
    SecRule RESPONSE_STATUS “^200” “phase:5,chain,t:none,nolog,pass,setvar:ip.bf_counter=+1,deprecatevar:ip.bf_counter=1/180,id:5000137”  
    SecRule ip:bf_counter “@gt 10” “t:none,setvar:user.bf_block=1,expirevar:user.bf_block=300,setvar:ip.bf_counter=0”  
</locationmatch>  
  
SecAction phase:2,nolog,pass,initcol:ip=%{REMOTE_ADDR},initcol:user=%{REMOTE_ADDR},id:5000234  
<Locationmatch “/xmlrpc.php”>  
    # Rate limit requests to xml-rpc  
    SecRule user:bf_block “@gt 0” “deny,status:401,log,id:5000235,msg:’ip address blocked for 5 minutes, more than 10 attempts in 3 minutes.'”  
    # Setup tracking. Whenever it gets a 200 or 405 status code, increase our brute force counter.  
    SecRule RESPONSE_STATUS “^(200|405)” “phase:5,chain,t:none,nolog,pass,setvar:ip.bf_counter=+1,deprecatevar:ip.bf_counter=1/180,id:5000237”  
    SecRule ip:bf_counter “@gt 10” “t:none,setvar:user.bf_block=1,expirevar:user.bf_block=300,setvar:ip.bf_counter=0”  
</Locationmatch>  

DirectAdmin CustomBuild 2.0

升级 Custombuild 2.0 升级

cd /usr/local/directadmin mv custombuild custombuild_1.x wget -O
custombuild.tar.gz
http://files.directadmin.com/services/custombuild/2.0/custombuild.tar.gz
tar xvzf custombuild.tar.gz cd custombuild ./build

大家可以直接进入DA后台插件目录,直接通过连接安装,或者是下载到本地然后上传到DA插件目录里面。 插件下载地址:http://www.custombuild.eu/plugin/custombuild.tar.gz

directadmin:高负载dataskq解决方案

Directadmin发现有几个dataskq进程CPU占用非常高,影响了网站的正常运作。大致了解了下dataskq这个进程是一个动作响应进程,在 /etc/cron.d/directadmin_cron 任务里每分钟都会执行一次
看了日志,dataskq一直检查到named没启动,就一直尝试,导致系统负载过高,机器的named可能在升级中卸载了,修复方法如下:

yum install bind
yum install dbus-libs
yum install dbus
cd /etc/init.d
mv named named.backup
wget http://www.directadmin.com/named
chmod 755 named
/sbin/chkconfig named reset

重新启动named服务:
service named restart

这时候named肯定启动了,启动后就没有这个问题了。

关于dataskq的一些东西,日志在/var/log/directadmin/errortaskq.log
tail -n 100 /var/log/directadmin/errortaskq.log

查看这里http://help.directadmin.com/item.php?id=402

另外webalizer可能也无法启动,原因是找不到libgd.so.2库文件,解决办法如下

echo “/usr/local/lib” >> /etc/ld.so.conf
ldconfig

如果还是存在的,说明没安装gd库

yum install gd

—–

如果不使用自带的DNS解析服务可以关掉named,不提供邮件服务可以关掉dovecot

Directadmin:Option to disable IP check for sessions

Option to disable IP check for sessions


default:
disable_ip_check=0

to enable:
disable_ip_check=1

in the /usr/local/directadmin/conf/directadmin.conf

/etc/init.d/directadmin restart

适用于动态IP客户端的解决方案

DirectAdmin:Capri

目前已经开源
wget -O capri.sh http://localserver.flaxe.eu/Capri-install/capri.sh
chmod +x capri.sh
./capri.sh

DirectAdmin:Disable IP check

禁止 DirectAdmin 对登录 IP 的安全检查,对动态IP用户适用

default:
disable_ip_check=0

to enable:
disable_ip_check=1

in the directadmin.conf (/usr/local/directadmin/conf/directadmin.conf)

service directadmin restart