Skip to content

Instantly share code, notes, and snippets.

@nimahkh
Created October 7, 2018 10:55
Show Gist options
  • Save nimahkh/8510a9b300576d4403a027621935ae8b to your computer and use it in GitHub Desktop.
Save nimahkh/8510a9b300576d4403a027621935ae8b to your computer and use it in GitHub Desktop.
#!/bin/sh
#######################################
#NimaHKH
#######################################
#COLORS
# Reset
Color_Off='\033[0m' # Text Reset
# Regular Colors
Red='\033[0;31m' # Red
Green='\033[0;32m' # Green
Yellow='\033[0;33m' # Yellow
Purple='\033[0;35m' # Purple
Cyan='\033[0;36m' # Cyan
# Update packages and Upgrade system
echo -e "$Cyan \n Updating System.. $Color_Off"
sudo apt-get update -y && sudo apt-get upgrade -y
## Install AMP
echo -e "$Cyan \n Installing Apache2 $Color_Off"
sudo apt-get install apache2 apache2-doc apache2-mpm-prefork apache2-utils libexpat1 ssl-cert -y
echo -e "$Cyan \n Installing PHP & Requirements $Color_Off"
sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt-get install libapache2-mod-php7.1 php7.1 php7.1-common php7.1-curl php7.1-dev php7.1-gd php7.1-idn php-pear php7.1-imagick php7.1-mcrypt php7.1-mysql php7.1-ps php7.1-pspell php7.1-recode php7.1-xsl -y
sudo apt install php7.1-fpm
echo -e "$Cyan \n Installing MySQL $Color_Off"
sudo apt-get install mysql-server mysql-client libmysqlclient15.dev -y
echo -e "$Cyan \n Installing phpMyAdmin $Color_Off"
sudo apt-get install phpmyadmin -y
echo -e "$Cyan \n Verifying installs$Color_Off"
sudo apt-get install apache2 libapache2-mod-php7.1 php7.1 mysql-server php-pear php7.1-mysql mysql-client mysql-server php7.1-mysql php7.1-gd -y
## TWEAKS and Settings
# Permissions
echo -e "$Cyan \n Permissions for /var/www $Color_Off"
sudo chown -R www-data:www-data /var/www
echo -e "$Green \n Permissions have been set $Color_Off"
# Enabling Mod Rewrite, required for WordPress permalinks and .htaccess files
echo -e "$Cyan \n Enabling Modules $Color_Off"
sudo a2enmod rewrite
sudo phpenmod mcrypt
# Restart Apache
echo -e "$Cyan \n Restarting Apache $Color_Off"
sudo service apache2 restart
echo -e "$Red \n Installation successfull"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment