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.
Save yourself Steps 1-3 and just use:
(see Ubuntu Docs: https://help.ubuntu.com/community/ApacheMySQLPHP )
Sure and I’ll use that next time. I just think it is nice, the first time at least, to do it step by step and understand what is installed and why you need it
great man
it was very helpful !
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.
Good short tutorial. Helped me in setting up CodeIgniter on my my Ubuntu. Thanks.