Скрипт установки для Debian 8

Описание

Автоатическая установка и обновление зависимых пакетов

Автоматическая устанока и настройка серверов GIT, PHP 5.6, PHP-FPM, Nginx, Redis, MySQL (mariadb), RabbitMQ, Exim4

Автоматическое конфигурирование пакетов

Установка автоматического бекапа БД MySQL (https://github.com/Mirocow/mysql_utils.git)

Устанока скрипта для создания сайта (https://github.com/Mirocow/site-create)

Установка

# nano debian-install.sh # bash ./debian-install.sh

В debian-install.sh вставляем ниже следующий текст и нащимаем Ctrl-x, затем y (сохраняем и выходим)

#!/bin/sh distrib="jessie" # Maria BD mysql="mariadb-server mariadb-client mariadb-common" # Percona #mysql="percona-server-server-5.7 percona-client-5.7 percona-common-5.7 percona-toolkit" # === DO NOT EDIT BELOW THIS LINE === echo -e "## Automatic installation servers apps ##" echo " deb http://ftp.pl.debian.org/debian ${distrib} main contrib deb-src http://ftp.pl.debian.org/debian ${distrib} main contrib deb http://ftp.debian.org/debian/ ${distrib}-updates main contrib deb-src http://ftp.debian.org/debian/ ${distrib}-updates main contrib deb http://security.debian.org/ ${distrib}/updates main contrib deb-src http://security.debian.org/ ${distrib}/updates main contrib # erlyvideo.org #deb http://debian.erlyvideo.org binary/ # php-fpm dotdeb deb http://packages.dotdeb.org ${distrib} all deb-src http://packages.dotdeb.org ${distrib} all # nginx deb http://nginx.org/packages/debian ${distrib} nginx deb-src http://nginx.org/packages/debian ${distrib} nginx # Erlang deb http://packages.erlang-solutions.com/debian ${distrib} contrib # RabbitMq deb http://www.rabbitmq.com/debian/ testing main # Percona deb http://repo.percona.com/apt ${distrib} testing deb-src http://repo.percona.com/apt ${distrib} testing " > /etc/apt/sources.list wget -q http://www.dotdeb.org/dotdeb.gpg -O- | apt-key add - wget -q http://nginx.org/keys/nginx_signing.key -O- | apt-key add - wget -q http://packages.erlang-solutions.com/debian/erlang_solutions.asc -O- | apt-key add - wget -q https://www.rabbitmq.com/rabbitmq-signing-key-public.asc -O- | apt-key add - echo -e "## Update OS ##" sleep 1 apt-get update && apt-get upgrade -y echo -e "## Install my app list ##" sleep 1 apt-get install apt apt-utils chkconfig mc htop git mercurial checkinstall iptraf jnettop iftop bash-completion bzip2 sudo nano -y echo -e "## Install PHP-FPM ##" sleep 1 apt-get install -u -t stable php5 php5-dev php5-sqlite php5-mcrypt php5-xsl php5-cli php5-common php5-mysql php5-gd php5-fpm \ php5-cgi php-pear php5-curl php5-xcache php5-redis -y echo "cgi.fix_pathinfo = 0" >> /etc/php5/fpm/php.ini echo -e "## Install Nginx ##" sleep 1 apt-get install nginx -y echo -e "## Install Redis ##" sleep 1 apt-get install redis-server -y echo -e "## Install MySQL $mysql ##" sleep 1 apt-get install $mysql mytop -y chkconfig --levels 235 mysql on echo -e "## Install RabbitMQ ##" sleep 1 apt-get install rabbitmq-server -y echo -e "## Install development soft ##" apt-get install gcc build-essential g++ libboost-dev libboost-program-options-dev libboost-all-dev libevent-dev uuid-dev -y #echo -e "## Install DNS Server ##" #apt-get install bind9 bind9utils bind9-libs -y #apt-get install pdns-server pdns-backend-mysql pdns-recursor -y echo -e "## Install SMTP Server ##" sleep 1 apt-get install exim4 -y dpkg-reconfigure exim4-config echo -e "## Install MySql backup system ##" sleep 1 cd /root git clone https://github.com/Mirocow/mysql_utils.git /root/mysql_utils echo -e "## Install create site script ##" sleep 1 cd /root wget https://raw.githubusercontent.com/Mirocow/site-create/master/create.sh -O ./site-create.sh echo -e "## Start APPs ##" sleep 1 service nginx restart service php5-fpm restart service mysql restart service redis-server restart service rabbitmq-server restart #echo " *Clearing downloaded packages after install!*" #rm /var/cache/apt/archives/*.deb -f echo -e "## Base system configure ##" echo ' # # My config # alias nano="nano -u -w " alias ls="ls --color=always" alias grep='grep --color=auto' alias fgrep='fgrep --color=auto' alias egrep='egrep --color=auto' HISTSIZE=50000 HISTFILESIZE=50000 export HISTCONTROL=ignoreboth shopt -s cmdhist shopt -s histappend shopt -s checkwinsize shopt -s extglob ulimit -c 0 # # Functions # #----------------------------------- # Функции работы с историей комманд #----------------------------------- function h(){ history| grep "$@"; } #----------------------------------- # Функции для работы с файлами и строками: #----------------------------------- # Поиск файла по шаблону: function ff() { find . -type f -iname '*'$*'*' -ls ; } # Поиск файла по шаблону в $1 и запуск команды в $2 с ним: function fe() { find . -type f -iname '*'$1'*' -exec "${2:-file}" {} \; ; } # поиск строки по файлам: function fstr() { OPTIND=1 local case="" local usage="fstr: поиск строки в файлах. Порядок использования: fstr [-i] \"шаблон\" [\"шаблон_имени_файла\"] " while getopts :it opt do case "$opt" in i) case="-i " ;; *) echo "$usage"; return;; esac done shift $(( $OPTIND - 1 )) if [ "$#" -lt 1 ]; then echo "$usage" return; fi local SMSO=$(tput smso) local RMSO=$(tput rmso) find . -type f -name "${2:-*}" -print0 | xargs -0 grep -sn ${case} "$1" 2>&- | \ sed "s/$1/${SMSO}\0${RMSO}/gI" | more } # Включение магии bash if [ -f /etc/bash_completion ]; then . /etc/bash_completion fi ' >> ~/.bashrc source ~/.bashrc echo ' set tabsize "2" ' >> ~/.nanorc echo ' # Run MySql backup system 25 6 * * * root /bin/bash ~/mysql_utils/backup.sh --dir="/var/backups/mysql" --compress=bzip2 --exclude="mysql" --lifetime="3 day ago" ' >> /etc/crontab service cron restart