3. Configure Hotcakes as a LAMP Application

Hotcakes is a standard LAMP (Linux Apache Mysql PHP) web application which makes use of the CakePHP framework.

This section assumes a plain Ubuntu Feisty Fawn (7.04) install (server or desktop).

You will be taken through the steps to get Hotcakes running on it.

3.1. Installing the required packages

You need to have a working LAMP stack. Install the following packages for this:

  sudo apt-get install apache2-mpm-prefork php5 php5-mysql mysql-server-5.0 mysql-client-5.0 php5-gd
If you don't know how to install these packages on Ubuntu, please visit the InstallingSoftware page for more information.

Warning

The package 'php5-mysql' did not install correct on several of my machines.

To fix this, run

  sudo dpkg-reconfigure php5-mysql
from the command line.

This alters the '/etc/php5/apache2/php.ini' file to include the php-mysql module.

Reload Apache with the 'sudo /etc/init.d/apache2 reload' command.

3.2. Installing CakePHP

Hotcakes makes use of the CakePHP framework of PHP classes.

You should download the latest stable version Here (Version 1.1.18.5850 as of this writing)

Untar it in the directory from which the Apache web server is serving. ('/var/www' in Ubuntu)

  sudo cp /home/jo_blob/cake_1.1.18.5850.tar.gz /var/www/
  cd /var/www
  sudo tar -xzvf cake_1.1.18.5850.tar.gz
  sudo ln -s cake_1.1.18.5850 cake
There are a few tweaks Apache and php need before CakePHP will work correct.

Make sure you add the following to the '/etc/apache2/apache2.conf' file:

    <Directory  /var/www/cake>
        AllowOverride All
    </Directory>
Edit the following line in the '/etc/php5/apache2/php.ini' file:

Change

   output_buffering = Off 
 

To

    output_buffering = 4096 
Enable the rewrite Apache module and reload Apache's configuration
  sudo a2enmod rewrite
  sudo /etc/init.d/apache2 reload

3.3. Installing Hotcakes

CakePHP can have various applications which make use of its framework.

Hotcakes is such an application.

These applications each gets installed under the '/var/www/cake' directory.

Untar the Hotcakes tarball under the '/var/www/cake' directory.

Change the owner of the '/var/www/cake/hotcakes/tmp' directory and its contents to that of the user running Apache.

sudo chown -R www-data. /var/www/cake/hotcakes/tmp

Change '/var/www/cake/hotcakes/webroot/generated' to be writable in order for the graphs to be created.

sudo chmod 777 /var/www/cake/hotcakes/webroot/generated
You should now be able to get to the hotcakes page, but still need to setup the database.

3.4. Configure the database

You need to create a database called 'radius' and allow access to it for a username / password combination.

It is good practice to change the default username / password combination.

This can be changed inside the '/var/www/cake/hotcakes/config/database.php' file.

These sample commands assume the defaults.

  mysql -u root
  create database radius;
  GRANT ALL PRIVILEGES ON radius.* to 'radius'@'127.0.0.1' IDENTIFIED BY 'radius';
  GRANT ALL PRIVILEGES ON radius.* to 'radius'@'localhost' IDENTIFIED BY 'radius';
  exit;
  mysql -u root radius < /var/www/cake/hotcakes/db/radius.sql

3.5. Log Into Hotcakes

Everything on the LAMP side should now be up and running.

Hotcakes has three levels of users. Go to the http://127.0.0.1/cake/hotcakes page.

You have a choice of the role under which you want to log on. The following users are created by default for each of the roles.

Table 2. Roles and default users for each

RoleUsernamePassword
Adminrootadmin
Cashierchuckberry
Cashiergenevincent
Clientaleealee
Clientalee@bigburgeralee
Clientalee@koffiehuisalee

Warning

Be sure to change the admin password! To change it, log in as role 'Admin' and go to 'Settings' -> 'Admin Password'.