Skip to content

Instantly share code, notes, and snippets.

@mechawrench
Forked from nowakowski-damian/install.bash
Created December 9, 2017 05:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mechawrench/190a89d4169768b3a1495f9f885f7ebf to your computer and use it in GitHub Desktop.
Save mechawrench/190a89d4169768b3a1495f9f885f7ebf 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