getting started with CodeIgniter on Ubuntu Lucid Lynx (10.04)

As I am currently playing around with CodeIgniter (an open source PHP web application framework), I thought I could write down the few software installation steps one needs to go through in order to get started on a fresh Ubuntu box. And all you really need is a LAMP (Linux Apache MySQL PHP) setup that can be up and running in less than 10 minutes (assuming the OS is already installed of course).

Install Apache

sudo apt-get install apache2

Install MySQL

sudo apt-get install mysql-server

Install PHP (with MySQL support)

sudo apt-get install php5 php5-mysql

Enable the rewrite mod in Apache

This is only needed if you plan to get rid off “index.php” in your CodeIgniter application’s URLs.

sudo a2enmod rewrite
sudo gedit /etc/apache2/sites-available/default
<!-- Edit the configuration and change AllowOverride None to AllowOverride All -->
<Directory /var/www/>
   Options Indexes FollowSymLinks MultiViews
   AllowOverride All
   Order allow,deny
   allow from all
</Directory>

Add your site to your local web server

You could probably just extract the CodeIgniter archive into /var/www/ but you also could have your application in your home folder (/home/scandinabox/www.mysite.com/ for instance). In that case, all you need to do is create a symbolic link in the Apache web directory pointing to your application folder.

cd /var/www
sudo ln -s /home/scandinabox/www.mysite.com/ www.mysite.com

Restart Apache

sudo /etc/init.d/apache2 restart

Here you go, just point your web browser to http://localhost/www.mysite.com/ and you should see the CodeIgniter example pages.

5 thoughts on “getting started with CodeIgniter on Ubuntu Lucid Lynx (10.04)

  1. Just a quick note on using

    sudo tasksel install lamp-server

    If this does not work you then have to figure out why and wonder what state your system has been left in – for example on an install I did my hosting provider had already installed apache (which I did not realise). During the apache install this causes a question to the user to ask if they want to keep the existing config file or overwrite it. It appears that tasksel is not equipped to handle this user interaction and so it just hangs, and must be killed.

    There seem to be similar issues other have seen (google ‘tasksel hangs’).

    Personally I will use the step by step approach from now on to avoid this type of issue.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Spam Protection by WP-SpamFree

Proudly powered by WordPress
Theme: Esquire by Matthew Buchanan.