Linux Installation See the installation page http://wiki.wocommunity.org/display/documentation/deploying+on+linux Added goodies (project Wonder) Install couple of more goodies from Wonder. I Installed my distribution in /opt/wonder $: git clone git://github.com/wocommunity/wonder.git /opt/wonder I prefer to keep the WebObjects items separate from the rest of the http, so I created /var/www/apps (my document root is /var/www), changed it's ownership to appserver and made links to the needed WebObjects libraries. I needed to perform a bit of a hack because of a different naming convention between Mac OS X and Linux. Finally I changed the ownership of both the Wonder and the WO libraries: $: sudo mkdir /var/www/apps $: sudo chown appserver:appserveradm /var/www/apps $: sudo ln s /opt/library/webobjects/wodocumentroot/webobjects/frameworks /var/www/apps $: sudo ln s /opt/library/webobjects/wodocumentroot/webobjects/java /var/www/apps $: mkdir p /opt/local/library/frameworks/excelgenerator.framework/resources/java/ $: ln s /opt/wonder/frameworks/excel/excelgenerator/libraries/poi *.jar \ /opt/local/library/frameworks/excelgenerator.framework/resources/java/ $: chown R appserver:appserveradm /opt/library $: chown R appserver:appserveradm /opt/local $: chown R appserver:appserveradm /opt/wonder Apache Configuration If you want to keep /cgi-bin/webobjects as the base URL (best) you will need to comment out the line that starts with ScriptAlias /cgi-bin, otherwise you need to modify the value of WebObjectsAlias in /etc/httpd/conf.d/wobobjects.conf. Check your Apache installation to verify the the syntax is correct and the WebObjects module is loaded and then start it (optionally have it start automatically at boot up time): $: apachectl M $: sudo /etc/init.d/httpd start $: sudo /sbin/chkconfig httpd on MySQL Make sure MySQL is installed on your web server and start it. It is advisable that you set a password for it. You will need the java library mysql-connector-java.jar, on my system it is in /usr/share/java. CBIWebDB uses two separate databases, which can be running on the same machine. One is a small configuration database (installed on the web server), the other contains the information for the scheduler, data and subjects. We have the second database installed on a server behind a firewall that is connected to the web server via a private network. The data server accepts MySQL network connections only from a specific user from the web server. The database transactions, including the user name and password, travel only on the private network. It's not Fort Knox, but it does provide a modicum of security. 1
Retrieve the initial setup files: $: svn co http://cbi.nyu.edu/svn/cbiwebdb/trunk/setup CBIWebDB/Setup The included DBInit.sh script will create two files to initialize the two databases. Following is an example run: $: CBIWebDB/Setup/DBInit.sh Store scripts in directory [~/CBIWebDB/Setup]: /tmp Setting up local database ========================= "Site Name" is the name that will be used at the top of the web pages. "Scheduler Database Host" is the node where the scheduler database resides. This can be the same host as the web server (not recommended.) All transactions on the scheduler database are performed using a user that can access the database using a password only from the webserver host. This user will be created with grants when setting up the scheduler database. Site Name: MyCalendar Scheduler Database Host: dataserver.mynetwork Scheduler Database Name: schedulerdb Scheduler Database Username: SchedulerUser Scheduler Database Password: SchedulerDB! Users information is extracted either from an LDAP server or an Active Directory server. LDAP is used on Unix/Linux servers and AD is used on MS servers. The "CN" has to be specified in full. NIX or MS [NIX]? NIX LDAP/AD Host: ldapserver.mynetwork LDAP/AD Port [389]: LDAP CN: dc=mysite,dc=mygroup The database can be configured to store additional patient comments. Database stores patient comments (Y/[N])? The "Super password" allows to log into CBIWebDB as another user (great for testing.) To disable this feature hit return. THIS SHOULD NOT BE THE SAME AS THE SYSTEMS ROOT PASSWORD AND SHOULD BE KEPT SECRET. Super Password: JackInTheBox "Cancel Period" determines the minimum number of hours before a scheduled session required for a regular user to delete it. If the session is deleted during that time frame, it will be removed from the calendar, but it will be marked as "CANCELLED". If not using "Cancel Period" hit return. Cancel Period: If awarding "Bonus" credits to users, set "Use Bonus" and "Initial Bonus" value. Use Bonus (Y/[N])? 2
Use WebDB subject data base ([Y]/N)? Setting up scheduler/images/subjects database ============================================= Webser Host [myworkstation.mynetwork] : webserver.mynetwork At least one "Administrator" needs to be set up. This can be either an individual user or a group (preferred). The "ID" is the short name used in the LDAP (like what you get when executing the command "id un" or "id gn" from the terminal). The "Name" is only for display purposes and can be anything. Administrator LDAP ID : dbadmin Administrator Name : DBAdmin Is dbadmin a Group or a User ([G]/U)? At least one "Facility" needs to be set up. This can be either a facility that is used to collect data, such as an MRI machine, or not, such as a meeting room. Facility Name : MRI Data Collection in MRI ([Y]/N)? Execute 'mysql < /tmp/webdb.mysql' on webserver.mynetwork Execute 'mysql < /tmp/datadb.mysql' on dataserver.mynetwork 3
Notes: Set usernames and passwords to reflect your needs. The Super Password allows an administrator to log in as someone else. This is used to test problems that users might have without having to know their password. All usernames and passwords are checked against the LDAP server. The Cancel Period is a special feature of our installation. We allow users to cancel sessions up to the number of hours specified in this field without incurring a charge (some experiments require the subject to be screened 24 hours in advance of the scan, if the subject does not pass the screening the researcher has to cancel the experiment). If the session is deleted during the Cancel Period it is marked as canceled, otherwise it is marked as deleted. The Bonus is closely related to the above Cancel Period. In our installation users gain a bonus hour for each paid hour of scanner time. For every 10 bonus hours, you get a 1 hour credit that can be used to pay for eventual canceled sessions. For more details see the files under doc/schema from our svn repository: $: svn co http://cbi.nyu.edu/svn/cbiwebdb/trunk/doc CBIWebDB/doc CBIWebDB Obtain the executable from our svn repository (you are free to obtain all the sources, but do you really want to?), install it in your WebObjects http directory and set the correct ownership: $: svn co http://cbi.nyu.edu/svn/cbiwebdb/trunk/dist CBIWebDB/dist $: rsync auv CBIWebDB/dist/CBIWebDB.woa /var/www/apps/ $: chown R appserver:appserveradm /var/www/apps/cbiwebdb.woa With wotaskd and JavaMonitor running, open a web browser and enter the following address: http://localhost:56789/cgi bin/webobjects/javamonitor.woa This should bring up the JavaMonitor application's main page. You will need to add your webserver as a host making sure that you select the appropriate O/S. Add CBIWebDB as an application and chose a name (I've called it in this example WebDB). Following are screen shots of the application's two main configuration areas. You will need to make sure that the entries reflect your installation. Auto Recover will restart the application in case of a crash. Debugging enabled is optional, but, at least at first, it can be helpful. The argument -Xmx256m allocates 256 MB to the Java heap, which should be more than enough. The argument -DWOEnvClassPath should reflect the location of your mysql-connector-java.jar library. Starting Port should be set to something not already used on your system, 2001 usually works. Statistics Page Password allows to access a statics page that displays the application's usage, etc. 4
Finally from the configuration page press the Detail View icon and add an instance. The Status icon should animate and after a brief period (15-20 seconds) it should turn to ON and the name at the top of the page should become a link. Click on that link and take it for a spin! 5
Starting/Stopping/Updating The CBIWebDB/Setup directory contains a few utility scripts: wod woaction woupdate # System V init script # Script to interact with CBIWebDB application # Script to update and restart CBIWebDB application The wod file contains a System V style init script. It might need editing to conform with the particular Linux distribution being run. The woaction file contains a script to start and stop the application. The woupdate file contains a script to update the application from the svn repository and restart the application. The application will be named CBIWebDB.<date>.woa (where <date> is the current date in the format yy.mm.dd) to allow to revert to the previous version. The script needs to be edited to store correct values, look for items marked #### Edit:. Security MySQL allows any user to masquerade as another user via the -u flag. The default CBIWebDB installation connects to the local database with user appserver and no password. This means that any computer savvy user that has access to the webserver can read the configuration parameters, including the scheduler database's password and the super password (if set). To prevent this, the best way is to set a password for appserver on the local database and modify CBIWebDB to use it. Securing MySQL. On the webserver run mysql as a privileged user and: mysql> set password for appserver@localhost = password('<password>'); Verify that no other user besides appserver can read the WebDB tables. Securing CBIWebDB. Edit the file CBIWebDB.woa/Contents/Resources/WebDB.eomodeld/index.eomodeld and modify the value of the field password (towards the end of the file) from an empty string to the password you set above. Also remove world read privileges for the index file: $ emacs CBIWebDB.woa/Contents/Resources/WebDB.eomodeld/index.eomodeld <do the password edit> $ chmod o r CBIWebDB.woa/Contents/Resources/WebDB.eomodeld/index.eomodeld For assistance please contact Valerio Luccio: valerio.luccio@nyu.edu 6