If you need to run several independent installations of hitAppoint, you might create a sub directory per each, upload the software code and run it. It will work just fine, but done this way, it will add a maintenance overhead to update each of the installations to the latest version. You will need to upload new software files again and again for every of your installs.

There is a more effective way, you can install the main code in one common directory, then create sub directories per every of your installations, do a small configuration file and it will run just fine. When the new version is published, you upload the new code files to just to one core directory and all of your installs are now running the latest version.

So how it is done:

  • Install hitAppoint as usual in one directory on your site. For this example, let it be /home/public_html/hitappoint that translates to http://www.mysite.com/hitappoint/ online.
  • Then for each of your required setups create a subdirectory. For example:
    • /home/public_html/salon1
    • /home/public_html/salon2
  • In each of this sub directories create just one index.php file with just 3 lines of code:

    1. This is the database table prefix for this instance. All the instances will share the same database, but they will be distinguished by their tables name prefix thus not conflicting.
      define( 'NTS_DB_TABLES_PREFIX',	'ha_salon1_' );
      
    2. This is the web URL of the core hitAppoint install, it will be required to pull common CSS and JavaScript files.
      define( 'NTS_ROOT_WEBDIR', 'http://www.mysite.com/hitappoint/' );
      
    3. And here goes hitAppoint.
      require( '/home/public_html/hitappoint/index.php' );
      

    So the final code in each index.php file will look like this:

    <?php
    define( 'NTS_DB_TABLES_PREFIX',	'ha_test1_' );
    define( 'NTS_ROOT_WEBDIR', 'http://www.mysite.com/hitappoint/' );
    require( '/home/public_html/hitappoint/index.php' );
    ?>
    

Actually just the first line of code in this index.php file changes from one installation to another. The other 2 lines of code will be the same for every instance.

Adjusting The View For Every Instance

Naturally, you would want to offer an individual look and feel for each of your installations. It is easy. You will need to create a theme file for each instance. Just create the theme sub directory in the instance directory and the index.php file inside, i.e.

  • /home/public_html/salon1/theme/index.php
  • /home/public_html/salon2/theme/index.php

Then edit these theme files just as described here for a single installation.

Then for this individual theme file to take effect, you will need to adjust this instance root index.php file with one line:

define( 'NTS_RUN_DIR', dirname(__FILE__) );

So the final code in each instance root index.php file will look like this:

<?php
define( 'NTS_DB_TABLES_PREFIX',	'ha_test1_' );
define( 'NTS_ROOT_WEBDIR', 'http://www.mysite.com/hitappoint/' );
define( 'NTS_RUN_DIR', dirname(__FILE__) );
require( '/home/public_html/hitappoint/index.php' );
?>