Last active
May 7, 2020 14:08
-
-
Save rudiejd/2499d8ebf632c5a1a10de10df06a1577 to your computer and use it in GitHub Desktop.
Build script for CSE201 project, but in bash
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
apt-get update -y && sudo apt-get upgrade -y; | |
apt-get install curl -y; | |
apt-get install git -y; | |
apt install software-properties-common -y; | |
add-apt-repository ppa:ondrej/ph -y; | |
apt install php7.4 php7.4-gd php7.4-mbstring php7.4-xml -y; | |
apt install apache2 libapache2-mod-php7.4 -y; | |
apt install mysql-server php7.4-mysql -y; | |
curl -sS https://getcomposer.org/installer | php; | |
mv composer.phar /usr/local/bin/composer; | |
chmod +x /usr/local/bin/composer; | |
if [ -d "/var/www/PlantPro" ]; | |
then rm -rf /var/www/PlantPro; | |
fi | |
git clone https://github.com/rudiejd/PlantPro.git /var/www/PlantPro; | |
chmod 777 -R /var/www/PlantPro | |
mysql -u root -e "CREATE DATABASE PlantPro;" | |
mysql -u root -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '';"; | |
rm /etc/apache2/sites-enabled/000-default.conf | |
echo "<VirtualHost *:80> | |
ServerAdmin webmaster@localhost | |
DocumentRoot /var/www/PlantPro/public | |
<Directory /> | |
Options FollowSymLinks | |
AllowOverride All | |
</Directory> | |
<Directory /var/www/PlantPro> | |
AllowOverride All | |
</Directory> | |
ErrorLog ${APACHE_LOG_DIR}/error.log | |
CustomLog ${APACHE_LOG_DIR}/access.log combined | |
</VirtualHost>" >> /etc/apache2/sites-enabled/000-default.conf; | |
sudo a2enmod rewrite | |
systemctl restart apache2 | |
cd /var/www/PlantPro; | |
php artisan migrate; | |
php artisan test; | |
echo 'PlantPro up to date! Enjoy!'; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment