Tag Archives: directadmin

Starting httpd: httpd: Syntax error on line 50 of /etc/httpd/conf/httpd.conf

If you can’t start directadmin on your Centos server:

Starting httpd: httpd: Syntax error on line 50 of /etc/httpd/conf/httpd.conf: Syntax error on line 1 of /etc/httpd/conf/extra/httpd-phpmodules.conf

Fix:

cd /usr/local/directadmin/custombuild/
./build apache
./build mod_ruid2
./build php n
./build rewrite_confs

/etc/init.d/httpd restart

directadmin – create automaticaly all mysql database daily backup

Its useful if you are directadmin user and want to have your database copies and save them on the same hosting account as your website.

#!/bin/bash
#Author: Vitalijus Ryzakovas - www.balticservers.com

current=$(date +%F)

if [ -d /home/user/databasebackup ]; then
delete=$(ls -r /home/user/databasebackup | tail -n +7 )
/bin/mkdir /home/user/databasebackup/$current
/usr/local/mysql/bin/mysqldump -u user -ppassword --all-databases > /home/user/databasebackup/$current/user_alldb.sql
[ -z "$delete" ] || rm -rf /home/user/databasebackup/$delete
fi

Then you need create cronjob and run it everyday.

directadmin install Zend Optimizer/Guard, and/or Ioncube

For Zend, type:
cd /usr/local/directadmin/custombuild
./build set zend yes
./build zend

after changing php versions, it’s recommended you install zend again.
Note that Zend Guard is the new name for Zend Optimizer, and is used for newer versions of php. Custombuild will install the correct one for your system.

For Ioncube, type:
cd /usr/local/directadmin/custombuild
./build set ioncube yes
./build ioncube

fail2ban CentOS DirectAdmin

yum install fail2ban
vi /etc/fail2ban/filter.d/dovecot-pop3imap.conf

[Definition]
failregex = dovecot: auth-worker\(default\): sql\(.*,\): unknown user
dovecot: (pop3|imap)-login: Aborted login \(.*\): .*, \[\]
dovecot: (pop3|imap)-login: Disconnected \(auth failed, .*\): .*, \[\]
dovecot: auth\(default\): passdb\(.*,\)\: Attempted login with password having illegal chars
dovecot: (pop3|imap)-login: Disconnected \(auth failed, .*\): .*, \[\]
dovecot: (pop3|imap)-login: Aborted login: .*, \[\]
ignoreregex =

vi /etc/fail2ban/jail.conf
[dovecot-pop3imap]
enabled = true
filter = dovecot-pop3imap
action = iptables-multiport[name=dovecot-pop3imap, port=”pop3,pop3s,imap,imaps”, protocol=tcp]
sendmail-whois[name=dovecot-pop3imap, dest=root, [email protected]]
logpath = /var/log/maillog
maxretry = 20
findtime = 1200
bantime = 1200

service fail2ban start

chkconfig fail2ban on
service fail2ban status

Install Directadmin on Centos OS

directadmin pre-install:

yum install wget screen gcc gcc-c++ flex bison make bind bind-libs bind-utils openssl openssl-devel perl quota libaio libcom_err-devel libcurl-devel gd zlib-devel libcap-devel  bzip2 db4-devel cyrus-sasl-devel perl-ExtUtils-Embed autoconf automake libtool

run screen and install:

screen

wget http://www.directadmin.com/setup.sh && chmod 755 setup.sh

begin directadmin installation: ./setup.sh