Local Development Environment

Build CentOS 8 vagrant box from scratch in Windows

We need to install VirtualBox and Vagrant in Windows and download the DVD ISO image of CentOS 8 to be able to build CentOS 8 vagrant box. It is recomended to use Chocolatey (a software management automation for Windows) to install these software. To install Chocolatey, follow the procedure here.

Steps:

  1. Install VirtualBox by executing the following command from the command line or from PowerShell:

Alternative way to get Linux image for Vagrant

Vagrant box downloads are extremely slow and there are no other trusted sources (links, torrents, magnets) available. But there's an alternative way to download your Linux image from faster source and use it with your Vagrant. Instead of downloading the Vagrant box, download the Oracle Virtualbox "ova" image file then convert it to Vagrant box image.

Steps:

  1. Download the Oracle Virtualbox "ova" Linux image file. In this article, CentOS 8 "ova" Linux image file downloaded from https://www.linuxvmimages.com/images/centos-8 will be used as an example.

How to route external domain to router website hosted in local virtualbox web server (Windows as host OS and CentOS 7 as guest OS)

There are test scenarios that requires a development site hosted in local web server accessible via live external domain. In this article, will show how to make a development site hosted in local virtualbox web server (Windows as host OS and CentOS 7 as guest OS). Note: make sure you have full administrator access to your router and the router's WAN IP is a public IP address.

Steps:

  1. Open and configure your Vagrantfile. Add the following lines:

Setup phpMyAdmin with Laravel Valet

This article will show step by step on how to setup phpMyAdmin with Laravel Valet:

  1. Install Homebrew. Execute the following shell command in your terminal:

          
    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
          
        

    If you have Homebrew already installed, update it:

          
    brew update
          
        
  2. Install composer. Execute the following shell commands in your terminal:

Using Laravel Valet with Drupal multiple sites

Setup of development environment for Mac is made easy with Laravel Valet. Comparing it with XAMPP setup, we don't need to edit hosts file and httpd.conf/httpd-vhosts.conf Apache configuration files to add a local development domain. Even Drupal multiple sites setup (sharing the same code base) is possible in Laravel Valet. In this article will discuss the Drupal multiple sites setup step by step guide and we will use local development domain http://webfoobar.test as Drupal site #1 and http://drupal.test as Drupal site #2.

Steps:

Remote Linux server PHP debugging using PhpStorm Xdebug with its port forwarded through SSH tunnel

If your client's site setup is complicated and you don't have time to replicate it in your local machine, your choice is to debug it directly. This article will show steps on how to debug a website's PHP codes remotely in a server with firewall specifically hosted in Linode server running Centos 7 64-bit Linux distribution, PHP-FPM (FastCGI Process Manager) and PHP 7.0 (the server is running multiple PHP versions).

How to save/remove existing Vagrant box and restore the saved vagrant box

We know that Vagrant is a tool for building complete development environments. It allows us to imitate the setup of a server on our local machine which can be easily reproduced on any system.

This article will show three useful routines for Vagrant: saving an existing Vagrant box setup, removing old/unused Vagrant box and restoring saved vagrant box. It is assumed that you are using Windows as host machine's OS and Cygwin command line interface. Throughout this article, we will be using centos7drupal name for our Vagrant box.

Setup short and easy to remember URL for multi-site in Windows local PC

When developing on multi-site in our local development environment we wanted a short and easy to remember URL for each site. We will take a look on how to setup http://webfoobar and http://myotherwebsite address for our sites. The following instructions are for Windows with XAMPP web server solution stack package.