Thursday, October 14, 2010

pre-Lesson: Setting up the development box and installing kohana

I'll use Ubuntu Desktop for development and the first thing I do when starting a new project is to setup local subdomain for the project.

First let's download the framework and create new directory for the project:

cd /tmp
sudo mv kohana /var/www/

The next step is to create the virtual host for the project:

sudo vim /etc/apache2/sites-available/kohana

And paste the following text:

NameVirtualHost khn.localhost

 ServerName khn.localhost
 DocumentRoot /var/www/kohana

Save the file and create symbolic link to it in /etc/apache2/sites-enabled :

sudo ln -s /etc/apache2/sites-enabled/kohana /etc/apache2/sites-enabled/001-kohana

And add the subdomain to the /etc/hosts file       khn.localhost

Next reload apache:
sudo /etc/init.d/apache2 reload

Now open your browser and go to http://khn.localhost. You should be able to see the Environment Tests page.

Oops two red lines for errors. Fortunately they are easy to solve. I just have to make the cache and logs directories writable to the web server:

sudo chmod a+w /var/www/kohana/application/logs/
sudo chmod a+w /var/www/kohana/application/cache/

Refresh the page again and we get nice green message saying:

✔ Your environment passed all requirements.
Remove or rename the install.php file now.

Lets delete it and refresh again.
sudo rm /var/www/kohana/install.php

If everything is OK, you should get nice thee welcome mesage:

hello, world!

Ok that was was all for pre-lesson.


  1. I've got this[0] error. Any help?. FYI i used nginx.