LITHIUM|Core has been tested and is supported with Ubuntu 6 LTS and 7. Other versions may be compatible however support is not available for them at this time. This document was written using a clean installation of Ubuntu 6LTS.
LITHIUM|Core requires the following list of software to be installed and operational prior to being installed. All dependencies can be satisfied using the 'apt' package management system.
Apache 1.3.x or 2.2.x
Note that the default install of Apache on Ubuntu 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.
Net-SNMP
Ensure you have installed the libsnmp9 package as this is a critical requirement for LITHIUM|Core.
PostgreSQL 7.x or 8.x
Ensure you have installed the postgresql package as this is a critical requirement for LITHIUM|Core.
PostgreSQL MUST be configured to allow 'password' authentication from localhost, not 'ident same user' as is the default when installed via apt (and possibly from source).
Edit the /etc/postgresql/8.1/main/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/or '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/ubuntu edgy non-free
First, import the Lithium GPG key and add it to the apt keyring as root. Note that this step may be omitted, but users will be prompted by apt that the "signatures could not be verified because the public key is not available."
The use of GPG signed files is an optional security precaution.
wget http://download.lithiumcorp.com/keys/ubuntu.gpg.asc
gpg --import ubuntu.gpg.asc
gpg --export --armor DD1F06DE | apt-key add -
The command above must be run as root.
Step 2. LITHIUM|Core Package Installation
Then update the APT package source cache by running the following command, then install the 'lithium-core' package via apt-get by running the following command as root.
apt-get update
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 Ubuntu 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.
Edit the /etc/postgresql/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 '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 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 packages via apt 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 install by apt, use the following commands as root. Note this assumes a default installation of Apache:
This step assumes you have done a new install of apache2 and do not serve any other web pages from the computer you are installing Core on to. If you use the computer to serve other pages, you will need to modify these steps to suit such that the /var/lithium_web directory is the web root for a new virtual-host.
cd /var
mv www www_install
ln -s /var/lithium_web www
The commands above must be run as root.
Note that the default install of Apache on Ubuntu 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, and then restarting Apache.
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