The steps below assume that you are using a Unixoid system. A lot of them will not work on windows, since the makefile for windows does not contain them and the symlinks used inside the server source tree are not present under Windows - you will have to do a lot of manual copying in that case.
The database server must be reachable by the web server, but does not need to be on the same machine.
Make sure your web server, and database server work normally.
MagicSmoke can work with MySQL or Postgres. Connect to your database server using a client of your choice (I'll assume the command line mysql client below, commands should be similar for other clients).
Create a database user - I'll assume it is called "smoke" and uses "verysecret" as password. Create a database - I'll assume it is called "smoke". Then give the user all rights on this database.
mysql> CREATE USER smoke IDENTIFIED BY PASSWORD 'verysecret'; mysql> CREATE DATABASE smoke; mysql> GRANT ALL ON smoke.* TO smoke;MagicSmoke uses a common configurable prefix for its tables ("smoke2_*" per default), so you can use an existing database or even use the same database for multiple installations or different programs (assuming the other programs are as tolerant as MagicSmoke). If you have the possibility it is however recommended to give each MagicSmoke instance its own database, since it is easier to drop and restore entire databases insted of just parts of them.
MagicSmoke2 can be installed in parallel to the old MagicSmoke 1.0 packages, but it cannot access the same tables (upgrade is possible though).
Either install the server package or use the sources in www directly. For each instance you have to chose a target directory in which you want to configure it.
Execute /usr(/local)/share/magicsmoke2-server/install.sh with your target directory as parameter. This will link the current version of MagicSmoke into the target directory, if you have already made a configuration there it will not touch it.
If the target directory is not already inside the DocumentRoot of your server, link the target directory into your web server - either with a symlink or an Alias configuration statement.
You also need to do a local installation first if you want to install to an external ISP account (unless you have full shell and network access there). It is also recommended to try out MagicSmoke on a local box first. If you do not want to install MagicSmoke into a system directory, just change the PREFIX:
make install-server PREFIX=$HOME/magicsmoke
Copy the local server installation directory to you ISP account with whatever copying mechanism your provider has given you (usually FTP or scp). Rename config.php.template to config.php.
Some providers install several versions of PHP in parallel and detect what version you use by the file suffic that you are using. Try the phpinfo() call from above with different file extensions (eg. .php, .php5) to find out what is needed to be interpreted as a PHP 5 (version 5.2 or newer) script. Rename exactly the scripts index.php, admin.php, and machine.php to the correct suffix. Do NOT change any other script names - these are the only ones executed directly and they rely on the other script names still being as delivered.
You will usually get a MySQL database and a matching user name from your provider. You can skip the basic DB creation, configure the parameters you got from the provider and then go on with the configuration as described below.
The configuration file contains several sections:
The $db variable is supposed to point to an object of a class derived from DbEngine. There are currently two of those:
The $olddb variable if set can be used to upgrade a MagicSmoke 1.0 database to version 2.0. After upgrade you should comment it out.
There is one option stored in the DB-Engine that is only used for database creation and recovery:
$db->setAdminPassCode("Admin","SmokeInMyEye");This call sets the web-user and web-passcode for the admin.php script. After installing the system this line should be commented to prevent anyone from destroying the database or installing more admin users. Change the second parameter (password) to something else (preferably something hard to guess), so I won't be able to guess your admin password in case you forget to comment it.
There is only one option: the timeout for client sessions. It is safe to leave it at the default setting - making it short potentially confuses the client into re-establishing the connection immediately, if the clock between server and client are significantly off, making it longer does not have any effect since the client automatically renews the session when it nears its end.
These options configure the timeouts of cookies, what features are available to users and what features of the template engine are available.
Click the create database button.
Open the client and create a host key for it - upload this host key using the admin form and allow the initial administrator to use any host.
Done.
If you have set up the $olddb variable in your configuration MagicSmoke will offer to migrate data. Do not attempt migration if your new database already has some data stored.
Please make sure that the old and new database do not share tables - at the very least the database name or the table prefix should be different.
The upgrade may take some time - you should make sure that PHP scripts do not abort too soon. On a normal workstation this will take about 2-4 minutes for a database with a few thousand orders. If it fails you should empty/recreate the new database and start over.
Simply enter "upgrade" into the input line and click the button.
Make sure you have an administrator user that can log in. You will have to either export the host key of your old client and import it in the new client or create a new key and import it with the admin form.
The format of customers in the database has changed significantly. The upgrade process tries to guess what part of customer names and customer address belong to which detail. This heuristic may fail in some cases, you should go through your customer list and correct any mistakes afterwards.
When you are done comment out the $olddb configuration to avoid initializing it for every call of a script.
The migration process does not touch the old tables.
From now on you can access it with the MagicSmoke client. Your URL for the client ends in machine.php (eg. http://localhost/magicsmoke/machine.php).
Please read the chapter about Template Design and create your own set of templates (or customize an existing one).
If you plan to store your templates in a different directory modify the template line in your config file, eg.:
$template="/home/erwin/mytemplate/";