- Install Ubuntu 10.04 (desktop edition)
- Set up openssh and LAMP (optionally install phpmyadmin or mysql administrator)
# apt-get install openssh-server
# apt-get install lamp^ - Download the latest CodeIgniter (CI) and unpack it in your web root directory.
http://codeigniter.com/user_guide/installation/index.html - To restart apache and mysql, run this:
# /etc/init.d/apache2 restart
or
# sudo service apache2 restart
# sudo service mysql restart - Now you can test your CI welcome page (assume you unpack it into a subfolder "ci"):
www.yourdomain.com/ci/
www.yourdomian.com/ci/index.php (default delegate)
www.yourdomian.com/ci/index.php/welcome/ (welcome is the default controller class)
www.yourdomian.com/ci/index.php/welcome/index/ (index is the default function in the controller) - All urls above should go to the same destination, a welcome page.
- Now use the mod_rewrite module of apache to remove the ugly index.php in the urls:
http://codeigniter.com/wiki/mod_rewrite/ - The procedures there are basically fine with a few modifications to fit my configuration.
- This is my modified .htaccess file put under my "ci" folder (you got to rename it yourself):
http://dl.dropbox.com/u/908171/blog/blogger/codeigniter-url-rewrite_.htaccess - This is my apache extra config file put under /etc/apache2/conf.d/
http://dl.dropbox.com/u/908171/blog/blogger/codeigniter-url-rewrite - One thing omitted in the document is that you need to remove the .htaccess comes with the default installation inside the "application" and "system" subfolder in "ci". That two files are invalid and will cause the mod_rewrite working improperly.
- Now it's done. You can access your CI controller in the following way:
www.yourdomain.com/ci/welcome/ - Thanks God and the CI team!
Friday, May 20, 2011
Configure CodeIgniter and LAMP in Ubuntu
The following steps describe the configuration I used in this setup.
Subscribe to:
Post Comments (Atom)
Mother of god ......... thank you for this it worked
ReplyDelete