That very popular database server is available with majority of Linux distributions. If, however, you have to install it yourself, start with downloading its sources from www.mysql.com.
After extracting, go to directory with MySQL and type this sequence of commands:
$ ./configure --prefix=/usr/local/mysql $ make $ make install $ /usr/local/mysql/bin/mysql_install_db $ chown mysql -R /usr/local/mysql/var $ /usr/local/mysql/bin/safe_mysqld & $ /usr/local/mysql/bin/mysqladmin -u root password new_password
You have to create database if you run LMS for the first time. In order to create database and load it with schema go to LMS directory and run:
mysql -u[user name with database creation rights] -p Enter password:[just enter password :)] mysql> CREATE DATABASE lms CHARACTER SET utf8 COLLATE utf8_polish_ci; mysql> GRANT USAGE ON lms.* TO lms@localhost; mysql> GRANT ALL ON lms.* TO lms@localhost IDENTIFIED BY '[your_password]'; mysql> flush privileges; mysql> use lms; mysql> source doc/lms.mysql;
Because MySQL is default database for LMS, configuration is limited to [database] section setup. Thus you need to edit /etc/lms/lms.ini and fill in password and user's name:
user = lms password = your_password
After this step you should be able to enter your system without any problems. Just write an URL for your LMS installation. If there's no user account (first run), you'll be prompted with form to add username and some personal data. When you enter correct admin personal details LMS will move you to login page, where you can use newly created account.
Let's stop here and add some stuff to cron, for peace of mind:
12 4 3,10,17,21,28 * * /usr/bin/mysqldump -u lms --password=your-super-secret-password \ --add-drop-table --add-locks lms > backups/lms-auto-"$(date +%s)".sql
That will create mysql database backup automagically each 3, 10, 17, 21 and 28 day of month at 4:12 at night.
LMS require PostgreSQL 8.2 or higher. If you have not installed PostgreSQL server, you can compile it yourself from sources available on www.postgresql.org.
That is a short version of installation procedure, more info can be found in Postgres documentation. After you download and extract sources go to main directory and run following commands:
$ ./configure --enable-locale $ gmake $ su $ gmake install $ adduser postgres $ mkdir /usr/local/pgsql/data $ chown postgres /usr/local/pgsql/data $ su - postgres $ /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data --locale=pl_PL.UTF-8 $ /usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data >logfile 2>&1 &
It's required to add in postgresql.conf: custom_variable_classes = 'lms' |
While server is running you can start with adding database and its owner, both named 'lms' and loading database schema:
$ /usr/local/pgsql/bin/createuser -DPRS lms $ /usr/local/pgsql/bin/createdb -E UNICODE -O lms lms $ /usr/local/pgsql/bin/psql -d lms -U lms -f /lms/doc/lms.pgsql
For LMS default database server is MySQL so you have to set following options in [database] section of /etc/lms/lms.ini file:
type = postgres user = lms password = password_entered_with_lms_user_creation
The need for password actually depends on Postgres users authentication configuration found in /usr/local/pgsql/data/pg_hba.conf (refer to Postgresql documentation). By default password is not required and you can comment it with semicolon. |
After this step you should be able to enter your system without any problems. Just write an URL for your LMS installation. If there's no user account (first run), you'll be prompted with form to add username and some personal data. When you enter correct admin personal details LMS will move you to login page, where you can use newly created account.
Let's stop here and add some stuff to cron, for peace of mind:
12 4 3,10,17,21,28 * * /usr/bin/pg_dump -U lms --clean \ lms --file=backups/lms-auto-"$(date +%s)".sql