make drupal/drush configuration
Drupal php:
yum install -y ea-php56-php-mcrypt.x86_64 cpanel-php56-PEAR-Command-Packaging.noarch ea-php56-php-mbstring.x86_64 ea-php56-php-iconv.x86_64
pecl install uploadprogress
You should add "extension=uploadprogress.so" to php.ini
You should change allow_url_open to: allow_url_open=1
Drupal Ruby:
/scripts/installruby
gem install compass compass-rgbapng gems sass
Drupal Drush:
cd /opt/ && php -r "readfile('https://s3.amazonaws.com/files.drush.org/drush.phar');" > drush
#make installation test
php drush core-status
chmod +x drush && mv -v drush /usr/local/bin/
#login under user account and make
drush init
install csf => CentOS, Debian, AlmaLinux, etc.
1. Step one => requested packages:
Debian or Debian-based OS (like Ubuntu, etc.):
apt update;apt upgrade -y;apt install -y wget libio-socket-ssl-perl git perl iptables libnet-libidn-perl libcrypt-ssleay-perl ipset libio-socket-inet6-perl libsocket6-perl sendmail dnsutils unzip zip ncdu mc lynx
Centos or other Redhat-based OS (Almalinux, etc.)
yum update -y;yum install -y epel-release;yum install -y perl-Crypt-SSLeay perl-Net-SSLeay bind-utils perl-libwww-perl.noarch perl-LWP-Protocol-https.noarch perl-GDGraph nano wget mc lsof nload tcpdump monit rsync zip unzip ipset langpacks-en glibc-all-langpacks perl-Math-BigInt-FastCalc iptables lynx
2. Step two => installing CSF itself
cd /usr/src
wget https://download.configserver.com/csf.tgz
tar -xzf csf.tgz
cd csf
sh install.sh
==
perl /usr/local/csf/bin/csftest.pl
==
perl /etc/csf/csftest.pl
tune centos7 before use mysql (mysqld: Can’t open file: ‘.session.frm’ (errno: 24) )
1. to /etc/sysctl.conf need to add
fs.file-max = 100000
2. to /etc/security/limits.conf need to add
* soft nproc 65535
* hard nproc 65535
* soft nofile 65535
* hard nofile 65535
3. run #sysctl -p
4. to /usr/lib/systemd/system/mariadb.service need to add
LimitNOFILE=65535
LimitNPROC=65535
under [Service] section
5. systemctl daemon-reload
6. service mariadb restart
7. test it:
for mysql su - mysql -c 'ulimit -aHS' -s '/bin/bash'
mysqladmin variables| grep open_files_limit
8. now you can update the table_open_cache and open_files_limit in my.cnf and restart mariadb again if need.
file /scripts/do.backup.sh
cron:
01 00 * * * /bin/sh /scripts/do.backup.sh
script:
#!/bin/bash
echo "[`date`] => Backup has been started" >> /var/log/backup.log
echo "---------->>>>>> Started: `date` < <<<<<----------------"
rm -Rf /var/www/local_copy/*
df -h
rm -f /root/grouplist.file
rm -f /root/dblist.file
## +locations
echo "---------->>>>>> + locations < <<<<<----------------"
mkdir -p /var/www/local_copy
mkdir -p /var/www/local_copy/for_backups
mkdir -p /var/www/local_copy/`date +%d.%m.%Y`
mkdir -p /var/www/local_copy/`date +%d.%m.%Y`/mysql
mkdir -p /var/www/local_copy/`date +%d.%m.%Y`/users
mkdir -p /var/www/local_copy/`date +%d.%m.%Y`/emails
## +mysqldump
echo "---------->>>>>> + mysqldump < <<<<<----------------"
mysql -e "SHOW DATABASES;" | tr -d "| " | grep -v Database|grep -v "performance_schema\|mysql\|information_schema" >> /root/dblist.file
for i in `cat /root/dblist.file`;do mysqldump --single-transaction -f --databases "$i" >> /var/www/local_copy/for_backups/"$i".sql && zip -r /var/www/local_copy/`date +%d.%m.%Y`/mysql/"$i".zip /var/www/local_copy/for_backups/"$i".sql && rm -f /var/www/local_copy/for_backups/"$i".sql;done
echo "---------->>>>>> + /system < <<<<<----------------"
zip -rq --symlinks /var/www/local_copy/`date +%d.%m.%Y`/etc.zip /etc
zip -rq --symlinks /var/www/local_copy/`date +%d.%m.%Y`/mgr5.zip /usr/local/mgr5
zip -rq --symlinks /var/www/local_copy/`date +%d.%m.%Y`/cron.zip /var/spool/cron
echo "---------->>>>>> + move system files < <<<<<----------------"
rsync -a -e "ssh -i /root/.ssh/key_name" /var/www/local_copy/`date +%d.%m.%Y` key_name@server_ip:/home/key_name/backups/
echo "---------->>>>>> + users < <<<<<----------------"
ls /var/www/|grep -v "php-\|html\|httpd-logs\|httpd-cert\|cgi-bin\|webalizer\|local_copy\|grandmother"|sed '1d' >> /root/grouplist.file
for i in `cat /root/grouplist.file`;do zip -rq --symlinks /var/www/local_copy/`date +%d.%m.%Y`/"$i".zip /var/www/"$i" && rsync -a -e "ssh -i /root/.ssh/key_name" /var/www/local_copy/`date +%d.%m.%Y`/"$i".zip key_name@server_ip:/home/key_name/backups/`date +%d.%m.%Y`/users/ && rm -f /var/www/local_copy/`date +%d.%m.%Y`/"$i".zip;done
rm -Rf /var/www/local_copy/`date +%d.%m.%Y`
rm -f /root/dblist.file
df -h
echo "[`date`] ==> Backup has been completed" >> /var/log/backup.log
cd /var/www/httpd-logs/ && ls -alh |grep G|awk {'print $9'}|xargs rm -fv
echo "---------->>>>>>Backups Completed: `date` < <<<<<----------------"
make key and it to remote server for backups
mkdir -pv ~/.ssh;ssh-keygen -t rsa -b 2048 -C "$(whoami)@$(hostname)-$(date -I)" -f ~/.ssh/"$(whoami)"
chmod 600 ~/.ssh/"$(whoami)".pub
ssh-copy-id -i ~/.ssh/"$(whoami)".pub user_name@server_ip
ssh -i ~/.ssh/"$(whoami)" user_name@server_ip
or manually add it to host under user:
mkdir -pv /home/key_name/.ssh/ && nano /home/key_name/.ssh/authorized_keys && chown -Rv key_name:key_name /home/key_name/.ssh
Move accounts between nodes (IspManager Business)
install mariadb in ubuntu
1 apt-get update; apt-get upgrade
2 apt-get install -y mariadb-server htop rsync mc nano vim
3 mysql_secure_installation
4 echo "update user set plugin='' where User='root'; flush privileges;" | mysql -u root -p mysql
5 apt-get install -y phpmyadmin
6 nano /etc/mysql/mariadb.conf.d/50-server.cnf (need to comment line bind-address)
7 /etc/init.d/mysql restart