Skip to content

Instantly share code, notes, and snippets.

@naneri
Created September 18, 2017 08:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save naneri/57c3162fe856dd4ef2117f08b9dfcebd to your computer and use it in GitHub Desktop.
Save naneri/57c3162fe856dd4ef2117f08b9dfcebd to your computer and use it in GitHub Desktop.
deploy.sh
#!/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