[Home]VMTDeployment

HomePage | RecentChanges | Index | Preferences | Upload

Instructions on getting the VMT development system on your computer, configuring it, and then using it to build and deploy a working VMT Server:

Note: If you have never setup and used the VMT Development System before setting it up and making it work may take a whole 8-hour day. Take your time and follow the instructions below carefully. The VMT Development System is made up of many technologies, each of which is changing over time and are sometimes different under different operating systems, so PLEASE add issues and workarounds you come across to this page! Thank you very much for your participation and patience. VMT Lead Developer, Dr. Baba Kofi Weusijana.

1. Make sure you have the Java Software Development Kit (SDK) version 1.5 or higher.

Open your command line program (Terminal in

/Applications/Utilities/
for Mac users) and type "java -version" and hit enter/return. If you have the Java Software Development Kit (SDK) version 1.5 or higher you should be good to go. If not, use the appropriate updater. Mac users should use: http://www.apple.com/search/downloads/?q=java

Others should start at: http://java.sun.com/javase/downloads/index.jsp If you don’t have to install Java, but still have problems later, you might only have the Java Runtime Environment (JRE) and not the Java SDK, so use the appropriate URL above and install the Java SDK 1.5 or above.

MAC USERS: Note that Java is installed by default with all recent verions of the MAC OS, and you should not need to install a JDK. This can be confirmed by typing "javac" at a command prompt.

2. Getting the VMT Development System from the Math Forum Subversion (SVN) Repository and using it with Maven 2 and Eclipse:

First you should get the most recent version of the Galileo Eclipse IDE for Java EE Developers for your platform from http://www.eclipse.org/downloads (the cocoa version was recommended for Murat’s Mac Pro). upload:image001.png

a. Install plug-ins into Eclipse

The first screen-shot below shows the location of the resources. To access this window from Eclipse, click on Help -> Install new software, and then click on the link called Available software sites.

Use the Add button to enter the URLs for the entries listed as enabled in the image below (location URLs have to be entered manually).

Below is a list of the specific packages you need to install, along with the URLs

  1. AspectJ? Development Tools Source Code (Make sure you use source code, and do *not* select the non-source package for aspectJ with Eclipse EE (This does not work)
  2. AspectJ? Development Tools (AJDT) Source Code 2.0.0.e34x-20090622-2000 org.eclipse.ajdt.source.feature.group
  CollabNet? Merge Client	1.9.0.4	com.collabnet.subversion.merge.feature.feature.group
  Cross References tool (XRef)	2.0.0.e34x-20090622-2000	org.eclipse.contribution.xref.feature.group
  Cross References Tool Source Code	2.0.0.e34x-20090622-2000	org.eclipse.contribution.xref.source.feature.group
  Eclipse IDE for Java EE Developers	1.2.0.20090621-0820	epp.package.jee
  Eclipse Weaving Service Feature	2.0.0.e34x-20090622-2000	org.eclipse.contribution.weaving.feature.group
  Eclipse Weaving Service Source Code	2.0.0.e34x-20090622-2000	org.eclipse.contribution.weaving.source.feature.group
  Equinox Aspects	1.0.0.200906171200	org.eclipse.equinox.weaving.feature.group
  Equinox Aspects Source Code	1.0.0.200906171200	org.eclipse.equinox.weaving.source.feature.group
  JNA Library	3.0.9	com.sun.jna.feature.group
  Maven Embedder	2.1.0.20080530-2300	org.maven.ide.components.maven_embedder.feature.feature.group
  Maven Integration for Eclipse (Required)	0.9.8.200905041414	org.maven.ide.eclipse.feature.feature.group
  Maven POM Editor (Optional)	0.9.8.200905041414	org.maven.ide.eclipse.editor.feature.feature.group
  Maven POM XML Editor (Optional)	0.9.8.200905041414	org.maven.ide.eclipse.editor.xml.feature.feature.group
  Maven: The Definitive Guide book (Optional)	0.9.8.200905041414	org.maven.ide.eclipse.book.feature.feature.group
  Mylyn Connector: JIRA	3.2.0.v20090617-0100-e3x	org.eclipse.mylyn.jira_feature.feature.group
  Mylyn Connector: Trac	3.2.0.v20090617-0100-e3x	org.eclipse.mylyn.trac_feature.feature.group
  Subclipse (Required)	1.6.2	org.tigris.subversion.subclipse.feature.group
  Subclipse Integration for Mylyn 3.x (Optional)	3.0.0	org.tigris.subversion.subclipse.mylyn.feature.group
  Subversion Client Adapter (Required)	1.6.0.2	org.tigris.subversion.clientadapter.feature.feature.group
  Subversion JavaHL? Native Library Adapter (Required)	1.6.3	org.tigris.subversion.clientadapter.javahl.feature.feature.group
  Subversion Revision Graph	1.0.7	org.tigris.subversion.subclipse.graph.feature.feature.group
  SVNKit Client Adapter (Not required)	1.6.2	org.tigris.subversion.clientadapter.svnkit.feature.feature.group
  SVNKit Library	1.3.0.5847	org.tmatesoft.svnkit.feature.group

'' Available Upload Sites upload:available%20software%20sites(2).png

Once the resources are added to the list of available software sites, you can start installing the components. The screen shot below shows the list of the components that you will need to install. To open this window, use Eclipse -> About Eclipse and click on the Installation Details button.

'' Installed Software Components upload:eclipse%20installed%20components(2).png

The download dialog box for the AJDT component is shown below as an example. You can use the pull-down menu with the label Work with: to browse through resources and select the necessary files to install. After downloading and installing each plug-in Eclipse may ask you to restart the program, it is best to go ahead and do that.

upload:image004.png

b. Getting and Using Subversion (SVN):

First make sure you have Subversion by typing "svn help" in a Terminal window. If you don't have it, Mac users can use MacPorts? to install it (get it from http://www.macports.org). In general, get the latest stable version of SVN from http://subversion.tigris.org/. I'm using the version 1.6.2 at the time of writing these instructions. Keep in mind that whenever you install something with MacPorts? you close your terminal window and open another and make sure you can run the new version of the program.

An online book on SVN is available at: http://svnbook.red-bean.com/

From your computer, the terminal commands to use SVN look like:

 svn info svn+ssh://<username>@svn.mathforum.org/usr/local/svn/VMT

If you are logged into svn.mathforum.org ssh the commands look like:

 svn info file:///usr/local/svn/VMT

That information was included in case you needed to issue SVN commands that are not available from an IDE like Eclipse. Instructions on using SVN with Eclipse are in the next sub-section.

c. Connecting to the VMT SVN Repository from Eclipse.

You will need a public and private key files to use the repository. You keep the private key on your computer and never share it with anyone. You should give the public key file to the Math Forum so they can allow you to log into the SVN repository.

Under a UNIX system, you can generate an RSA key on your terminal with the command:

 ssh-keygen –t rsa

This will create a pair of public and private keys under your home directory (e.g. Users/mcakir) under the folder “.ssh”. Send the public key (i.e. the file called id_rsa.pub) to Meredith Coletta (meredith@mathforum.org), so that she can register your key and give you access to the SVN repository.

Under Windows you can use Eclipse to create your keys: Go to Window -> Preferences Then General -> Network Connections -> SSH2 Generate an RSA key Cut and paste the public key into an email and email it to Meredith Coletta (meredith@mathforum.org), so that she can register your key and give you access to the SVN repository.

To test the connection to the Math Forum server, try the following command:

 ssh mpc48@svn.mathforum.org
(replace mpc48 with your own user name)

You need to be on Drexel’s VPN for remote access to the repository. If you don’t have Drexel’s VPN client, you can downloaded it from http://www.drexel.edu/irt/services/comp_mark/software.html .

Open the SVN Repository view in Eclipse via Window -> Show View -> Other and then under SVN choose SVN Repositories. Then click on the Add SVN Repository button (located at the right-bottom of the screen-shot below)

upload:image005.png

Enter the URL for the repository as shown below:

upload:image006.png

Then you will see the dialog box below:

upload:image007.png

Select private key authentication and provide the private key in the Key file field. This is usually located in a folder called .ssh under your home directory (if you are not on campus, then you should be logged in to the Drexel VPN for the authentication to work).

Once the connection is made, the VMT repository will be added to your list of SVN repositories. Right click on the URL and select check out to fetch the folder you want from the server. If you want to work on the main VMT development system, get the files in the trunk folder. Other branches of VMT are in the branches folder (such as the dynamic branch).

Note for Mac users: The .ssh folder will be invisible by default. To make such files (which will be useful to locate .m2 where you configure Maven 2) visible in Finder, type the following command in the terminal:

defaults write com.apple.Finder AppleShowAllFiles YES

then logout of your Mac user account (type command-shift-Q) and then log back in, or (if you are very sure the Finder is not doing anything important) type in a Terminal window:

 killall Finder

To hide the files repeat the steps above, but use FALSE instead of YES at the end of the command.

3. Using SVN with Eclipse.

Eclipse uses its "Team" source version control tools for SVN. Here are two places to get documentation on it:

Full documentation: http://www.eclipse.org/subversive/documentation/teamSupport.php

Simple tutorial: http://www.ibm.com/developerworks/opensource/library/os-ecl-subversion

Basically you should right-click on what project, folder, or file you are interested in and use an option under "Team". Updating means to get the latest version from the repository. Synchronizing means comparing your file(s) to the repository (you can also use the "Compare With" right-click menu options). If a conflict is found (you have changed a file that someone else also changed) its might be best to contact the developer who made the change to come to an agreement on what the new merged file’s contents should be. Committing means submitting your file(s) to the repository as the latest version. Do not commit changes you have not tested! Also please provide a comment each time you commit some changes so that it is easy to understand why you made your changes and go back to that revision if needed.

Getting the VMT Development System ZIP file (optional): You can alternatively download the VMT development system from: http://vmt.mathforum.org/source/VMT-branchname-year-month-day.zip but if you can make it work it is best to use the Subversion repository (instructions above) so you can contribute your changes to the rest of the developers.

4. After Getting the VMT Development System.

Once you get the VMT development system, read the README file and any file it mentions.

a. How to make and use branches (alternative versions) of VMT:

The main VMT development system should remain in the trunk folder. Other branches of VMT should have their own folder inside the branches folder. Read the following before making any changes to, or adding any, branches to VMT: http://svnbook.red-bean.com/en/1.1/ch04s02.html and http://www.pushok.com/help/svnscc/index.php?redirect=adv_tagsbranches.htm

Setup, Build, and Deployment of the Virtual Math Teams (VMT) System

System parts:

1. Checkout VMT from the Subversion source repository. The main branch of the system (in the “trunk” folder in the Subversion source repository) consists of basically two different Web applications (assumed to be run under the Tomcat 6 webserver):

a. The VMTLobby web application using a mysql database table b. Other various web applications including the VMTChat ConcertChat server which uses another mysql database table

Both servers are set up and configured independently and communicate with each other via Web Services (so that be on different machines if needed). These instructions will assume you will put the trunk folder’s contents into a folder called “VMT”. These instructions also assume you are setting up VMT to run in the included tomcat6 Web server installation which will serve VMT at http://localhost:8080/ . You can change the location and port of your tomcat6 folder and if you are not using tomcat you can copy the .war files in the tomcat6/webapps folder and the general jars in tomcat6/lib folder and the settings files in tomcat6/bin folder from the tomcat6 installation.

Mac Users: Install required software:

1. Download and install XCode development kit for Mac OSX, which will install useful programs (including Xcode, gcc, and the make tool) required to build software like mysql. You will need a free Apple Developer’s Account (you can use an iTunes/.mac account). http://developer.apple.com/technology/xcode.html

2. Download and install MacPorts? (from http://www.macports.org) to aid installation of Maven, Tomcat, MySql? etc from the command line

Install Tomcat 6:

For UNIX users, the VMT/tomcat6-backup.zip file can be extracted to a directory of your choice so you can have a new tomcat6 installation, but put that directory outside the VMT development folder. That directory will be referred to as the tomcat6 folder in these instructions. Otherwise get it from http://tomcat.apache.org/download-60.cgi and install tomcat 6 yourself (Mac users can also use MacPorts? to install tomcat6). Start tomcat by going to the “tomcat6/bin” folder and typing the command “sh startup.sh” in the Terminal for Mac users, or “startup.bat” under Windows. Open a browser window and got to the URL http://localhost:8080/ to check if tomcat is running. Then stop the web server using shutdown.sh or shutdown.bat.

Install MySQL?:

You will need MySQL? because both of the main VMT webapps use it immediately. If you don’t have it, get the latest stable version 4.x for your platform. We have not tested MySQL? version 5 or above with VMT. Mac users can use MacPorts? (from http://www.macports.org) to install it, but you will probably first need Apple’s developer tools (including Xcode, make and gcc) from: http://developer.apple.com/technology/xcode.html and you might need to also use the sudo command (http://en.wikipedia.org/wiki/Sudo) by typing a Terminal commend like this: sudo port install mysql4 Documentation on installing MySQL? is at: http://dev.mysql.com/doc/refman/4.1/en/installing.html

No matter what platform you are using, you must read and follow the procedures for testing and securing your MySQL? installation (which includes choosing user names and passwords) at: http://dev.mysql.com/doc/refman/4.1/en/post-installation.html

Install Maven 2:

Then install the latest stable release of Maven 2 from http://maven.apache.org .

Mac Users:

If you are using a Mac this is easy to install with MacPorts? (see “Mac Users: Install required software “ above) but you might need to also use the sudo command (http://en.wikipedia.org/wiki/Sudo)). First check for available maven versions: port search maven Then install Maven 2: sudo port install maven2 Sudo will probably require you to type your user password.

Windows and UNIX Users:

There are specific instructions for your operating system type on the maven website. Look under the "Installation Instructions" section on this page: http://maven.apache.org/download.html

Note:Keep in mind if you are reading Maven documentation that plug-ins to Maven itself are called mojos.

Using Eclipse with Maven 2:

Full documentation on using Eclipse with Maven is available from http://www.sonatype.com/products/m2eclipse/documentation (use one of the links on the bottom of the page). If you have not set-up a VMT project already, follow the instructions in the “3.4. Importing Maven Projects” section but keep in mind that the VMT development system is a Multi-module Maven Project.

Settings:

Currently Maven 2 manages the VMT development system. Maven is a Java based software project management and comprehension tool. It uses pom.xml files called Project Object Models. One pom.xml file in the top directory of the VMT development system, referred to as the VMT directory henceforth, is the project file for the entire system with other pom.xml files for sub-projects in deeper directories. General properties, used to configure various settings, should go in the general pom.xml file.

1. Configure your settings.

Some properties should not be committed to the source control system for security and portability reasons. Such properties should go in your own settings.xml file stored in your .m2 folder. On Windows XP, your .m2 folder is likely at C:\Documents and Settings\USERNAME\.m2, and on Windows Vista, your .m2 folder is at C:\Users\USERNAME\.m2. On Unix systems, your.m2 folder is available at ~/.m2. Delete any default settings.xml file in your /m2 folder, copy the VMT/settings-example.xml file into the ~/.m2 folder and rename it settings.xml.

Mac users: If you can’t see files and folders that start with a period go to your Terminal window and type

defaults write com.apple.Finder AppleShowAllFiles YES
. Then logout of your Mac user account and log back in and you should be able to see the .m2 folder in your user folder.

Make sure settings like your server URLs, database URL and database user names and password are correct in settings.xml. You can use the comments in the top-level pom.xml and the contents of the VMT/settings-example.xml file as a reference. You should be able to override any settings in the pom.xml files in YOUR settings.xml that is particular to your needs, ONLY general needs across all VMT developers should be committed to the pom.xml files.

Properties and profiles:

Properties are set within profiles, yet it is hard to tell where all the active profiles are located. For the VMT system please only put active profiles needed across all VMT developers in the pom.xml files and profiles specific to your needs in your ~/.m2/settings.xml file. Maven profiles can be defined in either pom.xml, profiles.xml, ~/.m2/settings.xml, or ${M2_HOME}/conf/settings.xml. With these four levels, there's no good way of keeping track of profiles available to a particular project without remembering which profiles are defined in these four files. To make it easier to keep track of which profiles are available, and where they have been defined, the Maven Help plugin defines a goal, active-profiles, which lists all the active profiles and where they have been defined. You can run the active-profiles goal, with the command “mvn help:active-profiles”.

JARs and the jar repository:

In order to avoid “jar-hell” where many extra JARs (Java Archives of source code) get placed in the source repository and are unmanageable, we are using an Apache Archiva Jar repository at http://zinc.mathforum.org:8080/archiva/ as well as the default Maven repositories. Currently to connect to our repository you must be on-campus or using Drexel’s VPN.

2. The location of the JAR repository must be set BOTH in YOUR settings.xml file (inside the <mirrors> tag) and the top-level pom.xml file (inside the <repositories> tag). Read the settings-example.xml file as a reference.

Some Jars are in the repository with a 1.0-SNAPSHOT version number. Such Jars were either being used for VMT version 1.0 even though it’s source code was still under development and/or the Jar’s true version number could not be identified.

3. Make sure your ~/.m2/settings.xml file has inside the <servers> tag the correct username and password for your Archiva account (if you need an Archiva account email Archiva administrator Dr. Baba Kofi Weusijana at baba@mathforum.org). Matching information (without your username) should also be in the top-level pom.xml file (inside the <distributionManagement> tag). These should allow you to deploy your finished JARs to the Math Forum JAR repository. Read the settings-example.xml file as a reference.

Running and Testing Java Programs:

From the Command Line (easier)

During the build and install process, Maven2 automatically runs Java source code placed in the “test/java” folders inside the “src” folders of a module. If you want to only run the tests you can use the command:
mvn –e test
For example, in the dynamic branch the normal build process will run:
dynamic/cchat4vmt/concertchat/ConcertChatApps/cc-whiteboardchat/src/test/java/de/fhg/ipsi/concertchat/applications/whiteboard/WhiteboardGUITest.java.
If you want to test the GUI, go inside that file and set the DEBUG boolean variable to true. Then run the usual build from the dynamic folder with:
mvn -e clean package install
or if you just want to run tests:
mvn -e test
and WhiteboardGUITest?.java will run and pause the Maven process until you quit the GUI. In this case I wrote WhiteboardGUITest?.java to run the WhiteboardTest?.java program as running it from Eclipse is hard and time consuming (see below).

From Eclipse (time consuming):

1. It is best to first make sure you followed the instructions in the “Using Eclipse with Maven 2” section of this document to import into Eclipse the project you are interested in. You can work with an Eclipse project for a Maven module of the full VMT system. Then build and install its jars using Maven (with mvn –e clean package install).

2. Then you must make sure that your project is open in Eclipse and has in its Java Build Path all the needed JARs from your local Maven JAR repository. In Eclipse right-click on the project and choose Properties. Then click on “Java Build Path”. You should see listed the Java System Library for JVM 1.5 or higher (if not add it by clicking on Add Library… and choosing JRE System Library). You should also see listed JARs from the “M2_REPO/…” that are need to run the code you want. If not add them by doing the following (also see the picture below): Click on Add Variable… and select “M2_REPO” and then click the Extend… button. Then navigate the folder hierarchy to each JAR you need, select them all (by using the command-key with mouse clicks on a Mac or the control-key with mouse clicks under Windows) and click OK (this can take a long time as usually many JARs are needed for a project even if it is for a module). Then click on OK in the Properties for [projectname] window.

upload:image001.gif

You should now be able to right-click on any Java file in your project that is a program or a JUnit test case and run it using the “Run As” menu item. Remember that Java program is a class that has a static method named “main” that has one String array parameter.

VMTLobby (web application):

1. Use the sql script

VMT/lobby/extras/db/vmt.20090422.mysql.sql
to create a database called “vmt” (unless you already have a complete one). Under a UNIX operating system that means typing a terminal command like:
mysql -h hostname -u username -p < pathtodbfolder/vmt.20090422.mysql.sql
and then entering your password. Under Windows the command is like this:
mysql –e -h hostname -u username -p "pathtodbfolder/vmt.20090422.mysql.sql"
See http://dev.mysql.com/doc/refman/4.1/en/batch-mode.html if you need more help on running MySQL? script files.

Viewing databases in Eclipse:

2. If you did install the Galileo version of Eclipse you it include the Eclipse Data Tools (DTP). If not, install the latest stable DTP release with Eclipse’s built-in updater using this update site: http://download.eclipse.org/datatools/updates .

3. Open the perspective Database Development (use the Window menu, choose Open Perspective and then Other… . Then choose Database Development). In the Data Source Explorer view, click New Connection Profile and select MySQL? database connection (if it’s not there use Generic JDBC Connection). Name it “Localhost MySQL? vmt”. upload:image002.gif

Click Next,. On the next page, enter information to match your previously created database. Try the Test Connection button to make sure that the information is correct. upload:image003.gif

If there is no MySQL? JDBC Driver for the dropdown at the top, you might have to make one by using the new driver button ( upload:image004.gif ). If so choose a driver for MySQL? 4. If there isn’t one just use a MySQL? 5 driver. 'If' there isn’t one do the following:

4. Download and unzip the mysql driver mysql-connector-java (from http://dev.mysql.com/downloads/connector/j/5.1.html) which is needed to be able to connect to MySQL? from Java. Version 5.1.7 was the one being used at the time of writing these instructions. /usr/local/mysql-connector-java-5.1.7/mysql-connector-java-5.1.7-bin.jar is a good place to put the jar. We need to add this MySQL? driver to Eclipse. Open the Eclipse Preferences and select topic Connectivity -> Drivers. Click MySQL? -> 5.1 and then click Add…

upload:image005.gif

Select MySQL? JDBC Driver and click OK. In the following dialog, under the Jar List tab select the top item and click Edit Jar/Zip? (adding a new one doesn’t seem to work) and point to the mysql-connector-java-5.1.7-bin.jar. Click OK.

Click Next and check to make sure everything is correct for your connection profile, then click Final. Now you should be able to browse and edit the vmt database as shown below. To see the contents of a table and perhaps edit rows you must right-click on the table’s icon and choose Data->Edit. 'Later you do the same with the concertchat database.' upload:image006.gif

5. Make sure that the authentication realm of tomcat is configured correctly: Open tomcat6/conf/server.xml and check that is does NOT have an entry that starts with

<Realm className="org.apache.catalina.realm.JDBCRealm"
. Such entries are now put in the META-INF/context.xml files of each wepapp and should look like this after Maven2 is done filtering them to your settings:

<Realm className="org.apache.catalina.realm.JDBCRealm"
    driverName="com.mysql.jdbc.Driver"
    connectionURL="jdbc:mysql://home.old.mathforum.org:3306/vmt"
    connectionName="sa" connectionPassword="sa"
    userTable="aperson" userNameCol="Handle" userCredCol="Password"
    userRoleTable="aperson" roleNameCol="Role" />

This realm configuration is responsible for allowing users with certain role(s) access to specific JSP scripts stored in certain folders as defined in the web.xml file of the VMTLobby web application once it is deployed to “tomcat6/webapps/VMTLobby?/WEB-INF/web.xml“ In accordance with Maven default file structure, the file is at “VMT/lobby/src/main/webapp/WEB-INF/web.xml” before deployment. Defining what files and folders are accessible for a role is done using this syntax:

<security-constraint>
    <web-resource-collection>
         <web-resource-name>Protected User Area</web-resource-name>
         <URL-pattern>/commons/*</URL-pattern>
         <URL-pattern>/students/*</URL-pattern>
    </web-resource-collection>
    <auth-constraint>
          <role-name>student</role-name>
    </auth-constraint>
 </security-constraint>

6. Warning: During the building process Maven will replace the tomcat6/conf/tomcat-users.xml file of the tomcat6x installation with the file at extras/tomcat6/conf/tomcat-users.xml. If you have some information that should remain in the web server’s tomcat-users.xml file you must add to YOUR settings.xml file (within an active profile) the “tomcat6xconfdir” property to point to a directory containing a tomcat users file you would rather use and add the following code to that file:

<tomcat-users>
  <role rolename="tutor"/>
  <role rolename="manager"/>
  <role rolename="student"/>
  <role rolename="admin"/>
  <user username="staff" password="${tomcat-users.staff.password}" roles="manager"/>
</tomcat-users>

7. Check the web.xml of the VMTLobby web app at “VMT/lobby/src/main/webapp/WEB-INF/web.xml”. Make sure that the related properties in your settings.xml file contains the correct settings:

a. Connection to concert chat server (but later on this information should come from the database)

<context-param>
	<param-name>concertchat.host</param-name>
	<param-value>vmt.mathforum.org</param-value>
</context-param>
<context-param>
	<param-name>concertchat.port</param-name>
	<param-value>80</param-value>
</context-param>

b. Connection to the “vmt” database which is used to store all the lobby data (see #1 above):

<servlet>
	<servlet-name>DB</servlet-name>
	<description>Initialization of VMT->DB connection</description>
	<servlet-class>mathforum.vmt.dbdriver.DB</servlet-class>
	<init-param> 
		<param-name>vmt.db.jdbcDriver</param-name> 
		<param-value>com.mysql.jdbc.Driver</param-value> 
	</init-param>
	<init-param> 
		<param-name>vmt.db.URL</param-name> 	
		<param-value>jdbc:mysql://home.old.mathforum.org:3306/vmt
		</param-value> 
	</init-param>
	<init-param> 
		<param-name>vmt.db.user</param-name> 	
		<param-value>sa</param-value> 
	</init-param>
	<init-param> 
		<param-name>vmt.db.pw</param-name>
		<param-value>sa</param-value> 
	</init-param>
	<load-on-startup>5</load-on-startup>
</servlet>

8. Check the your settings.xml file (again probably at ~/.m2/settings.xml) and make sure the “tomcat6xhome” property is the absolute path to your installation of the Tomcat 6 container (web server). It should look something like this:

<tomcat6xhome>/opt/local/share/java/tomcat6</tomcat6xhome>

ConcertChat Server for VMT Webapps

1. Create the “concertchat” database by using the script file:
VMT/extras/db/concertchat.20090422.mysql.nodata.sql
2. Make sure the ipsi.persistency.* properties in your active profile in your settings.xml file are correct for accessing that database. Also make sure that the concertchat.* and lobby.* properties point to where the webserver for ConcertChat webapps and the VMTLobby webbapp respectively will actually be located on the Internet (normally they are on the same web server but they could be put on different web servers). Like the VMTLobby, the ConcertChat webapps also need access to the “vmt” database, so make sure the vmt.db.* properties are set correctly to the “vmt” database. See the comments in the general pom.xml file for guidance.

Deployment and Starting the Webserver:

1. Use Maven 2 to create and deploy the VMT .war files and start the Tomcat 6 web container (web server) using the following commands from the top-level VMT directory (you may have to proceed these with “sudo” and/or type your administrative account password if your don’t have write access to the webserver). a. If you need to stop the webserver:

mvn cargo:stop
b. To delete the webapps(during the “clean” phase), rebuild the webapps, and deploy configurations to the webserver:
mvn -e clean package install
c. To deploy the webapps’ .war files to the webserver:
mvn -e cargo:deploy
d. If you need to now start the webserver:
mvn -e cargo:start

If you see an error like this:

java.lang.VerifyError: (class: de/fhg/ipsi/concertchat/server/ServerChannelModule, method: messageReceived signature: (Lde/fraunhofer/ipsi/agilo/common/message/IMessage;)V) Incompatible argument to function
don’t worry because its probably this known bug: http://www.coderanch.com/t/90811/JBoss/java-lang-VerifyError-Incompatible-object Just use this command before you start the webserver to avoid the error being thrown:
export CATALINA_OPTS="-noverify"

You will see in the log/console the error:

### Could not start the persistence manager module - no persistency/recovery available
We are currently ignoring this error as it currently occurs on the production server with no ill effects.

If you want run tomcat without using Maven, change to the tomcat6/bin directory and run one of the scripts there. If you want to debug the server run

sh debug.sh
in that directory. Further instructions for debugging a webserver with an IDE like Eclipse are at: http://mathforum.org/pow08/index.php/JPuzzler/GettingStartedDeveloping#Setting_up_Tomcat_in_debug_mode

The VMTLobby Webapp:

You can redeploy the VMTLobby webapp using the Tomcat manager: open your browser, go to http://localhost:8080/manager/html (or whatever tomcat URL you are using), undeploy the old version and upload (use the "WAR file to deploy" section) the new VMTLobby.war. If that fails, check that there is a user such as “vmt” with role “manager” in the aperson table. There can only be one active realm for tomcat and the one we are using defines roles for the application and for the manager page as well. You can add this user using the VMTLobby website. Use the handle ‘vmt’ and change the password to something like ‘Vmttest01’. Then you must change the role to manager by using the following SQL command:

update `aperson` set `Role`='manager' where `PersonID`=3
when the PersonID? was set to 3 by the database. When you are done the data row in the aperson table should look something like this:
| PersonID | Handle   | Password  | …| Role    | CommunityName | TypeID | 
|        4 | vmt      | Vmttest01 | …| manager | all           | [NULL] | 

The ConcertChat Server for VMT Webapps:

The main VMT module for its ConcertChat server is cchat4vmt which produces the vmtChat.war. The cchat4vmt module has several sub-modules: concertchat (Concert Chat source from SourceForge?), vmt-ccext-stubs (client Web Service stubs that is also used by VMTLobby), vmtChat, and vmtClient. There is also a cc2vmt module that produces a cc2vmt.war that was used for testing purposes but might be no longer relevant.

Using VMT:

Leave the terminal window open and open a browser window. Type in the relevant manager URL which is probably: http://localhost:8080/manager/html Enter the manager tomcat-user account username and password and check to see if all the webapps started and are running fine. Then try logging-into the VMT Lobby, the URL probably is: http://localhost:8080/VMTLobby/ Use one of the default accounts to login. If the local information for the databases and the local tomcat directory was correct in the settings.xml, then you should see some content after login. Try creating a room and using it. Try logging-into the lobby in another Web browser as another user and then joining and using the same VMT room.

Sharing your work with the VMT Development Team:

Using the Math Forum Subversion Repository for VMT

Instructions for setting up Subversion and using it with Eclipse are in the GettingVMTDevSystem?.doc file you should have been given. If you don’t have it, please email Dr. Baba Kofi Weusijana at baba@mathforum.org and request the file. Currently to connect to our SVN repository you must be on-campus or using Drexel’s VPN. Eclipse uses its "Team" source version control tools for SVN. Here are two places to get documentation on it: Full documentation: http://www.eclipse.org/subversive/documentation/teamSupport.php Simple tutorial: http://www.ibm.com/developerworks/opensource/library/os-ecl-subversion Basically you should right-click on what project, folder, or file you are interested in and use an option under "Team". Updating means to get the latest version from the repository. Synchronizing means comparing your file(s) to the repository (you can also use the "Compare With" right-click menu options). If a conflict is found (you have changed a file that someone else also changed) its might be best to contact the developer who made the change to come to an agreement on what the new merged file’s contents should be. Committing means submitting your file(s) to the repository as the latest version. Do not commit changes you have not tested! Also please provide a comment each time you commit some changes so that it is easy to understand why you made your changes and go back to that revision if needed. Please do not commit the Maven “target” folders as they contain files built by Maven. The best way to avoid that is to run
mvn –e clean
to remove all “target” folders before you synchronize and commit.
SVN is primarily for storing source code, adding built artifacts unnecessarily increases the size of the repository and built artifacts often only work on the platform and language encoding under which they were built. The same is true for the “bin” folder Eclipse sometimes makes at the root folder of a project; please don’t commit them to the SVN repository. You can tell SVN to ignore an item by right-clicking on it and choosing Team->Add to svn:ignore… (you might have to choose Team->revert… first). Built JARs belong in the JAR repository (see below). Please update this instruction file if you notice a mistake or an omission!

Using the Math Forum Archiva JAR Repository for VMT

Whenever you are done making changes to VMT and commit them to the SVN repository, you should also update the JAR repository with your new VMT JARs. Currently to connect to our Archiva JAR repository you must be on-campus or using Drexel’s VPN. First type:
mvn –e clean package install
which will build and test your version of VMT and install its JAR files into your local Maven repository. Then type:
mvn –e deploy
That command will upload via the Web (HTTP protocol) your version of the VMT JARs to the Math Forum Archiva JAR repository. Do NOT use the
mvn deploy:deploy
command as it currently doesn’t work for VMT. Due to a bug in Apache’s Archiva (http://jira.codehaus.org/browse/MRM-770) do NOT use the classifier tag for any component you are using or developing.

You can deploy just one jar using the

mvn deploy:deploy-file
command or just use this web page: http://zinc.mathforum.org:8080/archiva/upload.action. More information is available at: http://maven.apache.org/plugins/maven-deploy-plugin/usage.html.

If Maven ran out of memory (Java heap space) you can increase it by typing:

Under Windows:

set MAVEN_OPTS=-Xmx256m
Under UNIX systems:
export MAVEN_OPTS='-Xmx256m'

If you only want to use your local JAR repository so you don’t have to wait for JARs to download or be checked against the Archiva and default Maven repositories, you can run Maven in offline mode by using the –o option like this:

mvn –o clean package install

It helps to cleanup your local JAR repository every now and then. There is no way as of yet to force Maven to re-download poms it has already [see bug MNG-1258]. Poms are being updated without version number increment even though they shouldn't. If the problem might exist with VMT artifacts only, removing [local-maven-repository]/org/mathforum/vmt should be enough. Remember that the Maven repository usually is located in the folder:

[Windows]

C:\Documents and Settings\<Your Login Name>\.m2\repository
[Unix]
~/.m2/repository

VMTwiki WebApp?:

Installing PHP5:

Macs: You can’t use the default PHP5 with Tomcat6 because it lacks php-cgi (and I can’t find a way to add it). Download and install this special build for Macs from: http://www.entropy.ch/software/macosx/php

Other Operating Systems: See the appropriate page for your OS on the MediaWiki? installation page and it will explain how to install PHP5: http://www.mediawiki.org/wiki/Manual:Installation_guide copy and rename php.ini-dist to php.ini

Integrating PHP5 with Tomcat6

Get the latest stable version of Java Bridge with its documentation (should be a file with a name like php-java-bridge_5.4.4.2_documentation.zip) from: http://sourceforge.net/projects/php-java-bridge/files/ Extract the file and use the cd terminal command to go inside of the resulting folder. Test your PHP installation with:
java -classpath JavaBridge.war TestInstallation
If the test results are fine, follow the instructions on this page under the section “Configure Tomcat for PHP”: http://php-java-bridge.sourceforge.net/pjb/tomcat6.php If the test doesn’t work, just use the more common Apache webserver to serve VMTwiki. Apache is usually already installed for Mac OS 10.5. If you need to install it, first read about how from the installation instructions for your operating system linked from: http://www.mediawiki.org/wiki/Manual:Installation_guide

Installing MediaWiki?:

Follow the installation instructions for your OS linked from: http://www.mediawiki.org/wiki/Manual:Installation_guide

If when you try the MySQL? command:

mysql -u root -p -e "SET PASSWORD FOR wikiuser = OLD_PASSWORD(YOUR-WIKIDB-PASSWORD)"
you get the error:
ERROR 1133 (42000) at line 1: Can't find any matching row in the user table
Don’t worry about it because the Web-based installation process will set it for you.

After you move the mediawiki-1.x.x folder to your web server, name the folder “vmtwiki”.

For the wiki configuration page:

Follow the instructions to install: Fill in the details it asks for and wait while the installer does its work. The system will ask for the following information:

   1. Wiki name. Fill in “VMT”
   2. Contact email. Fill in your email address
   3. Language. Choose from drop down list
   4. Copyright/license. Select from: no license metadata (VMT Wiki’s default), GNU Free Documentation License 1.2, A Creative Commons license.
   5. Admin username and password. Fill in with the administrative username and password you use to log into the VMTLobby
   6. Whether caching will be turned on. Off is what we generally use for VMT. If caching is turned on, you must specify the memcached servers you are using.

Enable all of these after testing that your sendmail program is working. Otherwise, disable them all.
   1. Whether email features are enabled globally.
   2. Whether user-to-user email is enabled.
   3. Email notification. Select from disabled, enabled for changes to user discussion pages only, or preferably, enabled for changes to user discussion page and to pages on watchlists.

          If email is enabled, whether email address authentication is enabled.

   1. Database type. Select from MySQL? or PostgreSQL?.
   2. Database host name. Fill in.
   3. Database name. Use the default "wikidb".
   4. Database username. Use the default "wikiuser".
   5. Database password. Fill in the same password you used or tried when you made the wikidb database in earlier steps.
   6. Whether to use the superuser account to create the database user and tables. Check the box.
   7. Database superuser name. Fill in. Defaults to "root".
   8. Database superuser password. Fill in.
         1. Database table prefix. If more than one wiki is to use the same database instance, the prefix will separate the wiki instances. Fill in.
         2. Database character set. Select “MySQL? 4.1/5.0 UTF-8”.

Once you have the wiki working with the new database, stop the wiki’s webserver, then move the vmtwiki folder outside the web server and replace it with the extracted contents of the vmtwiki.war file from http://vmt.mathforum.org/source/vmtwiki.war . Extraction can be done from a command line like this

jar xvf vmtwiki.war
although it can also be accomplished with some ZIP utilities. If the extracted folder is not named exactly “vmtwiki” then rename it so. Then edit the LocalSettings?.php to match your setup (especially your database connection setup). The best way to do that is use a text tool like BBedit to compare the LocalSettings?.php files. You must also configure the vmtwiki/LocalPerInstallation?.php file. You can use the LocalSettings?-example.php and LocalPerInstallation?-example.php files in the SVN repository as guides.

HomePage | RecentChanges | Index | Preferences | Upload
This page is read-only | View other revisions
Last edited September 18, 2009 10:11 am by Sgoggins (diff)
Search: