Installing the Building Blocks (Ubuntu/Debian)

Log in as root, or "su".

run the following 'apt-get' commands to install Apache, MySQL and PHP.

apt-get update
apt-get -y install apache2
apt-get -y install mysql-server
apt-get -y install mysql-client
apt-get -y install php5
apt-get -y install php5-mysql

*Note that for apt-get to work, your computer has to be connected to the internet

If everything runs without error then that's it! You have installed Apache, MySQL and PHP.

Configuring MySQL: MySQL turns your computer into a database server. There is nothing to configure for now. Later on we will establish the databases and add user accounts to the MySQL servers on the lane and on the server. For now, the important thing is to note the path of the mysql binary. You will be prompted for the path when you run the database installation script later on. The default path is /usr/bin, and it is more than likely that your mysql binary will be there as well.

A word about MySQL - A point of sale system differs from a collection of "stand alone" cash registers in that it is a networked data management system. If you wish to develop the system, want to be able to mine data at will for customized report, or if you are interested in overseeing and controlling the flow of digital information in your entire organization now that you have an open source POS system - knowledge in database programming is essential. IS4C uses MySQL for it's database engine, and therefore expertise in MySQL tops the list of skills required.

Next, as long as we are running apt-get

apt-get -y install build-essential
is necessary for gcc, the c compiler, to work properly. You will need it to compile the scanner scale daemon.
apt-get -y install openssh-server
apt-get -y install openssh-client
will install ssh if you do not have it up and running already. Technically you don't need ssh to run IS4C but it will be very hard indeed to deal with your lane, or any Linux computer, if you don't have ssh.

Configuring Apache for IS4C: Apache, of course, turns your computer into a web server. We wish to use /pos/is4c as our web root, and login.php as our default index.

Open /etc/apache2/apache2.conf and check that the 'ServerName' and 'DirectoryIndex' directives exist. On my Ubuntu distribution, "Feisty", they do not. If they are not there, add them. Make sure you have the following lines

DirectoryIndex login.php index.php
Open /etc/apache2/sites-available/default. Note the default DocumentRoot. Mine is /var/www/. Change this, and the other occurrence of /var/www/, to /pos/is4c/

For Apache to start properly, the directory /pos/is4c/ must exist, which means that the IS4C files and directories have to be already in place.

Restart Apache

/etc/init.d/apache2 restart

Configuring PHP: If everything has gone well, PHP should be running when you restart Apache. Point your browser to http://localhost/phpinfo.php

You should get a list of your php settings. Look under "Configuration File (php.ini) Path" to find where your php.ini is located. We have to edit a few of those settings.

Open php.ini, locate session.auto_start. Make sure that

session.auto_start = 1
short_open_tag = On

Go to the error handling section and make a note of the different options. For debugging during development, as we are doing now, turn on E_ALL to report everything.

Locate 'Log errors into a log file' and set log_error = On
Locate 'Log errors to specific file' and pick a place for the error log file. /pos/is4c/log/is4c_errors is a good place.

Restart Apache, then look at localhost/phpinfo.php again to make sure that everything is in order.

Now that MySQL, Apache and PHP are out of the way, it is time for the databases.

The Distribution Installing the Databases