##Version 1.4.3 (08/11/2010)
These instructions are created to add the Welcome Application to Moodle 1.9 and WAMP over Windows
I. Installation WAMP + Moodle
1) Download WAMP
http://www.wampserver.com/en/download.php
Edit php.ini (C:\wamp\bin\apache\Apache2.2.11\bin\php.ini) and make sure:
extension=php_soap.dll
Commented with ; by default, the comment should be deleted.
max_execution_time = 0
Assign the value 0, which means "without limit".
soap.wsdl_cache_enabled=0
By default, its value is 1, it should be put to 0.
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 = "c:/wamp/logs/php_error.log"
Log errors to specified file.
You have to enable mod_rewrite of Apache server
To improve performance go at the end of document
Edit httpd.conf (C:\wamp\bin\apache\Apache2.2.11\conf\httpd.conf)
and enable mod_rewrite
LoadModule rewrite_module modules/mod_rewrite.so
2) Download Moodle
http://download.moodle.org/download.php/stable19/moodle-weekly-19.zip
3) Create a c:\wamp\www\server folder
C:\>mkdir c:\wamp\www\server
4) Unzip in c:\wamp\www\server
II. Installation Gateway + OkiBus Server + Components
FILE GatewayMoodle_OkiBusServer_Components-1.4.3.zip
2)Unzip the content of the zip in C:/wamp/www
-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).
3) Include Virtualhost. The file "vhost_Gateway_OkiBusServer_Components_moodle_wamp.conf" will be found in zip file, and is a template preconfigurated to work with wamp server.
a) You have to move to C:\wamp\bin\apache\Apache2.2.11\conf\extra *
b) Then to include this file you have to edit configuration file of Apache2 (C:\wamp\bin\apache\Apache2.2.11\conf\httpd.conf) and add this line at the end:
Include "C:/wamp/bin/apache/Apache2.2.11/conf/extra/vhost_Gateway_OkiBusServer_Components_moodle_wamp.conf"
4) Start Wamp server
5) Test OkiBusServer Configuration (C:/wamp/www/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.
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"
6) Install Moodle
a) Go to http://localhost/moodle
b) Follow all the steps of moodle installation
7)In "Site Administration" menu go to Users->Authentication (in Moodle 1.9+ then you have to go Manage authentication)
a)Enable "okiserver"
8)Log out
9)Log in as admin. These steps are necessary to enables okiserver in current session.
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.4.3.zip
12)You have to unzip at C:\wamp\www\
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 Initialize the new application
Initialization: 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
//Absolute URL to do logout application when Moodle ends session
Url Logout: http://localhost/WelcomePHPApp/logout.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.4.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 Virtualhost. The file "vhost_WelcomePHPApp_OkiBusClient_Components_moodle_wamp.conf" will be found in zip file, and is a template preconfigurated to work with wamp server.
a) You have to move to C:\wamp\bin\apache\Apache2.2.11\conf\extra *
b) Then to include this file you have to edit configuration file of Apache2 (C:\wamp\bin\apache\Apache2.2.11\conf\httpd.conf) and add this line at the end:
Include "C:/wamp/bin/apache/Apache2.2.11/conf/extra/vhost_WelcomePHPApp_OkiBusClient_Components_moodle_wamp.conf"
c) Restart Wamp
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 Initialize the new application
Initialization 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
//Absolute URL to do logout application when Moodle ends session
Url Logout: http://localhost/WelcomePHPApp/logout.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.4.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.
48)Install Tomcat
49)Change directory to home tomcat. You have to overwrite all files unzipped from "WelcomeJavaApp_OkiBusClient_Components_VersusMoodle-1.4.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 Initialize the new application
Initialization: http://localhost:8080/WelcomeJavaApp/install.jsp
//URL to Execute in the new application
Execute URL: http://localhost:8080/WelcomeJavaApp/index.jsp
//It's identified the webapps of launcher
Launcher Relative URL: /CampusLauncherJava/launcher/launcher.jsp
//Absolute URL to do logout application when Moodle ends session
Url Logout: http://localhost:8080/WelcomeJavaApp/logout.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