Installation

Make sure you have all the required components to run Inventory

1. Get the Inventory Package, and unpack it
(If you're reading this you've probably already figured that one out by yourself :-) )
Get the latest Inventory package from SourceForge.
Once you have it (file will be called something like: inv-0.80.tgz), unpack the file:
Under UNIX you can use:

tar -zxvf inv-0.80.tgz

Under Windows you can use utilities such as Winzip.
2. Move the Inventory directory under your webserver's root
There are a few options to do this:
- If your webserver's root sits at a folder, say /var/www/html - you can move the new inv folder there using:

mv inv /var/www/html

- Alternately you can map the inv directory, to the webserver by changing the server's internal configuration. Under Apache it's done using Alias and <Directory> directives. (And the same can be acheived by IIS).
(In any case how to do this is not covered here.)

The end result should be that the inv directory is accessible from your webserver.
This document will assume that Inventory is accessible through the URL /inv/ on your webserver.
3. Create the Inventory database
When accessing MySQL for this step and the next, you can do it in several ways: using graphical tools to manage the database, Web based tools like phpMyAdmin ,or the command line client supplied with MySQL installation. The directions here are for the command line client since it is most commonly found. You can easily adapt the procedure for use with your favorite management tool.

You need to use the file: database.init.mysql found in the SQL directory in the distribution.
First you need to decide how to name your database. The default value in the file is 'inventory' - if that is ok with you, you don't need to make any changes to the file. If not, you'll need to edit the file and change around line 16:

create database if not exists inventory;
use inventory;

Change the word 'inventory' in both lines to whatever you want to call your database. Remember that you will also have to adjust your settings (see below) to match this change.

Use the file to create the database and tables running this command:

mysql -u root -p < SQL/database.init.mysql

Explanation of the command: If the MySQL client does not complain (no errors) - the database has been initialized.

Now use the same method to initialize default data: (from Inventory version 0.82 you can initialize the database in your local language, if supported by Inventory).

mysql -u root -p inventory < SQL/defaults.english.mysql

Note that 'inventory' should be replaced with your DB's name (whatever you chose at the beginning of this step).

The example above initializes the database with English data (default, use this option if unsure). Look inside the SQL/ directory for more files of the format defaults.???.mysql - you may initialize with a file of your local language. (remember to initialize only once, meaning that you must choose one of the supplied files, and initialize with it. After the init is done, you should not repeat the process, rather you can change settings using the web interface).
Again, if you get no errors, you're ready to proceed with the next stage.

4. Create a user for Inventory under MySQL
See the remarks about MySQL client in the previous step.

The file used to create a user is also in the SQL directory and is called create.user.mysql
You may want to make some modifications before running it. The file contains only 1 line to SQL commands around line 17 in the file:

grant select,insert,update,delete on inventory.* to inv@localhost identified by 'testing';

You may want to change the following: It is recommended that (at least) you change the password to something other than 'testing'.

Now dump the file into the mysql client (same as the previous step), by this command:

mysql -u root -p < SQL/create.user.mysql

If there are no errors from the client - the command succeeded.

5. Edit Inventory cfg.php file

This section explains how to use the cfg.php file which is the main configuration file. This file is located under the include/ directory.

You will first need to make a copy of your cfg.defaults.php file:

cd inv/include/
cp cfg.defaults.php cfg.php

Without a copy of cfg.php, Inventory will not work.

Edit the cfg.php file to change the variables inside.

Each line in the file that starts with // is a comment and can be ignored. (These are used to give a short explanation of what each variable means).
Each line that is not a comment defines a variable. You must not change the names of the variables, just the contents - which means anything right to the = sign. If the value is in double-quotes " you must leave them and only change what's inside. Also, do not remove the semi-colon ; sign from the end of the line.

Here are the definitions:

$inv_db['host'] = "localhost";

This is the host name where the MySQL database is running as a service. If the Web-Server and Database Server are on the same machine "localhost" will usually do; otherwise you need to specify the host name where the MySQL server is hosted. If MySQL is running on a port different than standard, say port 4321 you may specify it by: "myhost:4321".

$inv_db['user'] = "inv";

This is the username to connect to MySQL with. Use the name defined in step #4.

$inv_db['pass'] = "testing";

This is the password to connect to MySQL with. Use the value defined in step #4.

$inv_db['db'] = "inventory";

This is the database name to use. Use the value defined in step #3.

$inv_data['base'] = "/inv/";

This is the path part of the URL where Inventory will be served. This is defined by your web sever and where you put Inventory under it. If your web server serves: http://www.me.org then Inventory will be served under: http://www.me.org/inv/

$inv_data['theme'] = "default";

This defines which theme to use with Inventory. This is the name of the directory that holds the theme and is found under themes/

$inv_data['lang'] = "english";

This defines which language to use with Inventory. The language should be installed in the langs/ sub directory.

$inv_data['display'] = 10;

Default value for the 'Display Rows' variable. This is the number of lines (per page) to display to a user when showing a list of items. This defines the default; the value can be set individually for each user in the system under 'User Management'.

$inv_data['duration'] = 60;

Default value (in minutes) for 'Session Timeout'. The 'Session Timeout' will automatically logout a user after using the system for a predefined amount of time. (This helps prevent unauthorized usage of the system when the browser is left open). This value can be individually set for each user using the 'User Management' menu.

$inv_data['edit'] = 0;

This setting defines if the configuration file may be edited through the web interface Inventory provides. There are three possible values for this variable: When enabled, editing will allow admin users to change the settings in the cfg.php file via the web interface (and overwrite the file). This function is accessible under the 'Other Tasks' menu and is only visible when enabled. Use this option with caution, since it will all ALL your Admin users to view and change these settings.

$inv_data['tmpDir'] = "/tmp/";

This setting defines the location of the temp directory where Inventory may write files. This directory should be writable for the web server process, and should be specified with a trailing / sign. The path may be absolute or relative.
6. Login to Inventory
You should now be able to login to Inventory:
- Navigate your browser to the URL where you installed Inventory
- You should be presented with a login screen - Enter with user 'admin' password 'admin'
(We recommend that the first thing you do is change the password for the 'admin' account).
7. Security Considerations
We recommend that you take a moment to review security considerations for your Inventory installation.