##Version 1.3.3 (15/10/2009)
These instructions are created to add the Welcome Application to Moodle 1.9 and XAMPP over Windows, Mac and Linux
I. Installation Apache+Mysql+PHP
1) Installation Apache+Mysql+PHP
-Windows:
Download Xampp and Moodle version 1.9 (http://download.moodle.org/download.php/windows/MoodleWindowsInstaller-latest-19.zip) *
-Linux:
You have to install Apache + PHP follow the instruccions of your linux distribution.
Or you can download Xampp for linux too (http://www.apachefriends.org/en/xampp-linux.html). Installed on /opt/lampp. You have to set Register_globals = Off in /opt/lampp/etc/php.ini
Then you have to download source code from http://download.moodle.org/download.php/stable19/moodle-weekly-19.tgz
Unzip the source code in your working directory, second step will show how configure it.
-Mac OS X:
Download Xampp and Moodle version 1.9 (http://download.moodle.org/macosx/) *
* Using Xampp and Moodle in Windows or Mac OS X you have to do:
Windows
Run <unzipped folder>/Start Moodle.exe
Run <unzipped folder>/Stop Moodle.exe
Mac OS X
Run <unzipped folder>/Start Moodle.sh
Run <unzipped folder>/Stop Moodle.sh
These two instructions will create the final structure
Edit php.ini (usally in php/apache2/php.ini or <folder>/server/php/php.ini) and make sure:
extension=php_soap.dll
Commented with ; by default, the comment should be deleted.
soap.wsdl_cache_enabled=0
By default, its value is 1, it should be put to 0.
max_execution_time = 0
Assign the value 0, which means "without limit".
error_reporting = E_ALL & ~E_NOTICE
In order to get all the error messages and alerts in the execution of the PHP files.
display_errors = stderr
Display errors to STDERR (affects only CGI/CLI binaries!)
error_log = <folder>/filename
Log errors to specified file.
To improve performance go at the end of document
II. Installation Gateway + OkiBus Server + Components
FILE GatewayMoodle_OkiBusServer_Components-1.3.3.zip
2)Unzip the content of the zip
-Content of folder "server" will be overwrite your Moodle folder and will be in "Directory" directive. When asks you Replace you have to Accept All.
-Folder "okibusCommon" is to be included (php_value "include_path").
-Folder "configuration" files of configuration, every file is setted via VirtualHost (SetEnv name_enviroment pathToConfigurationFile).
You can define your own virtualhost (Information of Virtual Host at the end of this document). The file "vhost_Gateway_OkiBusServer_Components_moodle.conf" will be found in zip file, and is a template, you have to change <folder> for the real path.
To include this file you have to edit configuration file of Apache2 (httpd.conf or apache2.conf, in Windows distribution is in <folder>/server/apache/conf) and add this line:
Include <folder_to_unzipped_vhost>/vhost_Gateway_OkiBusServer_Components_moodle.conf
Test OkiBusServer Configuration (<folder_to_unzipped_vhost>/configuration/):
It's very important to test if configuration of OkiBus Server is correct. The page will show:
-Classes of include_path are correct.
-PHP_OSID_2.0 classes.
-PHPUtils classes.
-Classes loaded via configuration file are correct.
-Classes of moodle Implementation of OkiBusPHPServer.
-Context parameters.
-Test if contexts params are the same in OkiBusPHPServer.
-Configuration of temp directory. This folder is used by OkiBusServer, it should exist and be writable. To configure you have to edit
configuration/okibusPHP.okibusServer.moodle.properties
And set Param tmp_dir
tmp_dir=/tmp
##Using Moodle and XAMPP on Windows or Mac OS X
##tmp_dir=C:\\xampplite\\server\\moodledata\\temp
And create corresponding log directory
-Replace the templates (okibusPHP.componentsServer.moodle.properties and okibusPHP.okibusServer.moodle.properties)
These files configuration are a template and you have to change <folder> to the real path point to /server/moodle. For example if you have c:\\xampplite\\server\\moodle you have to replace "<folder>" by "c:\\xampplite" (Note for Windows Users, you have to scape "\" with "\\"). Warning you have to change in the 2 files
Access:
http://localhost/testServerClasses/testClasses.php
If anything is wrong will show you in red color. Fix these errors before continue.
If everything goes fine it will display a line in red: "Error 0 class not found"
3) Restart Apache2
4) Go to http://localhost/moodle
5) Follow all the steps of moodle installation
6)In "Site Administration" menu go to Users->Authentication (in Moodle 1.9+ then you have to go Manage authentication)
7)Enable "okiserver"
8)Log out
9)Log in as admin
10)In "Site Administration" menu go to Modules->Activities (in Moodle 1.9+ then you have to go Manage activities)
11)Hide modules "appinstaler" and "okiserver" in order to don't show in course
III.Installation welcomePHPApp on the same server
FILE WelcomePHPApp_VersusMoodle-1.3.3.zip
12)You have to unzip at the same level of Moodle
13)To be installed you have to click on "settings" on Modules->Activities "appinstaler" (in Moodle 1.9+ then you have to go Manage activities)
14)Fill all the fields with these values
//Application Name to Install (can't contains blanks space, numbers and specials characters, and has to be lowercase)
App Name: welcomelocal
//Application Version to Install
Version: 1
//URL to Install the new application
Install URL: http://localhost/WelcomePHPApp/install.php
//URL to Execute in the new application
Execute URL: http://localhost/WelcomePHPApp/index.php
//It's identified the webapps of launcher
Launcher Relative URL: /LauncherPHP/launcher/launcher.php
15)Click button "Install"
16)Then you have to wait to see the "Result of appInstaler"
17)If everything is ok you will see
welcomelocal: Install page
Success!
Installation completed
18)Click "Continue" button
19)Click Notifications on "Site Administration" menu
20)welcomelocal Application will be installed and click "Continue"
21)Add a new user to be a Role Teacher on the course (in "Site Administration"->Users->Accounts->Add a new user)
22)Add a new course
23)Set the user as a Teacher Rol in the course (if you set "admin" as a Rol "teacher" may don't work)
24)Log out.
25)Log in as user teacher.
26)Go to the course
27)Click "Turn editing on"
28)Add a new activity "welcomelocal"
29)Click "Save and display" and you'll get message "Welcome Teacher"
IV.Installation of Apache + WelcomePHPApp + OkiBusClient + Components
FILE WelcomePHPApp_OkiBusClient_Components_VersusMoodle-1.3.3.zip
30) Unzip the content of the zip
-Folder "client" contains LauncherPHP (is needded to launch application) and test application welcomePHPApp.
-Folder "okibusCommon" is to be included (php_value "include_path").
-Folder "configuration" files of configuration, every file is setted via VirtualHost (SetEnv name_enviroment pathToConfigurationFile).
You can define your own virtualhost (Information of Virtual Host at the end of this document). The file "vhost_WelcomePHPApp_OkiBusClient_Components_moodle.conf" will be found in zip file, and is a template, you have to change <folder> for the real path.
This server listen on port 81.
To include this file you have to edit configuration file of Apache2 (httpd.conf or apache2.conf, in Windows distribution is in <folder>/server/apache/conf) and add this line:
Include <folder_to_unzipped_vhost>/vhost_WelcomePHPApp_OkiBusClient_Components_moodle.conf
Test Client Configuration:
It's very important to test if configuration of Client is correct. The page will show:
-Classes of include_path are correct.
-ComponentsPHP classes.
-OkiBusPHPClient classes.
-PHP_OSID_2.0 classes.
-PHPUtils classes.
-Classes loaded via configuration file are correct.
-Classes of OkiBusPHPClient Implementation of ComponentsPHP.
-Classes of SOAP from OkiBusPHPClient.
-Context parameters.
-Test if contexts params are the same in OkiBusPHPServer.
Acces:
http://localhost:81/testClientClasses/testClasses.php
If anything is wrong will show you in red color. Fix these errors before continue.
If everything goes fine it will display a line in red: "Error 0 class not found"
31)Log out and log in as "admin"
32)Go to Moodle, "Site Administration" menu go to Modules->Activities
33)To install a remote application you have to click on "settings" on Modules->Activities "appinstaler"
34)Fill all the fields with these values (server is listening on 81)
//Application Name to Install (can't contains blanks space, numbers and specials characters, and has to be lowercase)
App Name: welcomeremote
//Application Version to Install
Version: 1
//URL to Install the new application
Install URL: http://localhost:81/WelcomePHPApp/install.php
//URL to Execute in the new application
Execute URL: http://localhost:81/WelcomePHPApp/index.php
//It's identified the webapps of launcher
Launcher Relative URL: /LauncherPHP/launcher/launcher.php
35)Click button "Install"
36)Then you have to wait to see the "Result of appInstaler"
37)If everything is ok you will see
welcomeremote: Install page
Success!
Installation completed
38)Click "Continue" button
39)Click Notifications on "Site Administration" menu
40)welcomeremote Application will be installed and click "Continue"
41)Log out.
42)Log in as user teacher.
43)Go to the course
44)Click "Turn editing on"
45)Add a new activity "welcomeremote"
46)Click "Save and display" and you'll get message "Welcome Teacher"
V.Installation of Tomcat + WelcomeJavaApp + OkiBus Client + Components
FILE WelcomeJavaApp_OkiBusClient_Components_VersusMoodle-1.3.3.zip
47)Download Tomcat 5.5 (http://tomcat.apache.org/download-55.cgi) This tomcat will be "tomcat-client". The tomcat-client run on port 8080. If you want to install on a Tomcat 6 go to the end of this document.
48)Install Tomcat
49)Change directory to home tomcat. You have to overwrite all files unzipped from "WelcomeJavaApp_OkiBusClient_Components_VersusMoodle-1.3.3.zip"
50)Start up tomcat client:
<windows>
start-tomcat-client-moodle.bat
<mac, linux>
./start-tomcat-client-moodle.sh
To stop tomcat you can use these scripts
<windows>
stop-tomcat-client.bat
<mac, linux>
./stop-tomcat-client.sh
51)Accessing tomcat-client. Once your tomcat-client is started, open a browser and enter the following URL:
http://localhost:8080/
(you can see "It works..." if is ok)
52)Log in as admin
53)Go to Moodle, "Site Administration" menu go to Modules->Activities
54)To install a remote application you have to click on "settings" on Modules->Activities "appinstaler"
55)Fill all the fields with these values (server is listening on 8080)
//Application Name to Install (can't contains blanks space, numbers and specials characters, and has to be lowercase)
App Name: welcomeremotejava
//Application Version to Install
Version: 1
//URL to Install the new application
Install URL: http://localhost:8080/welcomeApp/install.jsp
//URL to Execute in the new application
Execute URL: http://localhost:8080/welcomeApp/index.jsp
//It's identified the webapps of launcher
Launcher Relative URL: /CampusLauncherJava/launcher/launcher.jsp
56)Click button "Install"
57)Then you have to wait to see the "Result of appInstaler"
58)If everything is ok you will see
welcomeremotejava: Install page
Success!
Installation completed
59)Click "Continue" button
60)Click Notifications on "Site Administration" menu
61)welcomeremotejava Application will be installed and click "Continue"
62)Log out.
63)Log in as user teacher.
64)Go to the course
65)Click "Turn editing on"
66)Add a new activity "welcomeremotejava"
67)Click "Save and display" and you'll get message "Welcome Teacher"
*You can create a student user and assing to the course and execute any installed application and you will see "Welcome Student"
-----------------------------------------
Virtual Host
The term Virtual Host refers to the practice of running more than one web site (such as www.company1.com and www.company2.com) on a single machine. Virtual hosts can be "IP-based", meaning that you have a different IP address for every web site, or "name-based", meaning that you have multiple names running on each IP address. The fact that they are running on the same physical server is not apparent to the end user.
More information in http://httpd.apache.org/docs/2.0/vhosts/.
-----------------------------------------
Change endpoints for OkiBus Client
PHP Client:
1)Edit <client-folder>/okibusCommon/OkiBusPHPClient/config/okibusPHP.okibusClient.properties
2)Change soap.location.prefix
soap.location.prefix=http://localhost/OkiBusPHPServer/
Java Client:
1)Stop Tomcat
2)Go to <tomcat-folder>/shared/lib/
3)Unzip OkiBusJava-config-generic.jar
4)Edit oki_service_locator.properties
5)Change every DispatcherXXXXX=http://localhost:80/OkiBusPHPServer/dispatcherXXXX.php
6)Start Tomcat
-----------------------------------------
Improve PHP Performance
eAccelerator is a free open-source PHP accelerator, optimizer, and dynamic content cache. It increases the performance of PHP scripts by caching them in their compiled state, so that the overhead of compiling is almost completely eliminated. It also optimizes scripts to speed up their execution. eAccelerator typically reduces server load and increases the speed of your PHP code by 1-10 times.
* Using Moodle and XAMPP on Windows or Mac OS X is on by default
* Using WAMP for Windows you have to download eaccelerator.dll from (http://www.sitebuddy.com/PHP/Accelerators/eAccelerator_windows_binaries_builds), put on extensions dir and then enable eaccelerator
For more information go to http://www.campusproject.org/packages/moodle/eAccelerator.pdf or http://eaccelerator.net
-----------------------------------------
Debugging
Using Moodle and XAMPP on Windows or Mac OS X is on by default you have to edit php.ini from server/php/php.ini
[xdebug]
xdebug.remote_enable=1
xdebug.remote_host="localhost"
xdebug.remote_port=9000
xdebug.remote_handler="dbgp"
zend_extension_ts="C:\xampplite\server\php\ext\php_xdebug.dll"
For Debian-Ubuntu
sudo apt-get install php5-xdebug
Edit php.ini (/etc/php/apache2/php.ini) and add
zend_extension=xdebug.so
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_port=9000
xdebug.remote_host=localhost
-----------------------------------------
Installing on Tomcat 6
Tomcat 6 does not ship with several of the directories that were present in Tomcat 5.x
For example, the shared/classes and shared/lib directories.
OkiBus has the configuration is set to use the configuration shared/lib.
To configure Tomcat6 to pick up these files again is:
1. Locate <TOMCAT_HOME>.
2. Create the <TOMCAT_HOME>/shared/lib/ directory
3. Open the <TOMCAT_HOME>/conf/catalina.properties file.
4. Change the value of shared.loader= to the following:
shared.loader=${catalina.base}/shared/lib/*.jar
Tomcat 5.x also used to have a common/endorsed directory, which no longer exists in Tomcat 6.x. If you are using Java SE 6, then copy any JARS that needed to go into Tomcat's common/endorsed into ...jdk6/jre/lib/endorsed directory.