How To Install CakePHP On An Ubuntu 12.04 VPS

Installing CakePHP There are a few ways you can install CakePHP on your server. You can download and unpack the archive from the CakePHP website, you can use Git to clone a release from Github or you can even use PEAR. We will use the first one as it is the most straightforward.

So what we need to do is download the latest stable release (link to which we can find on the CakePHP website home page) and unzip it into a folder. So let’s navigate to our web server’s root folder and download the archive:
cd /var/www
wget https://github.com/cakephp/cakephp/zipball/2.3.9

This will download a .zip file with the release version as the name. Now we need to unzip this file. If you don’t have unzip installed, just run the following command to quickly install it:
sudo apt-get install unzip

Now you’ll be able to unzip the archive (just make sure you replace the name of the .zip file with the one you have just downloaded):
unzip 2.3.9

You should get a new folder that contains all the CakePHP files. You can go ahead and rename this folder to something more useful, let’s say project:
mv cakephp-cakephp-4b9e390 project

Make sure again that you replace the name of the folder with the one you got after unziping the archive. And this command will rename it to project. So you currently have CakePHP found in the /var/www/project folder. You can find more information about the files and folder structure you’ll see in there.

Next up, let’s change the permissions of the app/tmp folder of your application as CakePHP will need to use it quite a bit so it needs to be writable by the webserver. For Apache, run the following commands from within the /var/www/project folder:
cd project
sudo chown -R root:www-data app/tmp
sudo chmod -R 775 app/tmp

This will change the ownership of the folder and everything inside it to the root user and www-data group (which contains the www-data user that Apache uses to run its processes). The second command then sets the folder permissions in a way in which the www-data group can write in it.
URL rewriting Let’s make sure that our webserver allows url rewriting as CakePHP works very nicely with clean URLs. This means that the Apache module mod_rewrite needs to be enabled and that the virtual host allows the .htaccess files to do their overriding. So first check if mod_rewrite is enabled on your system with this command:
sudo apache2ctl -M

If you see rewrite_module in the list, you are fine. If not, use the following command to enable the module:
sudo a2enmod rewrite

Next, if this is not the case for you, edit the Apache default virtual host file and make sure that Allow Overrides is set to All for the /var/www directory. Edit the file with the following command:
sudo gedit /etc/apache2/sites-available/default

And where you see this block, make the changes to correspond to the following:
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all

This will make sure that the .htaccess files can override the default Apache instructions. After any of these steps, make sure you restart Apache for the changes to take effect:
sudo service apache2 restart
Cakephp installation on ubuntu
other ref for cake php installation on ubuntu
one more ref

Export only the stored procedures and triggers

mysqldump --routines --no-create-info --no-data --no-create-db --skip-opt <database> > outputfile.sql

Example

mysqldump -uroot -ppassword –routines –no-create-info –no-data –no-create-db –skip-opt demo_db > demo_trigger.sql

If you need to import them to another db/server you will have to run something like:

mysql <database> < outputfile.sql

Example
mysql -uroot -ppassword demo_db < demotrigger.sql
Aside

Install Apache, MySql and PHP in Ubuntu 8.04/8.10/9.04

As a web developer i should have LAMP on my machine and now i would guide you through installing it on yours.

This guide is divided into 3 steps: installing/tesing Apache, PHP and finally MySQL.

Lets start with Apache:
1. Open the terminal (we will be using it through most of my guide) from Applications > Accessories > Terminal
2. Install apache2 using apt-get by typing the following

sudo apt-get install apache2

Note that you should know the root password.
Now everything should be downloaded and installed automatically.
To start/stop apache2 write:

sudo /etc/init.d/apache2 start
sudo /etc/init.d/apache2 stop

Your www folder should be in: /var/www/

If everything is OK you should see an ordinary HTML page when you type: http://localhost in your firefox browser

Finished with confiuring Apache. Now lets configure PHP

1. Also in terminal write:

sudo apt-get install php5 libapache2-mod-php5

or any php version you like
2. restart apache

sudo /etc/init.d/apache2 restart

This is it for PHP :D Wanna test it ? Just create an ordinary PHP page in /var/www/ and run it.
Example:

sudo gedit /var/www/test.php

and write in it: < ?php echo “Hello World”; ?>

Now run it by typing http://localhost/test.php in firefox… You should see your ” Hello World ”

66 % is over, lets continue to installing MySQL:
1. Again and again in terminal execute:

sudo apt-get install mysql-server

2. (optional) If you are running a server you should probably bind your address by editing bind-address in /etc/mysql/my.cnf and replacing its value (127.0.0.1) by your IP address
3. set your root password (although mysql should ask you about that when installing)

mysql> SET PASSWORD FOR ‘root’@’localhost’ = PASSWORD(’xxxxxx’);

4. Try running it

mysql -uroot -pxxx

where xxx is your password.
Note: You can install PHPMyAdmin for a graphical user interface of MySQL by executing

sudo apt-get install libapache2-mod-auth-mysql php5-mysql phpmyadmin

5. restart apache for the last time

sudo /etc/init.d/apache2 restart

Installing PHPMYADMIN for MySql

Do the following:

sudo apt-get install phpmyadmin

The phpmyadmin configuration file will be installed in: /etc/phpmyadmin
Now you will have to edit the apache config file by typing

sudo vi /etc/apache2/apache2.conf

and include the following line:

Include /etc/phpmyadmin/apache.conf

Restart Apache

sudo /etc/init.d/apache2 restart

Another issue was making mysql run with php5
First install these packages:

sudo apt-get install php5-mysql mysql-client

then edit php.ini and add to it this line : ” extensions=mysql.so” if it isnt already there

sudo vi /etc/php5/apache2/php.ini

Restart Apache

sudo /etc/init.d/apache2 restart

Congratulions your LAMP system is installed and running :D Happy Coding