apt install wget gcc g++ make flex bison openssl libssl-dev \

perl perl-base perl-modules libperl-dev libperl4-corelibs-perl \

libwww-perl libaio1 libaio-dev zlib1g zlib1g-dev libcap-dev cron \

bzip2 zip automake autoconf libtool cmake pkg-config python \

libdb-dev libsasl2-dev libncurses5 libncurses5-dev libsystemd-dev \

bind9 dnsutils quota patch logrotate rsyslog libc6-dev libexpat1-dev \

libcrypt-openssl-rsa-perl curl libnuma-dev libnuma1

bash <(curl -Ss https://www.directadmin.com/setup.sh) auto

//require open port 80 & 443
cd /usr/local/directadmin/custombuild
./build update
./build letsencrypt
/usr/local/directadmin/scripts/letsencrypt.sh request_single v3.shopcode.org 4096
/usr/local/directadmin/directadmin set ssl_redirect_host v3.shopcode.org

cd /usr/local/directadmin/custombuild
./build update
./build set php1_release 7.4
./build set php2_release 8.0
./build set php1_mode php-fpm
./build set php2_mode php-fpm
./build set opcache yes
./build opcache
./build set webserver nginx_apache
./build nginx_apache
./build rewrite_confs
echo "action=rewrite&value=nginx" >> /usr/local/directadmin/data/task.queue
echo "action=rewrite&value=nginx" >> /usr/local/directadmin/dataskq
/usr/local/directadmin/directadmin config-set autoupdate 1
cd /usr/local/directadmin
echo "action=directadmin&value=restart" >> data/task.queue; ./dataskq d2000

./build clean
./build suphp
./build roundcube
./build squirrelmail
./build phpmyadmin
./build set ioncube yes
./build ioncube
./build rewrite_confs

cd /usr/local/directadmin/custombuild/
./build all d


cd /usr/local/directadmin/custombuild
./build update
./build set redis yes
./build redis
./build set_php redis yes
./build php_redis


//CONGIG HAND
max_username_length=14
vim /usr/local/directadmin/conf/directadmin.conf
shift + paste
#time
apt-get install ntp ntpdate 
apt-get install -y ntpdate asia.pool.ntp.org
rm -f /etc/localtime
ln -s /usr/share/zoneinfo/Asia/Ho_Chi_Minh /etc/localtime



#email server

cd /usr/local/directadmin
./directadmin set one_click_webmail_login 1
cd /usr/local/directadmin/
./directadmin set dkim 1
service directadmin restart
cd custombuild
./build update
./build dovecot_conf
./build exim_conf
./build roundcube

       DNS: v=spf1 mx a -all
       Bat DKIM is enabled tren DA and update cloudflare DNS

ERROR
cd /usr/local/directadmin/
./directadmin set dkim 1
cd custombuild/
./build update 
./build exim 
./build eximconf

//CSF_ALL ADD
//
wget http://statis.org/csf/vf/csf-all -O /usr/bin/csf-all
chmod 700 /usr/bin/csf-all
sed -i -e 's/\r$//' /usr/bin/csf-all
#using my.cnf php.ini, httpinclude

csf-all config default
csf-all config 2g
csf-all config 4g
csf-all config 8g


//VOLUME ADD

wget http://statis.org/csf/vf/volume -O /usr/bin/volume
chmod 700 /usr/bin/volume
sed -i -e 's/\r$//' /usr/bin/volume

//no need

cd /usr/local/directadmin/custombuild
mkdir -p mysql
cd mysql
wget https://www.static.upload-cdn.com/wp-content/directadmin/mysql/MySQL-client-5.5.41-1.linux2.6.x86_64.rpm
wget https://www.static.upload-cdn.com/wp-content/directadmin/mysql/MySQL-devel-5.5.41-1.linux2.6.x86_64.rpm
wget https://www.static.upload-cdn.com/wp-content/directadmin/mysql/MySQL-server-5.5.41-1.linux2.6.x86_64.rpm
wget https://www.static.upload-cdn.com/wp-content/directadmin/mysql/MySQL-shared-5.5.41-1.linux2.6.x86_64.rpm
rpm -e --noscripts `rpm -qa | grep MariaDB`
cd mysql
rpm -ivh MySQL*5.5.41*.rpm

alien -k MySQL*5.5.41*.rpm

sudo dpkg -i mysql*5.5.41*.deb


perl -pi -e 's/mysqld=ON/mysqld=OFF/' /usr/local/directadmin/data/admin/services.status
service mysqld stop
mv /var/lib/mysql /var/lib/mysql.old
cd /usr/local/directadmin/custombuild
./build set mysql 5.7
./build set mysql_inst mysql
./build set mysql_backup no
./build update
./build mysql

IMAGE SERVER MAIL: 

perl -pi -e 's/mysqld=ON/mysqld=OFF/' /usr/local/directadmin/data/admin/services.status
service mysqld stop
mv /var/lib/mysql/ /var/lib/mysql_old
touch /var/lib/mysql/mysql.sock
chmod 710 /var/lib/mysql/mysql.sock
ln -s /var/lib/mysql_old/mysql.sock /var/lib/mysql/mysql.sock

cd /usr/local/directadmin/custombuild
./build set mysql 5.7
./build set mysql_inst mysql
./build set mysql_backup no
./build update
./build mysql
./build update_versions

Inbound Rules ( open port 25, 465, 587, ALL de nhan email

Them nhieu email

https://www.knownhost.com/kb/enabling-dkim-with-directadmin/

/usr/local/directadmin/directadmin set dkim 2 restart

cd /usr/local/directadmin/custombuild

./build update

./build exim

./build eximconf

LOI MYSQL CAN RESET LAIJ FILE 

file nay hong: /tmp/mysql.sock

ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock

mysql mysql -e "UPDATE mysql.user SET password=PASSWORD('da_roundcube') WHERE user='root'; FLUSH PRIVILEGES;"

task.queue: echo "action=rewrite&value=quota" >> /usr/local/directadmin/data/task.queue

)echo "action=rewrite&value=dkim" >> /usr/local/directadmin/data/task.queue

Install Directadmin in Debian 10

Install Directadmin in Debian 10  

 

How to backup SQL with CustomBuild
Before any changes, or for regular intervals, you might want to make backups of your database, which are not specific to the normal DirectAdmin User backup system. This guide will explain how to backup the .sql files on their own using CustomBuild.

cd /usr/local/directadmin/custombuild
./build set mysql_backup yes
./build mysql_backup
If you want to prevent future calls to ./build mysql_backup from overwriting these files, rename the backup folder

mv mysql_backups mysql_backups.`date +%F`
Note that updating MySQL, with mysql_backup=yes set in the options.conf will re-dump the database to the mysql_backups directory.

Note: These .sql files contain the "DROP DATABASE" and "CREATE DATABASE" commands, unlike the .sql files in the DA User backups, so they cannot be easily interchanged.

Backups have two configured options in options.conf file:

mysql_backup_gzip=no/yes , if you want saved dumps to be gzipped (sql.gz)
mysql_backup_dir=/usr/local/directadmin/custombuild/mysql_backups , if you want backups to be done to another directory
How to restore SQL with CustomBuild
If disaster hits, and you need to restore these .sql files, once MySQL is up and running and the da_admin user/pass is working correctly, you can run:

cd /usr/local/directadmin/custombuild/mysql_backups
wget http://files1.directadmin.com/services/all/mysql/restore_sql_files.sh
chmod 755 restore_sql_files.sh
./restore_sql_files.sh
which restores all User databases.

If you also need to restore the system mysql.* tables (usually avoid doing this unless you've lost all of your MySQL user/passwords), then you'd call the script like so:

./restore_sql_files.sh with_mysql
rm -rvf /var/lib/mysql/ib_logfile*
touch /var/lib/mysql/mysql.sock
touch /var/lib/mysql/mysql.pid
chown -R mysql:mysql /var/lib/mysql
systemctl restart mysql

./build set mysql 5.6
./build set mysql_inst yes
./build mysql

./build set mysql 5.7
./build mysql
# confirm mysqld is running.

./build php n
s /var/lib/mysql/mysql.sock /tmp/mysql.sock
add: vi /etc/my.cnf socket=/tmp/mysql.sock
add: /usr/local/directadmin/conf/mysql.conf


/usr/local/directadmin/conf/mysql.conf
cd /usr/local/directadmin/custombuild
./build set mysql 5.7
./build set mysql mysql_inst 
./build set mysql_backup no
./build update
./build mysql
mkdir /var/lib/mysql
chown mysql:mysql /var/lib/mysql/
chmod 750 /var/lib/mysql/
cd /usr/local/directadmin/scripts
./mysql.sh

You create them.

It should look like this:

./mysql.sh password da_admin password

Replace password with whatever password you want.

Then put that password in /usr/local/directadmin/conf/mysql.conf when you are done.

In /usr/local/directadmin/conf/mysql.conf

user=da_admin
pass=password

Restart directadmin after you are done.

When you are done you also will need to recompile php with custombuild.

cd /usr/local/directadmin/custombuild
./build php n

2024

bash <(curl -LSs https://download.directadmin.com/setup.sh || curl -LSs https://download-alt.directadmin.com/setup.sh) 'Provided license key should go here'

SSH LOGIN

vi /etc/ssh/sshd_config

PermitRootLogin yes
RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile  

/content pub key/

~/.ssh/authorized_keys

PasswordAuthentication no
service sshd restart
chmod g-w /home/$USER
chmod 700 /home/$USER/.ssh
chmod 600 /home/$USER/.ssh/authorized_keys

chmod g-w ~/
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys