#!/bin/bash # This script will help you to set Hiawatha Server. # Tested with Debian 7 32/64bit. # Script author ZEROF # VPS server provided by http://virtovo.com (FAST AND STABLE KVM VPS's) # If you like Linux and security join http://backbox.org # This script is distributed under a DO WHAT THE F*** YOU WANT TO PUBLIC LICENSE. # http://rmlh.me/license.html function banner () { echo "" #lp='\e[30;48;5;82m \e[0m' echo -e "${lp} ╦ ╦┬┌─┐┬ ┬┌─┐┌┬┐┬ ┬┌─┐ ╔═╗╦ ╦╔═╗ ╔═╗╔═╗╔╦╗ ╔╦╗┌─┐┬─┐┬┌─┐╔╦╗╔╗ ${lp}" echo -e "${lp} ╠═╣│├─┤│││├─┤ │ ├─┤├─┤───╠═╝╠═╣╠═╝───╠╣ ╠═╝║║║───║║║├─┤├┬┘│├─┤ ║║╠╩╗${lp}" echo -e "${lp} ╩ ╩┴┴ ┴└┴┘┴ ┴ ┴ ┴ ┴┴ ┴ ╩ ╩ ╩╩ ╚ ╩ ╩ ╩ ╩ ╩┴ ┴┴└─┴┴ ┴═╩╝╚═╝${lp}" #echo "" #echo "|_|o _ _ _|_|_ _ " #echo "| ||(_|\/\/(_| | | |(_|" #echo "" } var=$(sed -i 's/\# Read the manual for more InnoDB related options. There are many\!/\# Read the manual for more InnoDB related options.There are many\!\n\# Enable the two below to disable XtraDB+ and enable the standard InnoDB Plugin\n\[mysqld]\nignore_builtin_innodb\nplugin_load=innodb=ha_innodb.so\n\# The following should not be needed if you are using a mariadb package:\nplugin_dir=\/usr\/lib\/mysql\/plugin/g' /etc/mysql/my.cnf) #var1=$(sed -n 96p /etc/mysql/my.cnf) #if [ $var1 ! = '\# Read the manual for more InnoDB related options. There are many\!' ]; then #echo "You need to check my.cnf file in /etc/mysql,send me mail, or try again." #else #$selection #fi if [ $USER != 'root' ]; then echo "Are you root? NO. Then try again." exit fi if [ $(getconf LONG_BIT) = "64" ] ; then echo -e "\n\e[40;38;5;82m Hiawatha Server \e[30;48;5;82m SETTING DEBIAN 7/64bits \e[0m" url="http://files.tuxhelp.org/hiawatha/hiawatha_9.4_amd64.deb" else echo -e "\n\e[40;38;5;82m Hiawatha Server \e[30;48;5;82m SETTING DEBIAN 7/32bits \e[0m" url="http://files.tuxhelp.org/hiawatha/hiawatha_9.4_i386.deb" fi $selection function enter () { echo "" read -sn 1 -p "Press any key to continue..." clear } function print_menu() { banner echo "" echo "1 - system update, upgrade and dist-upgrade." echo "2 - install required dependencies for Hiawatha." echo "3 - install PHP5 and PHP5 modules." echo "4 - installation of MariaDB and InnoDB enabled for better performances." echo "5 - secure MariaDB installation." echo "6 - install Hiawatha Webserver." echo "7 - set VPS/SERVER time zone." # echo "8 - remove all. This is on your own risk !!!!" # echo "9 - remove install script. Use only if you didn't make changes on script name" echo "" echo "0 - exit program" echo "" echo -n "Enter selection: " } selection= until [ "$selection" = "0" ]; do print_menu read selection echo "" case $selection in 1 ) apt-get update;apt-get upgrade -y;apt-get dist-upgrade -y; enter ;; 2 ) apt-get install libc6-dev libssl-dev dpkg-dev debhelper fakeroot libxml2-dev libxslt1-dev -y;enter ;; 3 ) apt-get install php5-cgi php5 php5-cli php5-mysql php5-curl php5-gd php5-intl php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl php5-xcache php5-ffmpeg apache2-utils php5-fpm -y; enter ;; # 4 ) gpg --keyserver hkp://keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A;gpg -a --export CD2EFD2A | apt-key add -;echo -e "deb http://repo.percona.com/apt wheezy main\ndeb-src http://repo.percona.com/apt wheezy main" >> /etc/apt/sources.list;apt-get update;apt-get install percona-server-server-5.5 percona-server-client-5.5;enter ;; 4 ) apt-get install python-software-properties -y; apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xcbcb082a1bb943db;add-apt-repository 'deb http://mirrors.linsrv.net/mariadb/repo/5.5/debian wheezy main';apt-get update;apt-get install mariadb-server -y;sleep 2; echo -n "${var}"; service mysql restart; clear ;; 5 ) mysql_secure_installation; enter ;; 6 ) wget "$url" -O hiawatha.deb; dpkg -i hiawatha.deb; rm hiawatha.deb;enter ;; 7 ) dpkg-reconfigure tzdata; enter; echo "We are done.It was cool? NO :)";enter ;; 0 ) exit ;; * ) echo "Please enter 1, 2, 3, 4, 5, 6, 7 or 0" esac done