Sky
Version vom 2. April 2019, 20:04 Uhr von Hamatoma (Diskussion | Beiträge) (→Webapplikationen einrichten)
- debian 9 (stretch)
- m2972.contaboserver.net
Installation
adduser wk adduser citmaster adduser sebastian adduser --uid=202 extbup adduser --uid=201 bupsrv hostname sky.infeos.de apt-get install sudo rsync htop gdisk less tmux zip mkdir /media /media/trg /media/src /media/sixpack /var/log/local chmod uog+rwx /var/loc/local
# lokal:mk ssh-copy-id -i ~/.ssh/id_rsa wk@sky # installieren /home/bin # /usr/local/bin/restore/BupRestSky.sh kopieren
RAID erzeugen
# md0 und md1 existieren schon mknod /dev/md2 b 9 2 chmod 0660 /dev/md2 # 2 Partitionen: 32G + Rest gdisk /dev/sdc # 2 Partitionen: 32G + Rest gdisk /dev/sdd mdadm --create /dev/md2 --assume-clean --level=1 --verbose --raid-devices=2 /dev/sdc2 /dev/sdd2 /usr/share/mdadm/mkconf >/etc/mdadm/mdadm.conf
LVM einrichten
apt-get install lvm2 python3 python pvcreate /dev/md2 vgcreate --physicalextentsize 32M sixpack /dev/md2 #lvcreate --size=32M --name=bupdebian sixpack /usr/local/bin/restore/BupRestSky.sh python /usr/local/bin/restore/lvs2all.py lvcreate python /usr/local/bin/restore/lvs2all.py lvcreate | grep lvcreate python /usr/local/bin/restore/lvs2all.py mkdir python /usr/local/bin/restore/lvs2all.py mkdir | grep mkdir python /usr/local/bin/restore/lvs2all.py fstab python /usr/local/bin/restore/lvs2all.py fstab | grep fstab python /usr/local/bin/restore/lvs2all.py mkfs python /usr/local/bin/restore/lvs2all.py mkfs | grep mkfs
NGINX einrichten
apt-get install nginx-full ca-certificates certbot ssl-cert /usr/local/bin/restore/NginxRestSky.sh nxtool make-certs
Eintrag in /etc/nginx/nginx.conf:
## # Logging Settings ## log_format proxyLog '$remote_addr => $http_x_real_ip - $remote_user [$time_local] ' '"$request" $status $body_bytes_sent ' '"$http_referer" "$http_user_agent"';
PHP einrichten
apt-get install nginx php-fpm php-cli php-json php-curl php-imap php-gd php-mysql php-xml \ php-zip php-intl php-mcrypt php-imagick php-mbstring php-memcached memcached php-xdebug
/etc/php/7.0/fpm/php.ini:
max_execution_time = 3600 max_input_time = 3600 memory_limit = 512M post_max_size = 5G upload_max_filesize = 5G opcache.memory_consumption=128 opcache.interned_strings_buffer=8 opcache.revalidate_freq=1 # Neu: sys_temp_dir = "/space/php_temp" upload_tmp_dir = /space/php_temp
DB einrichten
apt-get install redis-server redis-tools php-redis
Mariadb 10.3 statt 10.1
apt-get install software-properties-common dirmngr apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xF1656F24C74CD1D8 add-apt-repository 'deb [arch=amd64,i386,ppc64el] http://mirror.zol.co.zw/mariadb/repo/10.3/debian stretch main' apt-get install mariadb-server mariadb-client
#Beim Upgrade gab es Probleme. Lösung mit: apt-get install --reinstall -o Dpkg::Options::="--force-confmiss" mariadb-server-10.3
Konfiguration Mariadb
/etc/mysql/mysql.cnf
[client] # Default is Latin1, if you need UTF-8 set this (also in server section) default-character-set = utf8 [mysqld] # # * Character sets # # Default is Latin1, if you need UTF-8 set all this (also in client section) # character-set-server = utf8 collation-server = utf8_general_ci character_set_server = utf8 collation_server = utf8_general_ci plugin-load-add = auth_socket.so
Neuinstallation Mariadb:
apt-get remove --purge mariadb-server mariadb-client apt autoremove rm -Rf /usr/share/mysql /etc/mysql /usr/share/mysql systemctl daemon-reload apt-get install mariadb-server mariadb-client apt-get install --reinstall -o Dpkg::Options::="--force-confmiss" mariadb-server-10.3
Webapplikationen einrichten
cp -a /opt/restore/home/www /home ln -s /home/www /srv/www dbtool.py -v3 create-backup-user backup 'SAVE!all' root <root-pw> dbtool.py create-webapp-dbs root <root-passwd>
Cron
crontab -e
*/2 * * * * /usr/local/bin/MvImport 35 0 * * * PYTHONPATH=/usr/share/pyrshell /usr/local/bin/backup_next -q -r backup dayly 35 1 * * 5 PYTHONPATH=/usr/share/pyrshell /usr/local/bin/backup_next -q -r backup weekly 33 4 * * * /usr/bin/sudo -u www-data /srv/www/cloud.infeos.de/occ --all files:scan >/dev/null 2>&1 41 1 * * 5 /usr/local/bin/bup_next -q weekly 33 4 * * * /usr/local/bin/RemoveOccTrash.sh /srv/www/wolke.infeos.de/data -q 43 4 * * * /usr/bin/sudo -u www-data /srv/www/wolke.infeos.de/occ --all files:scan >/dev/null 2>&1 53 4 * * * /usr/bin/sudo -u www-data /srv/www/cloud.connect-develop.de/occ --all files:scan >/dev/null 2>&1