DevSpace – Ubuntu 14.04 Vagrant Box for LAMP stack development environment

DevSpace Vagrant is a simple Ubuntu Trusty64 vagrant configuration for LAMP stack developers which also includes many related modern development tools.

Ubuntu 14.04 Vagrant Box – DevSpace

This vagrant use ubuntu/trusty64 from Atlas Vagrant Box. On your ‘vagrant up’ command, this vagrantfile will automatically download the box. Vagrant folder here contain a file which provision the vagrant box.

You need to place your projects in projects directory. This directory is synced with /var/www/htmldirectory in the virtual machine. This project folder also contain a config folder which is used during the provisioning.

This vagrant box is configured to use ‘1024mb’ of RAM and 1 Cpu. You can change ths configuration from Vagrantfile.

DevSpace Vagrant Installation

Install via Git

To use DevSpace vagrant, clone this github repo

$ git clone

to your mac/pc/linux. When clone is complete, go to the `devspace` and now you are ready to use your Virtual Machine.


Start the VM

$ cd /devspace
$ vagrant up

First time of your ‘vagrant up’ will provision the vagrant. You can see the status of your VM from You can check the `phpinfo` from

List of Packages in DevSpace Vagrant

  • Apache2
  • PHP 5.6.7
  • MySQL 5.5.41
  • Git 1.9
  • Composer
  • Nodejs
  • NPM
  • Bower
  • Gulp


You must have Vagrant and VirtualBox installed in your pc.

Default Credentials

These are credentials setup by default.

Host Address: – Hose: (Change in Vagrantfile if you like)

SSH: vagrant / vagrant

MySQL: root/root
– Host: localhost
– Port: 3306

Fork and Tweet

This project is shared as Github Rep. If you find it helpful, you can Star and Fork in github. You can also help me to grow this project by tweet this.

How to remove controller name from URL in CodeIgniter

In CodeIgniter or any MVC application, the regular URL structure is like which appear as  But sometimes we may want to omit the controller name here to make the url more beautiful like or even as best url.

This beautiful url can be achieve through the URI Routing of CodIgniter. In
For, use this code


application/config/route.php file, you’ve to write following code for

  $route['user/(:any)']             = "user/profile/$1";

For, use this code

  $route['(:any)']                  = "user/profile/$1";

If you have multiple parameters like

public function profile($username, $city)
     echo "You are ".$username." from ".$city;

Your route will be

  $route['(:any)/(:any)']                  = "user/profile/$1/$2";

If you want to use number in parameter instead of string like these examples, you need to use (:num) instead of (:any).

If you are looking for something like modifying URL, I hope this post may help you. If you’ve any further question, you can comment bellow.

Collection of My Web Development Assets

This is a short story of why I initiated the GitHub repo  “Frameworks Library Plugins I use in work”

I am developing web sites and web applications from 2011. Though I was working as a programmer for long time, I drive into web technologies after staring freelancing and outsourcing through oDesk.

My evolution is something like WordPress > CodeIgniter > Laravel > AngularJs > Nodejs. I started my outsourcing career with small WordPress thick and Installation, Theme modification and ended with WordPress theme development. Then eventually moved to Web Application development using CodeIgniter, Laravel and Angularjs. Though these are only the lading Frameworks, I used many other library, plugins, scripts etc. But most of time I keep forgetting which library or plugin or script I used in last projects and needed to research those. I considered this as a time killing process.

To solve this issue, I though to initiate and maintain a list of Frameworks, Library, Plugin, Scripts I used. It will be easy for me to track my usages and might be helpful for others too. So I initiated GitHub repo named “Frameworks Library Plugins I use in work”.  This is not I’ve listed all things I used in past years, of-course I’ve forgot many of them but I am intended to keep it filling.

If you like the repo, you can fork it and continue as your repo as well.

Remove index.php from URL to avoid duplicate content issue

You want to redirect to ? Are you tired of finding proper solution about how to Remove index.php from URL to avoid duplicate content issue  or to redirect index.php to actual URL without index.php? You are in the right place mate!

I am a PHP based developer and most of time I use CodeIgniter as my php framework. Those who use CodeIgniter and obviously other framework, we use some technique to remove index.php  from our URL to make it more clean, short , Web 2.0 friendly and penitentially to avoid duplicate content issue in Google Web Master. In CodeIgniter, we do it in two steps:

How to remove index.php from URL in CodeIgniter

Step 1: We update application/config/config.php file

//keep the variable empty to remove index.php after your domain name
$config['index_page'] = '';

Step 2: We update our .htaccess file as

RewriteEngine on
Options -Indexes
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

Cool! That removes index.php from our URL.. thats really great… but wait! What if anyone put index.php in your url like ? Yes that is still accessible and duplicate content of .

How I removed the index.php from url

I had the same problem in one of my project and needed to solve it. I spend hours to solve it but couldn’t found any solution until I found this post htaccess remove index.php from url in stackoverflow. I just put following lines in my .htaccess file

RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L]

and my problem solved.

Now if you intentionally write in your address bar, it will be converted to . I guess your problem is solved to.

Let me know if it helps you


CodeIgniter .htaccess and index.php issues – Solution

CodeIgniter index.php and .htaccess issue ruined my last night. I’ve solved this simple issue many times before but not any solution was working that time.

Few days before today, I was working in a client project which I’ve been demonstrating to my client from my personal demo server which is a HostGator Baby Plan Hosting.  The site was running fine in my local pc (Win7 running XAMPP 1.7.7 running the site in VirtualHost) and in my demo server but when I push the code in client’s staging server (Rackspace Cloud server with CentOS 6.4, Apache2 ) , I was getting a 404 Page Not Found error message. First I checked my .htaccess file and it was same as my demo server, same as my local pc which is

RewriteEngine on
Options -Indexes
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

In my config.php file, I set

$config['base_url'] = '';
$config['index_page'] = '';

but nothing was working. I tried every solution I used before and I found over Internet but couldn’t find any perfect solution to solve my problem.

Everything seems fine and I was getting frustrated. Finally one solution I found where it says, I’ve to edit my httpd.conf file

httpd.conf File location in CentOS 6.4
httpd.conf File location in CentOS 6.4

and change AllowOverride None to AllowOverride All and saintly this solution worked Perfectly.

VirtualHost settings
VirtualHost settings to remove index.php file in CentOS 6.4

What Problem this was?

With my little understanding on server things, I understand that though we set the rule in .hetaccess to remove the index.php file, it was not fully permitted by staging.conf file. When working in Windows with XAMPP, this file location is in your drive:\xampp\apache\conf\extra\httpd-vhosts.conf

If you still reading, let me know if the solution work for you or If I need to update this posting in anywhere. I am open to creative suggestions 🙂

How to get value of Array in foreach loop

While working on my CodeIgniter based Open Source Project Management tool “Koronio”, suddenly I needed create a loop to generate a Dropdown element with array key as option value. This is very simple trick, provably everyone knows it, though I felt to share it.

Lets say, we have a php array named $priority which has 5 items.

$priority=array('Low','Normal Low',"Normal",'Normal High','High');

We want to show this items in a Select Item with Array value as option name and Array key as option value.

foreach($priority as $key=> $val)
echo '<option value="'.$key.'">'.$val.'</option>';

Thats It! You’ll have a dropdown list with the Priority list and value as option value.

Check Password Strength with jQuery Plugin

I was developing an Web Application recently. Like all other web app, this has user registration process and  password field for user. My client wanted to use a Password Strength Meter to indicate user how strong is his/her password. Well that’s a nice and must have feature for most of apps now.

I been searching for a jQuery plugin for this password strength feature and found a lots of plugins available for use. Well, I can’t use a lot of plugins but just one and I had to pick only one and I picked a simple one.

I choose this jQuery Password Strength Plugin from many. Reason for this choosing is,

  • easy to use
  • small but good documentation
  • little but necessary customization options

How to use Query Password Strength Plugin


  • jQuery
  • jquery.passstrength.js or jquery.passstrength.min.js

Download jquery.passstrength.js or jquery.passstrength.min.js from original site and keep them in your root folder or any folder you want (figure1)

Files for password strength meeter
Figure 1

Assume following is your html for password field in index.html (figure2)

<div id="passwordmeter">
  <label for="password">Password</label>
  <input type="password" id="password"/>
password field
Figure 2

Now add the following javascript at bottom of your page (before </body>).

<script type="application/javascript" src=""></script>
<script type="application/javascript" src="passstrength.min.js"></script>
<script type="application/javascript">

Well, that’s it. This should be working like this now.

Password Strength Meeter
Password Strength Meeter

See the demo here. Download Demo