Tutorial : How to Running CakePHP on Easyengine VPS

CakePHP is my fav. framework, because of the ease and speed it offers, build web applications more quickly and easily, besides that, you are also more secure. The codes in CakePHP already in the test and get updated regularly. This is the advantage of making the web with the framework.

CakePHP using .htaccess to rewrite URLs in. Of course there must be a deal with the web server. Web servers that support the full CakePHP and easy to use is apache, because apache support .htaccess and mod_rewrite. Without these two elements, cakephp is not running perfectly.

Even so, cakephp give tips or special code that can run on all web servers. Including the nginx web server. I’ve run the cakephp on nginx, but it must make complex configuration.

But, with easyengine, you can run cakephp very easily and quickly. I was also surprised by this.

Easyengine is a python script created by rtcamp, a group of developers from India which allows us to install Nginx + PHP + MySQL and other easily and quickly. And everything is configured perfectly.

To install wordpress on easyengine, very easy and this article does not menjelasnnya. We will explains  how to install cakephp on easyengine.

Say you’ve installed easyengine and ready to action. I use ubuntu14.04 64bit with 3GB of RAM. Now you’re ready.

1. Create new site with  PHP+Mysql support

ee create site cakephp.cf --mysql

2. Download CakePHP latest version

wget https://github.com/cakephp/cakephp/archive/3.0.2.zip
unzip 3.0.2.zip
cp -rvf cakephp-3.0.2/* .

3. Update Permisssion

chmod -R 777 /var/www/cakephp.cf/htdocs/app/webroot/
chmod -R 777 /var/www/cakephp.cf/htdocs/app/tmp/

4. Update VHost file

nano /etc/nginx/sites-available/cakephp.cf

edit root line becoms like this below

root /var/www/cakephp.cf/htdocs/app/webroot/;

5. Restart your Nginx web server

And look at your domain. In this tutorial, I use cakephp.cf

This Script Will Simplify Running CakePHP on EasyEngine (Nginx)

cakephp on easy engine

cakephp on easy engine

A few months ago I wrote about Cakephp and nginx running on easyengine. Easyengine is a collection of scripts to facilitate the VPS users to install wordpress and other scripts on a web server nginx. Unfortunately for running Cakephp, it takes one line of the script so that all are running perfectly.

[code tipe=”336″]

Here are the steps to run CakePHP.

  1. Create site with mysql support (ee site create example.com –mysql)
  2. Upload your cakephp website. Or download it with wget command.
  3. Modify cakephp temporary and web root directory in order
    chmod -R 777 /var/www/yoursite.com/htdocs/app/webroot/
    chmod -R 777 /var/www/yoursite.com/htdocs/app/tmp/
  4. This is one line code that very crusial. Open website nginx config file with nano /etc/nginx/sites-available/yoursite.com
  5. Find and change
    root /var/www/yoursite.com/htdocs;
    root /var/www/yoursite.com/htdocs/app/webroot/;
  6. Then restart your nginx server with command
    service nginx restart

Please check your site. This tutorial tested work on cakephp 2.x, I have not tried to version 3.x

[code tipe=”336″]

Please share this article, it will help many developer