Last active
January 13, 2023 21:21
-
-
Save StoyPenny/1b709929f36431377694416b0e98acbb to your computer and use it in GitHub Desktop.
A simple makefile for basic LAMP style VM's for basic web development.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lamp : | |
# Update the machine | |
sudo apt update | |
sudo apt upgrade -y | |
# Install Apache | |
sudo apt install apache2 -y | |
# Install MySQL | |
sudo apt install mysql-server -y | |
sudo mysql_secure_installation | |
# Install PHP | |
sudo apt install php libapache2-mod-php php-mysql php-fpm php-bcmath php-curl php-gd php-imagick php-libsodium php-mbstring php-soap php-xml php-zip -y | |
# Install PHPmyAdmin | |
sudo apt install phpmyadmin php-mbstring php-gettext | |
sudo phpenmod mbstring | |
# Fix PHPmyAdmin | |
# sudo mysql | |
#SELECT user,authentication_string,plugin,host FROM mysql.user; | |
sudo mysql | |
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'mypassword'; | |
exit; | |
## Add Existing User to www-data Group | |
usermod -a -G www-data whoami | |
# Update Apache to serve php files first | |
# sudo nano /etc/apache2/mods-enabled/dir.conf | |
sed -i.bak 's/index.php//g' /etc/apache2/mods-enabled/dir.conf | |
sed -i.bak 's/DirectoryIndex/DirectoryIndex index.php /g' /etc/apache2/mods-enabled/dir.conf | |
# Create a test file for your server | |
sudo touch /var/www/html/info.php | |
sed i.bak 's//<?php phpinfo (); ?>/g' /var/www/html/info.php | |
# Restart Apache | |
sudo systemctl restart apache2 | |
tools: | |
# Update the machine | |
sudo apt update | |
sudo apt upgrade | |
# Install Git | |
sudo apt install git -y | |
# Install Curl | |
sudo apt install curl -y | |
# Install Net Tools | |
sudo apt install net-tools -y | |
# Install Git Secret | |
sudo sh -c "echo 'deb https://gitsecret.jfrog.io/artifactory/git-secret-deb git-secret main' >> /etc/apt/sources.list" | |
wget -qO - 'https://gitsecret.jfrog.io/artifactory/api/gpg/key/public' | sudo apt-key add - | |
sudo apt-get update && sudo apt-get install -y git-secret | |
# Install Nodejs | |
sudo apt install nodejs -y | |
sudo apt install npm -y | |
# Install Composer | |
sudo apt install php-cli unzip -y | |
cd ~ | |
curl -sS https://getcomposer.org/installer -o composer-setup.php | |
sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer -y | |
# Install Yarn | |
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - | |
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list | |
sudo apt install yarn -y | |
# Install Sublime Text 3 | |
sudo apt install apt-transport-https ca-certificates curl software-properties-common -y | |
curl -fsSL https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add - | |
sudo add-apt-repository "deb https://download.sublimetext.com/ apt/stable/" -y | |
sudo apt install sublime-text -y | |
# Install Ionic | |
# npm install -g ionic -y | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment