sudo apt-get update
sudo apt-get install git
sudo apt-get install nodejs
sudo ln -s /usr/bin/nodejs /usr/bin/node
sudo apt-get install npm
sudo npm install --global gulp
sudo apt-get install nginx
sudo apt-get install mysql-server
sudo mysql_secure_installation
dpkg -l | grep php | tee packages.txt
sudo add-apt-repository ppa:ondrej/php &
sudo apt-get update
sudo apt-get install php7.1 php7.1-common
sudo apt-get install php7.1-curl php7.1-fpm php7.1-xml php7.1-zip php7.1-gd php7.1-mysql php7.1-mbstring
sudo apt-get install php-fpm php-mysql php-mbstring
sudo gedit /etc/php/7.0/fpm/php.ini
cgi.fix_pathinfo=0
sudo cp /etc/nginx/sites-available/default /etc/nginx/sites-available/example.com
sudo nano /etc/nginx/sites-available/example.com
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/laravel/public;
index index.php index.html index.htm index.nginx-debian.html;
server_name 160.153.231.194;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}
sudo ln -s /etc/nginx/sites-available/example.com /etc/nginx/sites-enabled/example.com
sudo chmod 755 /var/www
sudo chown -R www-data:www-data /var/www/html/laravel/public/
sudo nginx -t
sudo systemctl reload nginx //or sudo service nginx restart
sudo mkdir -p /var/www/laravel
sudo service nginx restart
sudo fallocate -l 1G /swapfile
sudo mkswap /swapfile
sudo chmod 0600 /swapfile
sudo swapon /swapfile
cd ~
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
cd /var
mkdir repo && cd repo
mkdir site.git && cd site.git
git init --bare
cd hooks/
sudo nano post-receive
#!/bin/sh
git --work-tree=/var/www/laravel --git-dir=/var/repo/site.git checkout -f
sudo chmod +x post-receive
git remote add production ssh://[email protected]/var/repo/site.git
git push production master
mysql -u root -p
SHOW DATABASES;
CREATE DATABASE blog;
sudo tail -f /var/log/nginx/error.log
sudo service php7.0-fpm restart
sudo chown -R m5lil:m5lil laravel/
sudo chown -R :www-data /var/www/laravel
sudo chmod -R 775 /var/www/laravel/bootstrap/cache
sudo chmod -R 775 /var/www/laravel/storage
sudo chown -R m5lil:m5lil /var/repo/site.git/