Skip to content

Instantly share code, notes, and snippets.

@dhanifudin
Last active October 30, 2018 13:48
Show Gist options
  • Save dhanifudin/d764904cd963ab395488827b0f5a16ad to your computer and use it in GitHub Desktop.
Save dhanifudin/d764904cd963ab395488827b0f5a16ad to your computer and use it in GitHub Desktop.
#!/bin/bash
export DEBIAN_FRONTEND=noninteractive
curl -sL https://deb.nodesource.com/setup_10.x | bash -
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
apt-get update -y
echo "installing tzdata"
apt-get install tzdata -y
ln -fs /usr/share/zoneinfo/Asia/Jakarta /etc/localtime
dpkg-reconfigure --frontend noninteractive tzdata
echo "installing apache"
apt-get install apache2 git -y
echo "installing nodejs"
apt-get install nodejs build-essential -y
echo "installing php"
apt-get install php composer -y
echo "installing php extensions"
apt-get install php-mysql php-mbstring php-xml php-zip -y
git clone https://github.com/dhanifudin/laravel-test.git /var/www/muslimnesia
chgrp www-data -R /var/www/muslimnesia/bootstrap/cache /var/www/muslimnesia/storage
chmod -R ug+rwx /var/www/muslimnesia/bootstrap/cache /var/www/muslimnesia/storage
composer install -d /var/www/muslimnesia
npm install --prefix /var/www/muslimnesia
npm run production --prefix /var/www/muslimnesia
mv /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/000-default.bak.conf
cat << EOF > /etc/apache2/sites-available/000-default.conf
<VirtualHost *:80>
ServerName muslimnesia.local
ServerAdmin webmaster@muslimnesia
DocumentRoot /var/www/muslimnesia/public
<Directory /var/www/muslimnesia>
AllowOverride All
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
EOF
systemctl restart apache2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment