Skip to content

Instantly share code, notes, and snippets.

@trungpv1601
Last active March 20, 2019 07:53
Show Gist options
  • Save trungpv1601/884c11aea1fa1f192a8d20009dc7e0c1 to your computer and use it in GitHub Desktop.
Save trungpv1601/884c11aea1fa1f192a8d20009dc7e0c1 to your computer and use it in GitHub Desktop.
lamp-setup.sh
#!/bin/bash
sudo apt-get update
sudo apt-get upgrade
sudo apt install apache2 -y
sudo apt install mysql-server -y
sudo mysql_secure_installation
sudo apt install php libapache2-mod-php php-mysql php-json php-gd php-mbstring php-zip php-xml php-curl -y
sudo systemctl restart apache2
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === '48e3236262b34d30969dca3c37281b3b4bbe3221bda826ac6a9a62d6444cdb0dcd0615698a5cbe587c3f0fe57a54d8f5') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
sudo mv composer.phar /usr/local/bin/composer
sudo a2enmod rewrite
sudo systemctl restart apache2
sudo nano /etc/apache2/sites-available/000-default.conf
#<VirtualHost *:80>
# <Directory /var/www/html>
# Options Indexes FollowSymLinks MultiViews
# AllowOverride All
# Require all granted
# </Directory>
# . . .
#</VirtualHost>
#
# CREATE USER
# CREATE USER 'pmauser'@'%' IDENTIFIED BY 'password_here';
# GRANT ALL PRIVILEGES ON *.* TO 'pmauser'@'%' WITH GRANT OPTION;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment