Mojavi Project

Developing new paths

Archive for September, 2006

September-25-06

Installing Mojavi 3

posted by admin

Installing Mojavi 3

Written by Sean Kerr and Richard D Shank

First thing

Obviously, you first need to get a copy of the Mojavi 3 source. You can get this from the mojavi.org download page in one of two forms. It can be downloaded as an archive or from the Subversion repository (SVN).

When you have the Mojavi 3 source, it should come with this directory structure:

root
  |
  |---config
  |
  |---phing
  |
  |---php_documentor
  |
  |---source
  | |
  | |---mojavi
  | |
  | |---webapp
  | |
  | |---www
  |
  |---sql

Here is a brief explination of each of the directories

  • config - sample configuration files
  • phing - phing scripts (learn more about phing here )
  • php_documentor - templates for generating Mojavi API docs php Documentor website
  • source - all the source files
  • source/mojavi - the core Mojavi source
  • source/webapp - your web application
  • source/www - web accessible files
  • sql - sql sample files

Installation Steps:

Moving the Mojavi Source

First, move the source/mojavi directory to a non web accessible location, preferrably the parent directory of your root web directory. On most installations this would be the parent directory of your public_html or www directory. On a Windows Apache, this would probably be the parent of the htdocs directory. Move the entire contents of the mojavi directory (including the mojavi folder)

Setting up the webapp

Move the source/webapp directory to a non web accessible location, preferrably the parent directory of your root web directory, which should now have a mojavi directory. Next, give your webapp/cache directory full write permissions. In unix you can type “chmod 777 cache”. On Windows you must go through your webserver to give it write permissions.

You must configure your webapp/config.php configuration file.

There are two lines you need to change

// +---------------------------------------------------------------------------+
// | An absolute filesystem path to the mojavi library. This directory         |
// | contains all the Mojavi packages.                                         |
// +---------------------------------------------------------------------------+
define('MO_APP_DIR', '<DIRECTORY>/mojavi');

// +---------------------------------------------------------------------------+
// | An absolute filesystem path to your web application directory. This is    |
// | where modules are stored.                                                 |
// +---------------------------------------------------------------------------+
define('MO_WEBAPP_DIR', '<DIRECTORY>/webapp');

Replace DIRECTORY with the web directory. Under Linux, it may look like /home/username/. Under Windows (with Apache) it may look like c:/apache/

Here’s the final code

// +---------------------------------------------------------------------------+
// | An absolute filesystem path to the mojavi library. This directory         |
// | contains all the Mojavi packages.                                         |
// +---------------------------------------------------------------------------+
define('MO_APP_DIR', '/home/username/mojavi');

// +---------------------------------------------------------------------------+
// | An absolute filesystem path to your web application directory. This is    |
// | where modules are stored.                                                 |
// +---------------------------------------------------------------------------+
define('MO_WEBAPP_DIR', '/home/username/webapp');

Final Step

Move the index.php file in the source/www directory to your root web directory (the public_html, www or htdocs directory). This file must be accessible from the web. Any location that is accessible via the web will do.

Now you need to configure your web directory’s index.php file that you just moved.

// +---------------------------------------------------------------------------+
// | An absolute filesystem path to our webapp/config.php script.              |
// +---------------------------------------------------------------------------+
require_once('INSERT PATH TO "webapp/config.php" HERE');

// +---------------------------------------------------------------------------+
// | An absolute filesystem path to the mojavi/mojavi.php script.              |
// +---------------------------------------------------------------------------+
require_once('INSERT PATH TO "mojavi/mojavi.php" HERE');

The same directory rules apply here as with the config.php file. Here’s the results

// +---------------------------------------------------------------------------+
// | An absolute filesystem path to our webapp/config.php script.              |
// +---------------------------------------------------------------------------+
require_once('/home/username/webapp/config.php');

// +---------------------------------------------------------------------------+
// | An absolute filesystem path to the mojavi/mojavi.php script.              |
// +---------------------------------------------------------------------------+
require_once('/home/username/mojavi/mojavi.php');

Success

You’re done. Try accessing your index.php file from the web

Technology Blogs - BlogCatalog Blog Directory