| | 2 | [[BR]] |
| | 3 | [[BR]] |
| | 4 | Note that this assumes you have an apache server running and know how to make basic configuration changes to it. |
| | 5 | [[BR]] |
| | 6 | [[BR]] |
| | 7 | Check out the dataserver source from svn: [[BR]] |
| | 8 | https://www.zotero.org/svn/dataserver/trunk/ [[BR]] |
| | 9 | [[BR]] |
| | 10 | set up an apache VirtualHost for the dataserver [[BR]] |
| | 11 | name it synctest.zotero.org [[BR]] |
| | 12 | add a ServerAlias for apitest.zotero.org [[BR]] |
| | 13 | add an /etc/hosts entry for synctest.zotero.org and apitest.zotero.org to 127.0.0.1 [[BR]] |
| | 14 | in the VirtualHost, add AllowEncodedSlashes On [[BR]] |
| | 15 | add a <Directory> entry for the htdocs subdir [[BR]] |
| | 16 | {{{ |
| | 17 | <Directory "/path/to/zotero-dataserver/htdocs"> |
| | 18 | Options FollowSymLinks MultiViews |
| | 19 | AllowOverride All |
| | 20 | Order allow,deny |
| | 21 | Allow from all |
| | 22 | </Directory> |
| | 23 | }}} |
| | 24 | this directory is also the docroot [[BR]] |
| | 25 | [[BR]] |
| | 26 | Copy the sample config files under include/config and remove "sample" from the filenames [[BR]] |
| | 27 | fill out credentials and paths in config files [[BR]] |
| | 28 | [[BR]] |
| | 29 | create mysql user zoterotest [[BR]] |
| | 30 | password testtest [[BR]] |
| | 31 | create zoterotest and zoterotest_sessions Databases and give zoterotest user access to them [[BR]] |
| | 32 | [[BR]] |
| | 33 | create a zotero_www_test DB [[BR]] |
| | 34 | create a users table for zotero_www_test [[BR]] |
| | 35 | {{{ |
| | 36 | CREATE TABLE `users` ( |
| | 37 | `userID` mediumint UNSIGNED auto_increment NOT NULL, |
| | 38 | `username` varchar(40) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, |
| | 39 | `slug` varchar(40) CHARACTER SET utf8 COLLATE utf8_general_ci NULL, |
| | 40 | `password` char(40) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, |
| | 41 | `email` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, |
| | 42 | `openid` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL, |
| | 43 | `role` enum('member', |
| | 44 | 'admin') DEFAULT 'member' NOT NULL, |
| | 45 | `resetValidationKey` char(40) CHARACTER SET utf8 COLLATE utf8_bin NULL, |
| | 46 | `resetValidationExp` int NULL, |
| | 47 | `emailValidationKey` char(10) CHARACTER SET utf8 COLLATE utf8_bin NULL, |
| | 48 | `emailValidated` tinyint(1) DEFAULT '0' NOT NULL, |
| | 49 | `hasImage` tinyint(1) DEFAULT '0' NOT NULL, |
| | 50 | `lastUpdated` timestamp ON UPDATE CURRENT_TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, |
| | 51 | `dateRegistered` timestamp NOT NULL, |
| | 52 | PRIMARY KEY (`userID`), |
| | 53 | UNIQUE KEY (`username`), |
| | 54 | UNIQUE KEY (`slug`), |
| | 55 | UNIQUE KEY (`email`), |
| | 56 | UNIQUE KEY (`resetValidationKey`) |
| | 57 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; |
| | 58 | }}} |
| | 59 | necessary fields should be userID, username, password, slug [[BR]] |
| | 60 | password entries are generated by taking a sha1 hash of the user's password concatenated to the salt. [[BR]] |
| | 61 | slugs are generated by taking the username and trimming whitespace, lowercasing, {{{preg_replace("/[^a-z0-9 ._-]/", "", $input)}}}, and replacing spaces with underscores [[BR]] |
| | 62 | [[BR]] |
| | 63 | give write access to the tmp dir to apache [[BR]] |
| | 64 | loading http://synctest.zotero.org should give a page saying "Nothing to see here" [[BR]] |
| | 65 | [[BR]] |
| | 66 | create or edit .my.cnf in your home dir with [client] or [mysql] and user = and password = for root [[BR]] |
| | 67 | {{{ |
| | 68 | [client] |
| | 69 | user = root |
| | 70 | password = foobar |
| | 71 | }}} |
| | 72 | |
| | 73 | cd to 'misc' directory [[BR]] |
| | 74 | ./test_reset [[BR]] |