Retrieving Sources
Change directory to "/srv/http/":1 | $ cd /srv/http/ |
1 | $ sudo git clone https: //github .com /Panzerkampfwagen/dataserver .git |
1 | $ sudo mv dataserver ZoteroDataServer |
Decompress part of the archive ("ZendFramework-1.11.12/library/Zend") to the "include" directory ("/srv/http/ZoteroDataServer/include/Zend"):
1 | $ sudo tar -xvf ZendFramework-1.11.12. tar .gz --strip=3 -C "/srv/http/ZoteroDataServer/include/Zend" "ZendFramework-1.11.12/library/Zend" |
Configuring Apache HTTP Server and PHP Engine
Install Apache server:1 | $ sudo pacman -S apache php php-apache php-mcrypt |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | NameVirtualHost *:85 < VirtualHost *:85> ServerName *:85 DocumentRoot "/srv/http/ZoteroDataServer/htdocs" ErrorLog "/var/log/httpd/Zotero-Data-Server-Error.log" CustomLog "/var/log/httpd/Zotero-Data-Server-Access.log" common < Directory "/srv/http/ZoteroDataServer/htdocs"> Options FollowSymLinks MultiViews AllowOverride All Order allow,deny Allow from all </ Directory > AllowEncodedSlashes On </ VirtualHost > |
1 2 3 | LoadModule rewrite_module modules/mod_rewrite.so LoadModule php5_module modules/libphp5.so LoadModule vhost_alias_module modules/mod_vhost_alias.so |
1 2 | Include conf/extra/php5_module.conf Include conf/extra/httpd-vhosts.conf |
1 | TypesConfig conf/mime.types |
1 | Listen 85 |
1 | $ sudo /etc/rc .d /httpd start |
1 2 3 4 | extension=sockets.so extension=mcrypt.so extension=mysql.so extension=mysqli.so |
Configuring MySQL
Install MySQL:1 | $ sudo pacman -S mysql |
1 | $ sudo /etc/rc .d /mysqld stop |
1 | $ sudo mysqld_safe --skip-grant-tables & |
1 | $ sudo mysql -u root mysql |
1 2 3 | mysql> UPDATE mysql.user SET Password=PASSWORD( 'SecurePassword' ) WHERE User= 'root' ; mysql> FLUSH PRIVILEGES; mysql> EXIT |
1 2 3 | [mysqld] ... default- time -zone = '+0:00' |
1 | $ sudo pacman -S phpmyadmin |
Configuring Zotero Data Server
Main settings are stored in "/srv/http/ZoteroDataServer/include/config/config.inc.php" file:1 2 3 4 5 6 | ... public static $SYNC_DOMAIN = '127.0.0.1:85' ; ... public static $CLI_PHP_PATH = '/usr/bin/php' ; public static $CLI_DOCUMENT_ROOT = "/srv/http/ZoteroDataServer/" ; ... |
Setting Up Zotero Data Server
Start MySQL daemon first:1 | $ sudo /etc/rc .d /mysqld start |
1 | $ cd /srv/http/ZoteroDataServer/misc |
1 2 3 4 5 6 7 8 | $ . /test_reset Deleting databases Creating databases Deleting users Creating users Updating user privileges Filling databases with default fields Reset is successfull. Now run . /test_setup |
1 | $ . /test_setup |
1 | $ mysql -u root -pSecurePassword |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | $ mysql> SHOW DATABASES; +--------------------+ | Database | +--------------------+ | mysql | | zotero_cache | | zotero_www | | zotero_www_test | | zoterotest1 | | zoterotest2 | | zoterotest_ids | | zoterotest_master | +--------------------+ 8 rows in set (0.01 sec) mysql> SELECT * FROM items; +--------+-----------+------------+---------------------+---------------------+----------+---------------------+---------+ | itemID | libraryID | itemTypeID | dateAdded | dateModified | key | serverDateModified | version | +--------+-----------+------------+---------------------+---------------------+----------+---------------------+---------+ | 1 | 1 | 2 | 2012-10-09 20:26:11 | 2012-10-09 20:26:11 | AAAA2222 | 2012-10-09 20:26:11 | 0 | | 2 | 2 | 2 | 2012-10-09 20:26:13 | 2012-10-09 20:26:13 | BBBB2222 | 2012-10-09 20:26:13 | 0 | | 3 | 2 | 14 | 2012-10-09 20:26:15 | 2012-10-09 20:26:15 | CCCC4444 | 2012-10-09 20:26:15 | 0 | | 4 | 3 | 2 | 2012-10-09 20:26:16 | 2012-10-09 20:26:16 | CCCC2222 | 2012-10-09 20:26:16 | 0 | | 5 | 3 | 14 | 2012-10-09 20:26:16 | 2012-10-09 20:26:16 | CCCC3333 | 2012-10-09 20:26:16 | 0 | +--------+-----------+------------+---------------------+---------------------+----------+---------------------+---------+ 5 rows in set (0.00 sec) |
In the 1st terminal:
1 2 | $ cd /srv/http/ZoteroDataServer/processor/upload/ $ php daemon.php |
1 2 | $ cd /srv/http/ZoteroDataServer/processor/download/ $ php daemon.php |
1 2 | $ cd /srv/http/ZoteroDataServer/processor/error/ $ php daemon.php |
Testing Authentication on Zotero Data Server
To test authentication on the server, post the following request:1 | $ curl -X POST -d "version=9&username=testuser&password=testuser" http: //127 .0.0.1:85 /login |
1 2 3 4 5 6 | <? xml version="1.0"?> < response version="9" timestamp="1341134959"> < sessionID > da802280ce0bfc2e90cb1ad0747ff642 </ sessionID > </ response > |
1 | $ curl -X POST -d "version=9&sessionid=da802280ce0bfc2e90cb1ad0747ff642&lastsync=1" http: //127 .0.0.1:85 /updated |
1 2 3 4 5 6 7 8 9 | <? xml version="1.0"?> < response version="9" timestamp="1341135305" userID="1" defaultLibraryID="1" updateKey="43d4eaa497ab8cbfc8f4d201d955fd70" earliest="1341131740"> < updated /> </ response > |
Installing Zotero Attachment Server
In order to be able to upload attachment files you need to provide your Zotero client with a WebDAV server. Distributed authoring and versioning (WebDAV). For example, you can use YandexDisk with WebDAV protcocol. It provides 5 GB disc space for free! Files are also accessible through its e-mail web-client. If you are paranoid enough not to trust anyone, you can set up a WebDAV server by yourself. Uncomment (or add) the following lines in "/etc/httpd/conf/httpd.conf"1 2 3 4 | LoadModule auth_digest_module modules/mod_auth_digest.so LoadModule dav_module modules/mod_dav.so LoadModule dav_fs_module modules/mod_dav_fs.so Include conf/extra/httpd-dav.conf |
1 2 3 4 | $ sudo mkdir /srv/http/DAVLock $ sudo chmod -R 777 /srv/http/DAVLock $ sudo chown -R nobody:nobody /srv/http/DAVLock $ sudo touch /srv/http/DAVLock/DAVLockDB |
1 2 3 | $ sudo mkdir /srv/http/zotero $ sudo chown -R http:http /srv/http/zotero $ sudo chmod -R 777 /srv/http/zotero |
1 2 3 4 5 6 7 8 9 10 11 12 | DavLockDB "/srv/http/DAVLock/DAVLockDB" < Directory "/srv/http/zotero"> Dav On Order Allow,Deny Allow from all AllowOverride None AuthType Digest AuthName "WebDAV" AuthUserFile "/etc/httpd/conf/extra/AuthWebDAV.passwd" AuthDigestProvider file Require user "testuser" </ Directory > |
1 2 3 4 5 | $ sudo htdigest -c /etc/httpd/conf/extra/AuthWebDAV . passwd WebDAV testuser Adding password for testuser in realm WebDAV. New password: Re- type new password: |
1 | $ sudo /etc/rc .d /httpd restart |
1 | $ sudo pacman -S cadaver |
1 2 3 4 5 6 7 | $ cadaver http: //127 .0.0.1 /zotero Authentication required for WebDAV on server `127.0.0.1': Username: testuser Password: dav: /zotero/ > mkcol SomeCollection Creating `SomeCollection': succeeded. dav: /zotero/ > |
Installing Zotero Client
Right now only Zotero Firefox extension is available. Zotero standalone will be available soon.Zotero Firefox Extension
Install Firefox extension from "/srv/http/ZoteroDataServer/zotero-3.0.8-patched.xpi". It is patched such that you can add custom data servers as shown in the figure:Testing Zotero Data Server: Synchronization Process
Now open your Firefox and click on the "sync" button with an round green arrow on it:1 2 3 4 5 6 7 8 9 10 11 12 13 14 | $ cadaver http: //127 .0.0.1 /zotero Authentication required for WebDAV on server `127.0.0.1': Username: testuser Password: dav: /zotero/ > ls Listing collection ` /zotero/ ': succeeded. 3QBQSD38.prop 117 Aug 12 13:21 3QBQSD38.zip 465149 Aug 12 13:21 5BA5I3IP.prop 117 Aug 12 13:21 5BA5I3IP.zip 809 Aug 12 13:21 8IF963XB.prop 117 Aug 12 13:21 8IF963XB.zip 860702 Aug 12 13:21 lastsync 1 Aug 12 13:21 dav: /zotero/ > |