1. Edventure INSTALL File
NOTE: the shell prompt is indicated by a hash.
1. Get the Edventure source files from http://dangermouse.brynmawr.edu/Edventure/download/
2. Make sure that PHP is installed on your server, and works on files with a .php extension. Make sure that either posgresql or mysql is installed and works.
see mysql test script for help there
3. Change to the directory you wish to have edventure in, and uncompress the edventure tgz file. You may have to be root to do this:
# su - # cd /var/www/html/ # tar xfz edventure-*.tgz
4. Create a subdirectory not accessible via the webserver. This will be used to read and write secure documents by the system. This often has a name like 'edventure_secure' and can be placed anywhere not reachable by a public service (e.g., ftp, httpd):
# cd /var/ # mkdir edventure_secure
You will also need to make sure that Apache has read/write privileges in that directory, and execute privileges above it:
# chmod a+rw edventure_secure # chmod a+rwx .
Also, you will need to create a temporary directory that is accessible from the webserver, but doesn't allow browsing in directly.
# cd edventure # mkdir tmp
This will be the same name you give ED_TEMP_PATH below.
5. Create the file edventure/config.php as to your configuration file paths, and URL addresses. Here you can also set your SQL password and database name.
-
Suggestion: This file gets included in the distro
-
If it did, it would overwrite your version if you updated from a later tarball.
bash: vim config.php
<? define(ED_SITE_ROOT, "/edventure"); // leave off final slash define(ED_SITE_MACHINE, "computer.college.edu"); // leave off final slash: define (ED_PATH_ROOT, "/var/www/html/edventure"); // leave off final slash: define (ED_PATH_SECURE, "/var/edventure_secure"); // leave off final slash: define (ED_TEMP_PATH, "tmp"); // Institute #. Needs to be unique among Edventure sites for sharing $ED_INSTITUTE = 2; $ED_INSTITUTE_DOMAIN = 'mail.college.edu'; //define(DB_TYPE, "mysql"); define(DB_TYPE, "postgresql"); define(DB_DATABASE, "edventure"); define(DB_PASSWORD, "sdj3247HG"); // or something define(DB_SERVER, "localhost"); define(DB_USER, "apache"); $edventure_language = 'en_US'; // see edventure/locale/ for languages ?>
Check out http://emergent.brynmawr.edu/?EdventureInstitutionCodes to get your unique ID for the $ED_INSTITUTE line.
2. Edit the php.ini file
6. Edit your copy of php.ini so that PATH includes your edventure web directory.Do you mean this path:
;;;;;;;;;;;;;;;;;;;;;;;;; ; Paths and Directories ; ;;;;;;;;;;;;;;;;;;;;;;;;; ; UNIX: "/path1:/path2" ;include_path = ".:/php/includes" ; ; Windows: "\path1;\path2" ;include_path = ".;c:\php\includes" Can we get a sample of this path? I tried test 1 ; UNIX: "/path1:/path2" include_path = "." which didn't help test 2 ; UNIX: "/path1:/path2" include_path = . neither did that one test3 ; UNIX: "/path1:/path2" ;include_path = ".:/php/includes" include_path = ./edventure neither did that one test4 ; UNIX: "/path1:/path2" ;include_path = ".:/php/includes" include_path = .:/edventure neither did that one test5 ; UNIX: "/path1:/path2" ;include_path = ".:/php/includes" include_path = ".:/edventure" neither did that one test6 ; UNIX: "/path1:/path2" ;include_path = ".:/php/includes" include_path = .:/var/www/html/edventure neither did that one test7 ; UNIX: "/path1:/path2" ;include_path = ".:/php/includes" include_path = ".:/var/www/html/edventure" neither did that one Do I need to flush the system or reboot or something after each try? Per Jesus: Yes! It is a good idea to restart! So, maybe one of my earlier tests might have worked... redo the same test 7 times? /sigh I'm running edventure on my home localhost edvenuture lives here: /var/www/html/edventure [JMC (from SDPHP): the include_path is a colon separated list of full, real paths to dirs where your included files reside they can even be outside the web root, e.g. include_path = ".:/var/www/html/edventure:/var/edventure_secure" You might want to add the path where the PEAR libs are installed, which depends on how you installed your PHP to begin with, perhaps /usr/local/lib/php?, and yes, you *must* restart Apache for the changes to takeplace. It is safer to stop and then start Apache rather than just restart as in some OSes that does not assure that all modules get the reload config notification.] test 8 ; UNIX: "/path1:/path2" ;include_path = ".:/php/includes" include_path = ".:/var/www/html/edventure:/var/edventure_secure" restarted httpd and mysqld. still getting raw code on http://localhost/edventure/index.php test 9 ; UNIX: "/path1:/path2" ;include_path = ".:/php/includes" include_path = ".:/usr/share/pear:/var/www/html/edventure/" restart apache/ running apache 2.040/ php was already installed/ there is no php in the share folder no go I do know that mysql and php are speaking to one another and that both servers are running
here's the source for ref
index.php
7. Set safe_mode off, and file uploading on:
safe_mode = Off file_uploads = On
(This should change in future versions to better ensure security.)
3. creating the dbase
7. Create the database and tables using the sql/schema-DBNAME.sql scripts. In Postgresql, that would look like:# psql --file sql/schema-psql.sql
Question: What does it look like in mysql?
# mysql> sql/schema-mysql.sqlI tried mysql> sql/schema-mysql.sql but it came back with an SQL syntax error at line 1
[JMC (from SDPHP): Nope, the redirection is in the wrong direction, you want mysql to recieve input from the SQL file, not send output to the file, i.e.: mysql < sql/schema-mysql.sql, more generally you might need to first do a "mysqladmin create dbname", then "mysql -u user -p dbname < sql/schema-mysql.sql. This information is also in the MySQL manual IIRC, so reading it should've saved you some errors during the trials ;-)]
I just tried the sql script in phpmyadmin. It complained
MySQL said: You have an error in your SQL syntax near 'connect edventure' at line 1So, for me, the sql complained about line 1, which is: drop database edventure; I'll need to check and see if I can toggle DROP in MySQL, that might be the problem.
Using phpmyadmin2.3.3 on mysql 3.23.52 I copy pasted the sql statement minus the top three commands and got this error
SQL-query : CREATE TABLE question_select( iid int4, qid int4, id char( 15 ) , PRIMARY KEY ( iid, qid, id ) ) MySQL said: All parts of a PRIMARY KEY must be NOT NULL; If you need NULL in a key, use UNIQUE instead
So getting closer!
Try:
CREATE TABLE question_select( iid int4 NOT NULL, qid int4 NOT NULL, id char( 15 ) NOT NULL, PRIMARY KEY ( iid, qid, id )
-
Please see MysqlAdventures for more harrowing tales of sql madness!
8. Finally, you'll need to create a root account with 'super' privileges so that you can begin to create regular 'admin' accounts, and that the admins can create 'user' accounts. Here is an example you can put in a temp file "admin_init.php":
Should this file be included in the distro as well? No, I don;t think so. Even if it deleted itself after it ran, it would still reappear if you updated the directory, and that would be a security problem.
<?
include_once "ed_lib.php";
$dbi = new dbi();
$dbi->query("INSERT into people (id, privs, password_retrieve) VALUES ('super', 'user, admin, super', 'db');");
$dbi->query("INSERT into course (course_id) VALUES ('Default');");
print "Done!";
?>
The name 'super' is arbitrary, but you should grant the account all of the priviledges by listing super, admin, and user. You can then login as 'super' without a password. Under "Profile", CHANGE THE PASSWORD IMMEDIATELY TO A GOOD ONE.
Delete this file afterwards! Else someone could run it.
In version prior to 0.8.2, don't use an ID longer than 9 Chars.
4. Optional install changes
To run the auto-password handling feature:
1. Create a user with a name that you can send email to which will change passwords. This is often named 'edventure' or 'manager'.
2. Move the mailer.pl program to the root directory of this new user account.
3. Create a .forward file that pipes to mailer:
# cd ~manager # cat > .forward | /home/manager/mailer.pl
4. Create a link in your smrsh directory to the mailer.pl program:
# cd /etc/smrsh # ln -s /home/manager/mailer.pl mailer.pl
You can now send email to 'manager@edventure.college.edu' with a subject of 'password' to reset your password.
5. Upgrading Versions
Question: Anything we need to know about upgrading Edventure or is it the same process as above? Is there an upgrade script?Answer: For the code, you should be able to just untar the file in the same place. If the databases change, then you'd have to need to take care of those changes. How would you know if the database changed? Look at EdventureChangeLog.
6. RPM
Question: Is there an RPM in the works?Answer: If someone could point me to a tutorial on how to create one, I'd try.
-
http://erizo.ucdavis.edu/~dmk/notes/RPMs/Creating_RPMs.html (prefers mandrakes howto)
http://www.rpm.org/ (experiencing problems)
http://www.kayos.org/download/rpm-tutorial.html (recently updated)
http://freshrpms.net/docs/fight.html (amusing and interesting)
7. To run Babylon Java Chat server
-
Download babylon chat program.
-
Install in edventure directory
-
Create edventure/plugins/Misc/Chat
-
Create edventure/plugins/Misc/Chat/index.php (see below)
-
Add 'java babylonServer -nographics &' to a startup script.
File edventure/plugins/Misc/Chat/index.php:
<?
include_once "edventure.php";
include_once "ed_lib.php";
global $edventure_id;
print "<HTML><BODY bgcolor=white><DIR>";
if (! empty($edventure_id)) {
?>
Loading Java Chat client... <p>
You should have a chat client window appear in a moment.
<APPLET code="babylonApplet.class" width="10" height="10"
codebase="/edventure/babylon/">
<?
print "<param name=\"username\" value=\"$edventure_id\">\n";
print "<param name=\"servername\" value=\"" . ED_SITE_MACHINE . "\">\n";
?>
<param name="portnumber" value="12468">
<param name="locksettings" value="yes">
<param name="autoconnect" value="yes">
<param name="hidetext" value="yes">
<param name="hidecanvas" value="yes">
<param name="hidetext" value="no">
You'll need a browser with Java support to run the
Babylon Chat applet!
</APPLET>
<?
} else {
print "You need to log in first.";
}
ed_footer();
?>
8. Running Edventure
You should be able to log in as administrator (see Step #8 above) and create your instructor 'admin' accounts.
