Category: System Administration

  • Automated Deployment of Laravel Project

    In this article I would like to share my approach to automated deployment of a Laravel project. I have been successfully using this approach for my side projects. In this article I will share Laravel project deployment on Linux (Digital Ocean) server. In a nutshell deploying Laravel project consists of “building” it (installing composer dependencies,…

  • Loading Start Scripts for GitBash on Windows

    I use GitBash as my shell on Windows. Below are the scripts I normally load including git ssh agent. Useful git aliases:

  • Too Many Redirects

    Sometimes your website may be making more redirects than necessary to account for https and stripping or adding trailing slash.

  • Block IP Addresses in .htaccess behind Load Balancer

    Sometimes you need to block access from certain IP addresses to your web site. It is easy to do in .htaccess file if you are running Apache. What if your server is behind a load balancer ? The code below lets you block IP addresses when your server is behind AWS load balancer.

  • Ubuntu Command Line Search

    Sometimes I have to go through log files searching for a certain error message. The command below will show you log file names and lines where the message was recorded. grep -rnw ‘logs/’ -e ‘Hello World’ To learn more about “grep” command use the following link https://help.ubuntu.com/community/grep

  • Check Available Space on Ubuntu

    Recently I got into a situation where I ran out of free space on my Ubuntu instance. The first thing you need to do is to check how much available space you have. The command below will give you the general idea. df -h To list the files/directories that take up most of the space…

  • Finding Directories And Files And Changing Permissions

    I always forget how to do this: find /var/www/html -type d -exec chmod 755 {} \; find /var/www/html -type f -exec chmod 644 {} \;  

  • Node.js App on AWS EC2 Instance

    To get started let’s spin up an Ubuntu 16.4 LTS instance on AWS.  After instance is up and running, we need to add port 80 to the instance’s security group inbound rules.  There should be at least two ports open: 22, and 80. Now we can ssh into the instance and install Nginx, Node, and…

  • Laravel Jenkins CI

    This article covers installation of Jenkins on Ubuntu server and its usage to continuously integrate a Laravel application.  Besides LAMP/LEMP stack we need to install Java, Git, Composer, and Node to successfully use Jenkins. Before starting to install this software, let’s take care of miscellaneous  stuff. Miscellaneous (can skip this). Create mysql user and database.…

  • Adding Virtual Box Bridged Network Adapter to Laravel Homestead

    Vagrant allows you to configure bridged network adapter, so your vagrant(homestead) box can be seen on local network.  I order to make this possible by adding a line of code to homestear.rb script in scripts folder. I opted to add this line after the following code. if settings.has_key?(“networks”) settings[“networks”].each do |network| config.vm.network network[“type”], ip: network[“ip”], bridge: network[“bridge”]…