wiki:dataserver_setup

This document provides basic instructions for setting up your own instance of the Zotero data server for development and testing. Please feel free to flesh out or otherwise improve these instructions as you see fit. Note that all relevant inquiries should be directed to the Zotero development mailing list (zotero-dev@…) and that the core development team directed by the Center for History and New Media will not be able to respond to requests for support.

Note that this assumes you have an apache server running and know how to make basic configuration changes to it.

Check out the dataserver source from svn:
https://www.zotero.org/svn/dataserver/trunk/

set up an apache VirtualHost for the dataserver
name it synctest.zotero.org
add a ServerAlias for apitest.zotero.org
add an /etc/hosts entry for synctest.zotero.org and apitest.zotero.org to 127.0.0.1
in the VirtualHost, add AllowEncodedSlashes On
add a <Directory> entry for the htdocs subdir

<Directory "/path/to/zotero-dataserver/htdocs">
    Options FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

this directory is also the docroot

Copy the sample config files under include/config and remove "sample" from the filenames
fill out credentials and paths in config files

create mysql user zoterotest
password testtest
create zoterotest and zoterotest_sessions Databases and give zoterotest user access to them

create a zotero_www_test DB
create a users table for zotero_www_test

CREATE TABLE  `users` (
  `userID`             mediumint      UNSIGNED auto_increment                               NOT NULL,
  `username`           varchar(40)    CHARACTER SET utf8 COLLATE utf8_general_ci            NOT NULL,
  `slug`               varchar(40)    CHARACTER SET utf8 COLLATE utf8_general_ci                NULL,
  `password`           char(40)       CHARACTER SET utf8 COLLATE utf8_bin                   NOT NULL,
  `email`              varchar(100)   CHARACTER SET utf8 COLLATE utf8_general_ci            NOT NULL,
  `openid`             varchar(100)   CHARACTER SET utf8 COLLATE utf8_general_ci                NULL,
  `role`               enum('member',
                            'admin')  DEFAULT 'member'                                      NOT NULL,
  `resetValidationKey` char(40)       CHARACTER SET utf8 COLLATE utf8_bin                       NULL,
  `resetValidationExp` int                                                                      NULL,
  `emailValidationKey` char(10)       CHARACTER SET utf8 COLLATE utf8_bin                       NULL,
  `emailValidated`     tinyint(1)     DEFAULT '0'                                           NOT NULL,
  `hasImage`           tinyint(1)     DEFAULT '0'                                           NOT NULL,
  `lastUpdated`        timestamp      ON UPDATE CURRENT_TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
  `dateRegistered`     timestamp                                                            NOT NULL,
  PRIMARY KEY (`userID`),
  UNIQUE KEY  (`username`),
  UNIQUE KEY  (`slug`),
  UNIQUE KEY  (`email`),
  UNIQUE KEY  (`resetValidationKey`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

necessary fields should be userID, username, password, slug
password entries are generated by taking a sha1 hash of the user's password concatenated to the salt.
slugs are generated by taking the username and trimming whitespace, lowercasing, preg_replace("/[^a-z0-9 ._-]/", "", $input), and replacing spaces with underscores

give write access to the tmp dir to apache
loading http://synctest.zotero.org should give a page saying "Nothing to see here"

create or edit .my.cnf in your home dir with [client] or [mysql] and user = and password = for root

[client]
user = root
password = foobar

cd to 'misc' directory
./test_reset

Last modified 6 years ago Last modified on 06/21/10 17:13:51