Note: You are currently viewing documentation for Moodle 1.9. Up-to-date documentation for the latest stable version is available here: Step-by-step Install Guide for Solaris 10 with Oracle 10.

Step-by-step Install Guide for Solaris 10 with Oracle 10

From MoodleDocs
Installation Documentation
for
Moodle at VDAB


Table of Contents1 Purpose of this document1

2 Setting up the Oracle Database2

3 Configuring Apache2

3.1 Install Apache2

3.2 Install OCI 8 and Oracle Instant Client3

3.3 Install PHP4

3.4 Change PHP settings6

3.5 Add GNU Coreutils7

4 Install Moodle7

4.1 Prepare the Moodle installation files7

4.2 Choose installation language8

4.3 Check PHP settings8

4.4 Set installation and data directories10

4.5 Set Database connection11

4.6 Server checks for installed components12

4.7 Install language packs19

4.8 Confirmation for written configuration file.21

4.9 Licence agreement21

4.10 Release information21

4.11 Automatic database setup22

4.12 Setting up the administrator account23

4.13 Set up Frontpage24

4.14 Start with empty Moodle25

4.15 Add template Purpose of this document This document provides an in-depth installation manual for Moodle on Solaris 10 with Oracle 10.2.0.2.

We provide an overview of the different steps involved:

  • Preparing Oracle 10g for a large Moodle installation
  • Configuring Apache 2.2 for a secure and high-performance webserver
  • Preparing all necessary PHP packages for Apache and Oracle
  • Preparing PHP settings for Moodle
  • An overview of the steps in the Moodle installation wizard.

Setting up the Oracle Database

We set up 2 parallel Moodle installations on one and a database on a separate server. Both installations share the same Oracle database, but use a different tablespace.

The Oracle 10.2.0.2 database runs on a Solaris 10 and is set up using Oracle's DBCA tool.

  • This is testzone1 on the test server testitis00
  • Database name = testitis02.vdab.be
  • We used the General purpose template for the database set-up;
  • And set UTF8 character encoding to NLS_LANG=AMERICAN_AMERICA.AL32UTF8

For each Moodle installation we create a separate Tablespace:

  • First Moodle installation on testzone2:
    • MOODLE_DATA with initial size of 300MB
    • User: MOODLEUSER, password: moodle
    • The user only has rights within the specified tablespace
  • Second Moodle installation on testzone3:
    • MOODLE_DATA2 with initial size of 300MB
    • User: MOODLEUSER2, password: moodle
    • The user only has rights within the specified tablespace

Configuring Apache

Install Apache

First download the latest Apache e.g. httpd-2.2.8.tar.gz from http://httpd.apache.org/download.cgi to the folder /usr/local/apache2

Log in as root, uncompress the Apache files and go to the installation folder.

# gzip -d httpd-2.2.8.tar.gz

# tar -xvf httpd-2.2.8.tar

# cd httpd-2.2.8

Adapt the Environment Variables to make sure the correct gcc and make are used.

# export PATH=$PATH:/usr/sfw/bin:/usr/ccs/bin:.

Configure and make Apache:

# make clean --> only if necessary

# ./configure \

--prefix=/usr/local/apache2 \

--with-included-apr

# make

# make install

In order to increase performance edit the following in the httpd.conf file:

# vi /usr/local/moodle_1.9+/moodle/httpd.conf -- > opens text editor

DirectoryIndex index.php

Listen 8002 -- > for VDAB

DocumentRoot “/usr/local/moodle_1.9+/moodle”

AcceptPathInfo on

If you're running Moodle on Oracle with Apache on Linux, you might have issues with PHP being able to see the system environment variables. To resolve this, you can edit /etc/sysconfig/apache2 and add the following lines to the bottom:

LD_LIBRARY_PATH=/opt/oracle/instantclient_11_2# Set LANG Variables for UTF-8
NLS_LANG=AMERICAN_AMERICA.AL32UTF8
LANG=en_US.UTF-8
LC_ALL=en_US.UTF-8
LC_COLLATE=en_US.UTF-8
LC_CTYPE=en_US.UTF-8
LC_MESSAGES=en_US.UTF-8
LC_MONETARY=en_US.UTF-8
LC_NUMERIC=en_US.UTF-8
LC_TIME=en_US.UTF-8
export LANG LC_ALL LC_COLLATE LC_CTYPE LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIM NLS_LANG LD_LIBRARY_PATH

Also need to add those two lines to ~/.bashrc so that the PHP command-line client can see it too.


Install OCI 8 and Oracle Instant Client

Download the 32bit Solaris Basic en SDK: instantclient-basic-solaris6432-10.2.0.3-20070101.zip and

instantclient-sdk-solaris6432-10.2.0.3-20070101.zip from

http://www.oracle.com/technology/tech/oci/instantclient/index.html to a folder e.g. /oracle/product.


Log in as the user oracle and uncompress the installation files:

$ cd /oracle/product

$ unzip instantclient-basic-solaris6432-10.2.0.3-20070101.zip --> creates the directory instantclient_10_2

$ unzip instantclient-sdk-solaris6432-10.2.0.3-20070101.zip --> is put into the directory instantclient_10_2


Adapt the tnsnames to set an alias or Oracle net service name. Each net service name entry contains connect descriptors that define listener and service information.

$ cd $TNS_ADMIN --> for VDAB this is /var/opt/oracle)

$ vi tns_admin _--> Below an example adaptation:_

moodle =

(DESCRIPTION =

(ADDRESS =

(COMMUNITY = TCPDEV.world)

(PROTOCOL = TCP)

(HOST = testzone1)

(PORT = 1521)

)

(CONNECT_DATA =

(SID = testitis02)

)

)


If necessary, create and adapt a sqlnet.ora file. For VDAB this was not necessary.


Create two Symbolic Links.

$ ln -s /oracle/product/instantclient_10_2/libclntsh.so.10.1

/oracle/product/instantclient_10_2/libclntsh.so

$ ln -s /oracle/product/instantclient_10_2/libocci.so.10.1

/oracle/product/instantclient_10_2/libocci.so

Install PHP

To install PHP on the Apache server, download php-5.2.5.tar.gz from http://www.php.net/downloads to the folder /usr/local/apache2

Log in as root, uncompress the PHP files and go to the installation folder.

# gzip -d php-5.2.5.tar.gz

# tar -xvf php-5.2.5.tar

# cd php-5.2.5

Adapt the Environment Variables to make sure the correct gcc and make are used.

# export PATH=$PATH:/usr/sfw/bin:/usr/ccs/bin

# export LD_LIBRARY_PATH=/oracle/product/instantclient_10_2

The following table provides a brief overview of the PHP extensions and what they are used for. All of these are required to do a fully functional Moodle installation.


PHP Extensions
Description
GD

Freetype 2

GD is commonly used to generate charts, graphics, thumbnails, etc. on the fly.

Freetype provides an API to manipulate fonts.

Moodle uses these modules to generate dynamic graphs from the logs.

OCI8 Required connector for Oracle
zlib (alternatively use zip or unzip) Zlib is required for zip/unzip funcitonality based on the deflate compression method.

Moodle itself can also handle this functionality, but this impacts the use of server resources.

curl curl is a client to get files from servers. It is used for handling files using a wide variety of protocols.

This is a requirement for Moodle 1.8 and later



openssl Library to enable secured connections to a server. This is mainly used for connections between Moodle installations e.g. to share courses.
php5-LDAP Enables the use of LDAP functions in PHP
aspell-xx The optional aspell modules provide a free spelling checker functionality embedded in Moodle. This module support a very large number of languages. XX represents the 2-letter code for the language.

For a default Solaris most of these modules are available by default. We only need to install curl and enable these modules in the Apache-Php configuration.

We first install curl. Download the package curl-7.18.1.tar.gz from http://curl.haxx.se to /usr/local/apache2.

Log in as root, uncompress the curl files and go to the installation folder to make and install.

# gunzip curl-7.18.1.tar.gz

# tar -xvf curl-7.18.1.tar

# cd curl-7.18.1

# ./configure

# make

# make install

In order to test the curl installation do

/usr/local/bin/curl -V

If necessary, extend PATH to /usr/local/bin. This was not necessary for VDAB.

Next, we will configure, and install the PHP for Apache make links to the PHP extensions.

# cd /usr/local/apache2/php-5.2.5

# ./configure \

--with-apxs2=/usr/local/apache2/bin/apxs \

--with-config-file-path=/usr/local/apache2/conf \

--with-oci8=instantclient,/oracle/product/instantclient_10_2 \

--enable-sigchild \

--enable-mbstring \

--with-gd \

--with-openssl \

--with-curl=/usr/local/apache2/curl-7.18.1

--with-ldap=/usr/local

# make

# make install


Change PHP settings

By default there is no php.ini file. However, there is a php.ini-recommended which we will use to make the required adaptations listed in the table below. Afterwards we will make a copy of this file and make it the active Php configuration file.

# vi /usr/local/apache2/conf/php.ini-recommended --> Open text editor and make adaptations

# cp /usr/local/apache2/php-5.2.5/php.ini-recommended /usr/local/apache2/conf/php.ini

In the file edit the following settings:


Setting
Value we used in php.ini
Safe mode must be off ; Safe mode

safe_mode = Off

memory_limit is at least 128MB ; Resource Limits

memory_limit = 128M ; Maximum amount of memory a script may consume

session.save_handler needs to be set to FILES. [Session]

; Handler used to store/retrieve data.

session.save_handler = files

magic_quotes_gpc needs to be ON

magic_quotes_runtime needs to be OFF

; Magic quotes for incoming GET/POST/Cookie data.

magic_quotes_gpc = On

; Magic quotes for runtime-generated data, e.g. data from SQL, from exec(), etc.

magic_quotes_runtime = Off

file_uploads needs to be ON ; Whether to allow HTTP file uploads.

file_uploads = On

session.auto_start needs to be OFF ; Initialize session on request startup.

session.auto_start = 0

session.bug_compat_warn needs to be OFF session.bug_compat_warn = 0
post_max_size is too small by default and needs to be increased e.g. when you run into problems while creating online content ; Maximum size of POST data that PHP will accept.

post_max_size = 300M

upload_max_filesize needs to be increased e.g. to allow uploading larger course packages ; Maximum allowed size for uploaded files.

upload_max_filesize = 300M

magic_quotes_sybase should be on for Oracle installations. magic_quotes_sybase = On

Add GNU Coreutils

Also install the GNU Coreutils for Solaris in order to avoid Apache error described in case MDL-6850 . The Coreutils will include the du command which is required by Moodle to collect and calculate data on file sizes.

Download coreutils-6.4-sol10-sparc-local.gz from http://www.sunfreeware.com/solaris_2.5_list.html#coreutils to your global zone as root .

gunzip coreutils-6.4-sol10-sparc-local.gz

pkgadd -d coreutils-6.4-sol10-sparc-local.gz

Go to Administration > Configuration > Variables > Operating System and enter the path to entry pathtodu to the GNU du in /usr/local/bin/du (was /usr/bin/du) .

Set the correct path in the Moodle administration interface. Go to Administration > Server > System Paths and fill out the correct path in the Path to du entry.

Install Moodle

Prepare the Moodle installation files

Now that we have completed the set-up for Apache, PHP, Oracle and the connection between PHP and Oracle we prepare for the Moodle installation.

Log in as root and create a moodle user assigned to a group and set a password.

# mkdir /export/home/moodle

# useradd -u 1005 -g 101 -d /export/home/moodle -s /bin/bash -c "Moodle" -m moodle

# chown moodle:users /export/home/moodle

# passwd moodle

Log in as root to create a directory for the Moodle installation:

# mkdir /usr/local/moodle_1.9+

# chown moodle:users /usr/local/moodle_1.9+

Download moodle-weekly-19.tgz from http://download.moodle.org/. Log in as the user moodle and copy the file to /usr/local/moodle_1.9+ and uncompress the file:

$ gunzip moodle-weekly-19.tgz

$ tar -vxf moodle-weekly-19.tar --> creates subdirectory 'moodle'

Now log onto the system where you will install Moodle e.g. testzone3 on server testitis03 as the user moodle.

Set the environment variables, preferable in the .profile of the de user moodle:

$ export ORACLE_HOME=/oracle/product/instantclient_10_2

$ export LD_LIBRARY_PATH=$ORACLE_HOME

$ export TNS_ADMIN=/var/opt/oracle

$ export PATH=$PATH:/usr/local/bin:/local/bin:.

Start Apache with the configuration file adapted to moodle:

$ /usr/local/apache2/bin/apachectl -k start -f /usr/local/moodle_1.9+/moodle/httpd.conf

If desired you can install other languages during the installation wizard by downloading the appropriate language files e.g. Dutch (http://download.moodle.org/lang16/nl_utf8.zip) to /usr/local/moodle_1.9+/moodledata/lang and uncompress the file.

# unzip nl_utf8.zip

A list of additional languages is available from the administration interface. Moodle then automatically downloads and installs the selected languages.

Choose installation language

Choose the installation language from the drop-down list. This choice only applies to the installation wizard.

Click the next button to continue.

Image001.jpg

Check PHP settings

If you followed the above mentioned instructions for php, you should get the following screen.

In case of a Fail, recheck the PHP settings in php.ini.

Image002.jpg

Set installation and data directories

In this step you define the basic locations of all Moodle-related files. Unless you chose a different location for the moodledata folder you do not need to change anything.

It is adviseable to keep the Moodle software and the data (courses, uploaded assignments etc.) separately;

In case of VDAB the web address is e.g. testzone2 or testzone3 and the data directory is /usr/local/moodle_1.9+/moodle

Image003.jpg

Set Database connection

In this step we will set up the connection to the database:

  • Select Oracle from the drop-down list
  • For an Oracle installation, leave the Host entry empty
  • Provide the name of the Oracle database you created e.g. moodle
  • The database admin username and password
  • Add a table prefix e.g. m_

Image004.jpg

Server checks for installed components

The installation wizard will now perform an availability check on the required System Components.

If you checked all the required PHP settings and modules during the pre-installation phase, you should get the following screen.

Image005.jpg

Install language packs

Since we chose a Dutch installation, we now get an option to download the Dutch language files for the user interface. Provided you have direct write access to the Moodle server, the set-up of the language pack is automatic.

File:Image006.jpgIf the download is unsuccessful, you will get the error message below. To resolve this problem, you can either:

  • Select other languages by using the Administrator interface when the installation is complete (Administration > Language > Language packs).
  • Unzip the language file on the server in the lang files directory e.g. <path to Moodle directory>/moodledata/lang

Image007.jpg

Confirmation for written configuration file.

All the settings we made in prior steps are now collected and written to the Moodle configuration file (config.php).

Image008.jpgIn this step, the basic Moodle configuration is complete. In the next steps, the setup will add the database tables and prepare Moodle for use.

Licence agreement

Carefully read and accept the licence agreement before proceeding to the final installation steps.

Image009.jpg

Release information

This page provides the release information and the possibility to perform the following steps automatically (unattended). We will simply click next in order to capture potential setup errors.

Image010.jpg

Following steps can be performed automatically (unattended) or with manual confirmation.

Automatic database setup

What follows is a series of screens for the setup of the database tables for all of the standard Moodle components. Apart from clicking next, no user interaction is required.

Image011.jpgAfter each sequence a confirmation of success appears.

Image012.jpgThis is the final step in the database set-up sequence.

Image013.jpg

Setting up the administrator account

Now that the system is ready, we only need to provide details for an initial administrator account.

These data can be changed and/or complemented later. This is the account that will initially be used after installation to allow further configuration of the system.

Image014.jpg

Set up Frontpage

During this final step of the installation wizard, we will put:

  • The Full site name e.g. the name of the institution. This will be visible in the title bar in all of the standard templates.
  • As Short name for the site.
  • A Front page description of the site. This will be displayed as a welcome message on the start page.

Image015.jpg

Start with empty Moodle

We are then automatically redirected to the Moodle start page. Our Moodle is up and running and we can now continue with the configuration of the system.

Image016.jpg

When we click Turn editing on we can start the configuration. We will need to verify the system location of some additional components. The installation procedure does not check for the availability of a zip program. Moodle especially needs zip and unzip when handling SCORM packages. Using the built-in unzip feature may impact server performance.

Image017.jpg

Add template

To add a theme to a Moodle installation:

  • Extract a theme to /usr/local/moodle_1.9+/moodledata/theme
  • Log into Moodle as admin, go to Site Administration >Appearance >Themes > Theme Selector
  • Select the theme from the list.


See also