Created
September 18, 2017 08:08
-
-
Save naneri/57c3162fe856dd4ef2117f08b9dfcebd to your computer and use it in GitHub Desktop.
deploy.sh
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
#!/bin/bash | |
currentFolder=${PWD##*/} | |
echo -e "$Cyan \n Updating System.. $Color_Off" | |
sudo apt-get update -y && sudo apt-get upgrade -y | |
echo -e "$Cyan \n Installing Apache2 $Color_Off" | |
sudo apt-get install apache2 | |
cat >/etc/apache2/sites-available/000-default.conf <<EOL | |
<VirtualHost *:80> | |
ServerAdmin webmaster@localhost | |
DocumentRoot /var/www/${currentFolder}/public | |
<Directory /var/www/${currentFolder}/public> | |
Options Indexes FollowSymLinks | |
AllowOverride All | |
Require all granted | |
</Directory> | |
ErrorLog /var/log/apache/error.log | |
CustomLog /var/log/apache/access.log combined | |
<IfModule mod_dir.c> | |
DirectoryIndex index.php index.pl index.cgi index.html index.xhtml index.htm | |
</IfModule> | |
</VirtualHost> | |
EOL | |
service apache2 restart | |
sudo chgrp -R www-data storage bootstrap/cache | |
sudo chmod -R ug+rwx storage bootstrap/cache |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment