Skip to content

Instantly share code, notes, and snippets.

@swanwish
Forked from nowakowski-damian/install.bash
Created November 11, 2017 12:37
Show Gist options
  • Save swanwish/a1a17683a5ce1030e8356fef71e79b5a to your computer and use it in GitHub Desktop.
Save swanwish/a1a17683a5ce1030e8356fef71e79b5a to your computer and use it in GitHub Desktop.
Raspberry Pi Install PHP7 + Nginx + MySQL + PhpMyAdmin (last versions)
if [ "$(whoami)" != "root" ]; then
echo "root required!"
exit
fi
apt-get update
apt-get upgrade
apt-get dist-upgrade
#helps to prevent hacking attempts by detecting log-in attempts that use a dictionary attack
#and banning the offending IP address for a short while.
apt-get install fail2ban
#instal php/mysql/phpmyadmin
apt-get install php7.0-fpm php7.0-curl php7.0-gd php7.0-cli php7.0-mcrypt php7.0 php7.0-opcache php7.0-mbstring php7.0-xml php7.0-zip php7.0-mysql
apt-get install mysql-server
mysql_secure_installation
# PhpMyAdmin
read -p "Do you want to install PhpMyAdmin? <y/n> " prompt
if [ "$prompt" = "y" ]; then
apt-get install phpmyadmin
ln -s /usr/share/phpmyadmin /var/www/default/public
fi
apt-get -y autoremove
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment