<<

Setting up x86 for Moodle and Oracle:

**Based (almost entirely) on Ben Wilkoff's instructions Which can be found here • http://learningischange.com/2009/05/29/install-moodle-on-an-oracle-database-in-25-minutes-or-less/ • http://docs.google.com/View?id=dcxbprxw_462dg462qcr

Reference Docs: ▪ Red Hat Linux Moodle Installation Document ▪ RPM files about Oracle on Red Hat ▪ Oracle Database Instant Client ▪ Linking Oracle and Moodle ▪ Getting Moodle to talk to Oracle Database from the install screen ▪ Php configure with oci8 ▪ Help Document for starting Apache in Red Hat.

What is needed: • 5 (RHEL 5) • An Oracle Database with a UTF-8 character set Step 1: Install server apps/addons Open up terminal and connect to the server using SSH: • ssh @ mymoodle.site.edu

Create tnsnames.ora inside the /etc directory: • cd /etc • sudo vim tnsnames.ora • Insert mode: i

Paste this into tnsnames.ora: db_moodle = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = ip.or.dns.of.database.server) (PORT = 1521) ) (CONNECT_DATA = (SID = NAME_OF_THE_DATABASE_IN_ORACLE) ) ) Save and quit: • Hit the escape button: esc • Type semi-colon w q (i.e., write quit): :wq

Install php and apache using the command from within a superuser account: • sudo yum install httpd php (these should both come up as having already been installed)

Install php addons (pear, gd, ldap using the yum command from within a superuser account): • sudo yum install php-pear php-gd php-ldap php-devel php-xmlrpc php-mbstring

Install gcc: • sudo yum install gcc gcc-c++ autoconf automake

Stop-Start Apache using the redhat start script: • sudo /etc/init.d/httpd stop • sudo /etc/init.d/httpd start Step 2: Set Up Moodle Directories, download moodle Navigate to web accessible directory: • cd /var/www/html

Get latest version of Moodle using wget: • sudo wget http://download.moodle.org/stable19/moodle-weekly-19.zip

Unzip Moodle: • sudo unzip moodle-weekly-19.zip

Make Directory Writable to allow the install script to create the config.php: • sudo chmod -R 0777 moodle

Create a directory for Moodle Data and then set permissions for it, making sure that this directory is not web accessible: • cd /var/www • sudo mkdir moodledata • sudo chmod -R 0770 moodledata • sudo chown -R apache moodledata • sudo chgrp -R nobody moodledata Step 3: Install Oracle Client Install the Oracle Instant Client inside /var/instantclient/:

Create the directory. • cd /var • sudo mkdir instantclient • cd /var/instantclient

Download both the 32-bit "Basic" and the "SDK" versions (which are here) and put them on a web server you have access to. Then... • sudo wget http://server.youhaveaccessto.com/instantclient-basic-linux32-11.1.0.7.zip • sudo wget http://server.youhaveaccessto.com/instantclient-sdk-linux32-11.1.0.7.zip • sudo unzip instantclient-basic-linux32-11.1.0.7.zip • sudo unzip instantclient-sdk-linux32-11.1.0.7.zip

Go into the Instant Client Directory that was created by unzipping and make a couple of symbolic links: • cd /var/instantclient/instantclient_11_1 • sudo ln -s libclntsh.so.11.1 libclntsh.so • sudo ln -s libocci.so.11.1 libocci.so

Use Pear to install oci8 support for PHP (the connection from PHP to Oracle) • sudo peardev install pecl/oci8 ...When it asks you for the directory to the instantclient, paste the following: • instantclient,/var/instantclient/instantclient_11_1(Or whatever version number the folder is) Step 4: Edit php.ini In setting up the Oracle and Php Communication, open up the php.ini file in /etc and make the following modifications: • cd /etc • sudo vi php.ini • Type the letter: i (insert) • Make these changes:

magic_quotes_sybase = On (Change under Data Handling) extension=oci8.so (Add under Dynamic extensions) memory_limit = 48M (Change under Resource Limits)

• Hit the escape button: esc • Type semi-colon w q (write quit): :wq

Stop-start Apache (no restart): • sudo /etc/init.d/httpd stop • sudo /etc/init.d/httpd start Step 5: Setup a Cron process Set the Cron Process by navigating to the /etc directory and putting the command in the crontab (here is a crontab tutorial): • cd /etc • sudo crontab -e • Production server: */30 * * * * wget -q -O /dev/null http://mymoodle.site.edu/admin/cron.php Step 6: Move moodle installation to root Move contents of Moodle folder to root: • cd /var/www/html • mv moodle/* ./ • rm -rf moodle/

Edit config.php (update the URL): • vim config.php

Change these lines: From: $CFG->wwwroot = 'http://mymoodle.site.edu/moodle'; $CFG->dirroot = '/var/www/html/moodle';

To: $CFG->wwwroot = 'http://mymoodle.site.edu'; $CFG->dirroot = '/var/www/html';

Remove zip archive from root directory: • rm -R moodle-weekly-19.zip

Step 7: Install Moodle Go to the Moodle Installation directory via a browser. Enter in the following information for moodle directories:

Web address: http://mymoodle.site.edu Moodle Directory: /var/www/html Data Directory: /var/www/moodledata

In the database connect screen format the database information into the following format:

Type: Oracle (oci8po) Host Server: [blank] Database: db_moodle (or whatever your DBA gave you... see tnsnames.ora) User: moodle (or whatever your DBA gave you... see tnsnames.ora) Password: •••••••••••• (or whatever your DBA gave you... see tnsnames.ora) Table prefix: m_

Keep on clicking next and okay and you should be able to get all the way through to the end...