The current version of LITHIUM|Core has been tested with and is supported on Debian 4.0. Other versions may be compatible however support is not available for them at this time. This document was written using a clean installation of Debian 4.0.
LITHIUM|Core requires the following list of software to be installed and operational prior to being installed. All dependencies can be satisfied using Debian's 'apt' package management system.
Apache 1.3.x or 2.2.x
Note that the default install of Apache on Debian has a pre-configured Welcome Page.
Make sure you disable this by commenting out (or delete) the "RedirectMatch ^/$ /apache2-default/" configuration lines in the /etc/apache2/sites-available/default file.
The Document Root of the server, as required later in this document can be configured in the /etc/apache2/sites-available/defaultfile
This installation guide provides instruction for installing Apache 2 via 'apt' with PHP5/PostgreSQL support
PHP (4.x or 5.x) with PostgreSQL Database Support
Ensure you have installed the libapache2-mod-php5 and php5-pgsql packages to enable PostgreSQL support or compile your own version of PHP with PostgreSQL database support.
If you wish to use PHP4, you can use the libapache2-mod-php4 and php4-pgsql packages instead of the above.
Net-SNMP 5.2
Ensure you have installed the libsnmp package as this is a critical requirement for LITHIUM|Core.
PostgreSQL 7.x or 8.x
Ensure you have installed the postgresql-8.1 package as this is a critical requirement for LITHIUM|Core.
PostgreSQL MUST be configure to allow 'password' authentication, not 'ident same user' as is the default when installed via apt (and possibly from source).
Edit the /etc/postgresql/pg_hba.conf file and set the authentication method to either 'trust' or 'password' depending on your required level of security.
Be careful to only change this for connections to 'localhost' and '127.0.0.1' not 'local'. The PostgreSQL database daemon must be restarted for the configuration changes to take affect.
Failure to do this will result in "Can't connect to db." messages.
Step 1. APT Source Configuration
Add the following line to the apt sources list in /etc/apt/sources.list
deb http://download.lithiumcorp.com.au/debian stable non-free
Then update the APT package source cache by running the following command as root.
The command above must be run as root.
Step 2. LITHIUM|Core Package Installation
Install the 'lithium-core' package via apt-get by running the following command as root.
apt-get install lithium-core
The command above must be run as root.
This will install LITHIUM|Core and all dependencies including PostgreSQL development libraries and LITHIUM|Core support files and libraries.
When prompted you will need to supply the username that Apache runs under on your system. For debian package installations of apache, this is typically www-data
Before proceeding, ensure PostgreSQL is configured for either 'trust' or 'password' authentication for connections to localhost and 127.0.0.1. If you choose 'password' authentication, you MUST ensure that the username and password for the Lithium PostgreSQL database user are set correctly when performing the web-based initial setup of Lithium.
Edit the /etc/postgresql/8.1/main/pg_hba.conf file in your PostgreSQL data directory and set the authentication method to either 'trust' or 'password' depending on your required level of security.
Be careful to only change this for connections to 'localhost' or '127.0.0.1' not NOT 'local'.
The PostgreSQL database daemon must be restarted for the configuration changes to take affect.
Step 1. Ensure PostgreSQL database daemon is running and initialized
Run the following command as root in the terminal to ensure the PostgreSQL database is running and initialized
/etc/init.d/postgresql-8.1 restart
The command above must be run as root.
Step 2. Change your login to the 'postgres' user
Run the following command as root in the terminal to change users to the 'postgres' user
The command above must be run as root.
Step 3. Create a new PostgreSQL database user
This database user account is used by LITHIUM|Core.
Run the following command in the terminal to create the database user for LITHIUM|Core
The command above must be run as the postgres user.
When prompted, enter a password for the user. The user should not be a super user, can create new databases and can not create new users. When completed, the createuser command should return CREATE USER or CREATE ROLE.
An example of the output from the createdb command is shown below:
postgres@db-server$ createuser -P lithium
Enter password for new user:
Enter it again:
Shall the new user be allowed to create databases? (y/n) y
Shall the new user be allowed to create more new users? (y/n) n
CREATE USER
Step 4. Create a new PostgreSQL Database
This database will be used by LITHIUM|Core.
Run the following command in the terminal to create the database for LITHIUM|Core.
The database MUST be called 'lithium' and MUST be owned by the user created in the previous step (typically 'lithium')
createdb --owner lithium lithium
The command above must be run as the postgres user.
When completed, the createdb command should return CREATE DATABASE. An example of the output from the createuser command is shown below:
postgres@db-server$ createdb --owner lithium lithium
CREATE DATABASE
Step 5. Logout as 'postgres' user
You can now logout as the 'postgres' user. This is important as the commands in the following section must be run as your user account, not the 'postgres' user account.
Run the following command in the terminal to logout as 'postgres'
Web Installation
The installation of the .deb packages will install the HTML/PHP documents for LITHIUM|Core in /var/lithium_web. This is the 'Document Root' directory for LITHIUM|Web. You can either copy/link these files to your current Apache document root or reconfigure Apache to use /var/lithium_web as the Document Root for your installation of Apache.
To link the default Document Root location to the LITHIUM|Web documents installed by the deb packages, use the following commands as root. Note this assumes a default installation of Apache:
cd /var/www
ln -s /var/lithium_web lithium
The commands above must be run as root.
Note that the default install of Apache on Debian has a pre-configured Welcome Page.
Make sure you disable this by commenting out (or delete) the "RedirectMatch ^/$ /apache2-default/" configuration lines in the /etc/apache2/sites-available/default file.
Alternatively, examine and edit the /etc/apache2/sites-available/default file or similar to check/set the Document Root for your installation of Apache.
You MUST install PHP with support for the PostgreSQL database. Make sure you have installed the libapache2-mod-php5 and php5-pgsql packages before proceeding to the web-based setup. (If you want to use php4, you can use the corresponding libapache2-mod-php4 and php4-pgsql packages.)