Installing drupal on a local machine

Running drupal on your local machine will be easy to learn how to use drupal. Moreover, there is no expense to install it like we do in web hosting.


Git should be installed and configured on your machine. If not done, then follow these commands –

$ sudo apt-get install git #installing git
$ git config --global "<username>"        
$ git config --global <email>

Also, you need to install composer before going to the next step. For that follow this one line code –

curl -sS | sudo php -- --install-dir=/usr/local/bin --filename=composer

Some more things to install

sudo apt-get install php5-gd php5-curl libssh2-php

Now you need to install and setup lamp server on your local machine. For that follow my previous post -> Installing LAMP server on ubuntu

Also you need to do some configurations with your apache files and mysql.

First thing is to create a database

mysql -u root -p


CREATE USER drupaluser@localhost IDENTIFIED BY 'password';




Now configure apache file –

sudo nano /etc/php5/apache2/php.ini

Check the below conditions are given correctly –

. . .
expose_php = Off
. . .
allow_url_fopen = Off
. . .
sudo a2enmod rewrite
sudo nano /etc/apache2/sites-enabled/000-default.conf

Check whether the below codes match with the file you opened now

<VirtualHost *:80>
    . . .
    DocumentRoot /var/www/html

    <Directory /var/www/html>
        AllowOverride All
    . . .

Now restart your web server to execute the changes you have done in php and apache

$ sudo service apache2 restart

Now, if you have done till now without any issue then clone the desired version drupal repository to /var/www/html. Follow the given syntax –

git clone --branch 8.x

Now, extract the file. Get into the drupal extracted folder ands do composer install.

$ composer install --no-dev

And search for the given address in your browser

http://localhost/"<name of the directory you cloned>"

Hope you gotcha. Just install with your valid database name, username & password.


How to make a USB drive bootable (in Linux distros) ?

Greeting folks,

Things you need to make a bootable USB drive are –

  • a USB drive with minimum 2 GB space
  • a machine with any Linux machine

First, you need to download the desired ISO file.

Once your downloading work is finished, open Disks in your system and select your USB drive.

Now format your USB to fat 32 ( be careful while selecting and formatting your USB ).

Now open Startup disk creator in your machine, select your ISO file and click on Make Startup Disk button. It will take some time, wait till it finishes.

Finally, you are done with it.

Yeah, this method is very easy for beginners but what if someone wants to do through terminal ? Developers might feel to do everything using the terminal, right ?    😛

So developers, open  your terminal and do :

$ sudo apt-get install syslinux mtools

Create a mount point and mount Linux ISO image using the following command.

$ sudo mkdir /media/iso
$ sudo mount -o loop /opt/Ubuntu.iso /media/iso

Now connect your USB. In case it is not mounted the to mount it, do :

$ sudo mount /dev/sdc /medma/usb

Copy all files from mounted iso to the USB drive.

$ sudo cp -ra /media/iso/* /media/usb

Finally, we need to make this USB bootable. Copy ldlinux.sys file to USB drive to make it bootable.

$ sudo syslinux -s /dev/sdd1

Now rename some required files and directories as like below. Navigate to USB drive

$ cd /medma/usb
$ mv isolinux syslinux
$ cd syslinux
$ mv isolinux.cfg syslinux.cfg

Now you can connect this USB to the computer which you need to install Linux operating system and boot it from USB.


Fix : zsh corrupt error


Recently I got an issue, whenever I open my terminal it shows some error that my .zsh got corrupt.

Somewhat like this :

$ zsh: corrupt history file /home/myusername/.zsh_history

How to fix this issue ?

This is due to some error in zsh history.

You just need to copy the following codes in your terminal :

$ cd ~

$ mv .zsh_history .zsh_history_bad

$ strings .zsh_history_bad > .zsh_history

$ fc -R .zsh_history

Now reboot your system

$ sudo reboot


One of my senior suggested me that we don’t have to go so long, we can just simply delete our  ~/.zsh_history. To remove that just follow these codes –





Now that error won’t prompt you. #</HappycOding>

Creating a Drupal site

Hey Folks

Get your own Drupal site within few minutes and few clicks 🙂

First install xampp

Go to this link and download xampp according to your operating system ->\

Then follow these codes –

cd /home/[Username]/Downloads

Now to make installable file execute

chmod +x

Your file is ready to execute, now to run this file

sudo -s -H

Now you will get a dialogue box to install it, do install

and then type the following command to get started with xampp

sudo /opt/lampp/lampp restart

Here you installed xampp server

Now go to your browser and type the following on address bar


and you will be redirected to xampp server. Scroll down and check for Drupal in the following list. Click on Drupal to Download.

Now do the following commands

cd Downloads/
chmod +x <name of the drupal file you downloaded>
./ <name of the drupal file you downloaded>

This will show you another dialogue box to install Drupal. install it and get into your own Drupal site 🙂


Hope this worked for you

Changing Ubuntu’s password

It’s important to choose a safe and secure password for any machine, but sometimes it’s not so easy to remember the password for a long time, which sometimes tend to remove the OS and reinstall. Why to make the process such difficult when you can change the password without making much moderation.

For a fresh start – reboot the machine.

Hold shift key to get into GRUB, for a dual booted version they automatically get into GRUB.

Select your version of Ubuntu image and press E to edit the image.

Find the line starting with Linux and at the end of the line type this command ->

rw init=/bin/bash 

Then press F10 or ctrl + x to save the changes and boot OS, if it comes as a blank page with a blinking underscore then do redo the above procedures carefully.

Hope it worked till now!

Now you get into root mode and type

$passwd <your username>

System will prompt to enter your new password. Enter a valid and easy_to_remember password and save the change.

Reboot the system, and congratulations you are back to Ubuntu 🙂