- From: Matthew Wilson <matthew@mjwilson.demon.co.uk>
- Date: Wed, 23 Mar 2005 22:14:18 +0000
- To: www-annotation@w3.org
- Message-ID: <4241EA3A.8060300@mjwilson.demon.co.uk>
I thought I would try installing Annotea on Windows again. Here's what I did, starting on a machine with Windows XP Service Pack 2. I have also written this assuming that the machine has separate administrator and normal users. I've attached a couple of patches which seem to be necessary for running with the latest versions of MySQL or Perl's CGI.pm (discussed below). *** As an administrator user *** 1. Install ActivePerl, MySQL, and Apache. (I installed ActivePerl 5.8 Build 811, Apache 2.0.53, and My SQL 4.1.10a (essentials package).) Do set a root password on MySQL, there was a recent attack on Windows machines without passwords I think. I initially tried selecting 'Best Support for Multilingualism' on MySQL, but this gave errors when I ran it. So I gave up and reinstalled Latin-1 as the default character set. I chose to have the MySQL executables in my path. 2. Install the Perl DBI packages. ppm ppm> install DBI ppm> install DBD-mysql ppm> install Crypt-PasswdMD5 ppm> exit 3. Install a cvs client (I have cvs 1.11.5). *** As a normal user *** 4. Get Perllib as described here: http://www.w3.org/1999/02/26-modules/User/Annotations-HOWTO#Install_Perllib I changed "-r V1_1" to "-r V1_2" though. 5. Set up the database as described here: http://www.w3.org/1999/02/26-modules/User/RdfSQL-HOWTO.html However, type the mysql commands as "mysql -u root -p" - this will cause the executable to prompt you for the root password. Additionally, with MySQL 4.1, you need to change RdfObjects.mysql, since default values are no longer allowed for auto-increment fields (see http://dev.mysql.com/doc/mysql/en/upgrading-from-4-0.html). Patch attached. I don't know what effect this has on the functionality. 6. Set up conf.prop as described here: http://www.w3.org/1999/02/26-modules/User/Annotations-HOWTO#Set_up_datastore 7. In the same directory as conf.prop, create a file called annotate.prop with the line auth.database.parms: -type => 'sdbm', -file => '<full path to Apache installation>/users' and a file Annotations.access.prop with the same contents. 8. Edit the "annotate" and "access" scripts. Point to the installed Perl script on the first line. Find the line "-storeIn => '/tmp/'", and replace /tmp with a suitable temporary directory (eg 'C:/Windows/Temp' - forward slashes are fine here). 9. I found I had to update the root password to allow access from Perl as described here: http://dev.mysql.com/doc/mysql/en/old-client.html This is because the version of DBD::MySQL available from PPM is not fully up to date with MySQL 4.1. If you miss out this step, you will end up with errors that the script cannot connect to the database. 10. Patch W3C/Util/W3CDebugCGI.pm as attached. This is to accomodate an internal change in CGI.pm. (The patch should be backwards compatible but I can't test that.) *** As an administrator user *** 11. Configure the web server. This is based on the instructions here: http://www.w3.org/1999/02/26-modules/User/Annotations-HOWTO#Configure_the_Web_Server I have the following added to httpd.conf: LoadModule auth_dbm_module modules/mod_auth_dbm.so ScriptAlias /annotations "<full path to perllib installation>/perl/modules/W3C/Annotations/CGI/annotate" <Location "/annotations"> AllowOverride None Options ExecCGI Allow from all AuthType Basic AuthName Annotations AuthDBMType SDBM AuthDBMUserFile "<full path to Apache installation>/users" AuthDBMGroupFile "<full path to Apache installation>/groups" <Limit PUT POST DELETE> Require group registered </Limit> </Location> ScriptAlias /access "<full path to perllib installation>/perl/modules/W3C/Annotations/CGI/access" <Location "/access"> AllowOverride None Options ExecCGI Allow from all </Location> 12. cd to the Apache installation. perl bin\dbmmanager.pl users adduser <email address> - required perl bin\dbmmanager.pl groups adduser <email address> - required 13. Restart the web server with the new configuration. *** As a normal user *** http://localhost/annotations should now return the interactive page with the message "Welcome to the W3C Annotation Server!" (Firefox just returns an empty RDF document from this page, so you may need to use IE for this page.) It should also be possible to select "Create an Annotation" with the default information in the textarea and to achieve success. (I do see the following warnings however: warning: Statements.reifiedId: default option not selected - defaulting to "" anyways warning: Statements.reifiedId: default option not selected - defaulting to "" anyways warning: Statements.containerId: default option not selected - defaulting to "" anyways warning: Statements.containerId: default option not selected - defaulting to "" anyways) I hope I haven't missed any steps. Matthew Wilson
Index: W3CDebugCGI.pm =================================================================== RCS file: /sources/public/perl/modules/W3C/Util/W3CDebugCGI.pm,v retrieving revision 1.83.2.1 diff -u -r1.83.2.1 W3CDebugCGI.pm --- W3CDebugCGI.pm 8 Sep 2003 19:26:44 -0000 1.83.2.1 +++ W3CDebugCGI.pm 23 Mar 2005 21:04:11 -0000 @@ -615,7 +615,18 @@ # overloaded function so we can grab the POST_STRING sub read_from_client { - my($self, $fh, $buff, $len, $offset) = @_; + # NB the definition of read_from_client changed in CGI.pm 3.01. + # Version 3.00 calls "$self->read_from_client(\*STDIN,\$query_string,$content_length,0)" + # Version 3.01 calls "$self->read_from_client(\$query_string,$content_length,0)" + my($self, $fh, $buff, $len, $offset); + if (scalar @_ == 5) { + ($self, $fh, $buff, $len, $offset) = @_; + } elsif (scalar @_ == 4) { + ($self, $buff, $len, $offset) = @_; + $fh = \*STDIN; + } else { + die "Unexpected arguments in read_from_client"; + } local $^W=0; # prevent a warning return undef unless defined($fh); no strict; # 'cause CGI.pm insists on passing filehandles around by name, not GLOB
Index: RdfObjects.mysql =================================================================== RCS file: /sources/public/perl/modules/W3C/Rdf/bin/RdfObjects.mysql,v retrieving revision 1.10 diff -u -r1.10 RdfObjects.mysql --- RdfObjects.mysql 4 May 2003 05:58:05 -0000 1.10 +++ RdfObjects.mysql 23 Mar 2005 20:46:03 -0000 @@ -12,7 +12,7 @@ # Table structure for table 'AttributionClosures' # CREATE TABLE AttributionClosures ( - id int(10) unsigned DEFAULT '0' NOT NULL auto_increment, + id int(10) unsigned NOT NULL auto_increment, sub int(10) unsigned DEFAULT '0' NOT NULL, super int(10) unsigned DEFAULT '0' NOT NULL, g int(10) unsigned DEFAULT '0' NOT NULL, @@ -25,7 +25,7 @@ # Table structure for table 'Attributions' # CREATE TABLE Attributions ( - id int(11) DEFAULT '0' NOT NULL auto_increment, + id int(11) NOT NULL auto_increment, type enum('Source','Generated','Reified') DEFAULT 'Source' NOT NULL, rdfId int(10) unsigned DEFAULT '0' NOT NULL, parent int(10) unsigned DEFAULT '0' NOT NULL, @@ -42,7 +42,7 @@ # Table structure for table 'GenIds' # CREATE TABLE GenIds ( - id int(11) DEFAULT '0' NOT NULL auto_increment, + id int(11) NOT NULL auto_increment, attribution int(10) unsigned DEFAULT '0' NOT NULL, PRIMARY KEY (id), KEY i_attribution (attribution) @@ -52,7 +52,7 @@ # Table structure for table 'MappedNodes' # CREATE TABLE MappedNodes ( - id int(10) unsigned DEFAULT '0' NOT NULL auto_increment, + id int(10) unsigned NOT NULL auto_increment, predicate int(10) unsigned DEFAULT '0' NOT NULL, subject int(10) unsigned DEFAULT '0' NOT NULL, object int(10) unsigned DEFAULT '0' NOT NULL, @@ -66,7 +66,7 @@ # Table structure for table 'MappedStatements' # CREATE TABLE MappedStatements ( - id int(10) unsigned DEFAULT '0' NOT NULL auto_increment, + id int(10) unsigned NOT NULL auto_increment, predicate int(10) unsigned, predicateMap int(10) unsigned, subject int(10) unsigned, @@ -83,7 +83,7 @@ # Table structure for table 'RdfIds' # CREATE TABLE RdfIds ( - id int(11) DEFAULT '0' NOT NULL auto_increment, + id int(11) NOT NULL auto_increment, type enum('ID','Ref','String','Fake','Gen') DEFAULT 'ID' NOT NULL, genId int(10) unsigned DEFAULT '0' NOT NULL, uri int(10) unsigned DEFAULT '0' NOT NULL, @@ -96,7 +96,7 @@ # Table structure for table 'Statements' # CREATE TABLE Statements ( - id int(10) unsigned DEFAULT '0' NOT NULL auto_increment, + id int(10) unsigned NOT NULL auto_increment, predicate int(10) unsigned DEFAULT '0' NOT NULL, subject int(10) unsigned DEFAULT '0' NOT NULL, object int(10) unsigned DEFAULT '0' NOT NULL, @@ -110,7 +110,7 @@ # Table structure for table 'Strings' # CREATE TABLE Strings ( - id int(11) DEFAULT '0' NOT NULL auto_increment, + id int(11) NOT NULL auto_increment, datatype int(10) unsigned DEFAULT '0' NOT NULL, encoding enum('PLAIN','XML') DEFAULT 'PLAIN' NOT NULL, md5hex varchar(32) DEFAULT '' NOT NULL, @@ -123,7 +123,7 @@ # Table structure for table 'Uris' # CREATE TABLE Uris ( - id int(10) unsigned DEFAULT '0' NOT NULL auto_increment, + id int(10) unsigned NOT NULL auto_increment, uri varchar(255) binary DEFAULT '' NOT NULL, PRIMARY KEY (id), UNIQUE u_uri (uri)
Received on Wednesday, 23 March 2005 22:15:35 UTC