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 bootstrap.sh 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 https://github.com/arifulhb/devspace.git

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

Use

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 http://192.168.33.10. You can check the `phpinfo` from http://192.168.33.10/phpinfo.php

List of Packages in DevSpace Vagrant

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

Requirements

You must have Vagrant and VirtualBox installed in your pc.

Default Credentials

These are credentials setup by default.

Host Address: – Hose: 192.168.33.10 (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.

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'] = 'http://staging.example.com/';
$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 🙂