added repository for elastic search and install elastic serach package
added wheezy backports repository added script file to change password of user fixed problems regarding special characters (UTF-8)master
parent
349eb346ee
commit
a9f8c009d8
|
@ -0,0 +1,38 @@
|
|||
#!/usr/bin/php
|
||||
<?
|
||||
set_include_path("../include");
|
||||
require("header.inc.php");
|
||||
|
||||
if (empty($argv[1])) {
|
||||
die("Usage: $argv[0] " . '$username $password' . "\n");
|
||||
}
|
||||
|
||||
$username = $argv[1];
|
||||
$password = $argv[2];
|
||||
|
||||
|
||||
$docRoot = str_replace($_SERVER['SCRIPT_NAME'], '', __FILE__);
|
||||
|
||||
echo $docRoot;
|
||||
|
||||
|
||||
echo "changing password for user $username\n";
|
||||
|
||||
$passwordhash = password_hash($password, PASSWORD_DEFAULT);
|
||||
|
||||
|
||||
Zotero_DB::beginTransaction();
|
||||
|
||||
$sql = "SET NAMES UTF8;";
|
||||
Zotero_DB::query($sql);
|
||||
|
||||
$sql = "UPDATE zotero_www.users SET password=? WHERE username=?";
|
||||
Zotero_DB::query($sql, array($passwordhash,$username));
|
||||
|
||||
Zotero_DB::commit();
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
|
@ -12,8 +12,12 @@ echo "######################################################"
|
|||
|
||||
echo "install required packages"
|
||||
|
||||
echo "add debian wheezy repository"
|
||||
echo "add key for elasticsearch repository"
|
||||
wget -qO - http://packages.elasticsearch.org/GPG-KEY-elasticsearch | apt-key add -
|
||||
|
||||
echo "add debian wheezy backports repository"
|
||||
sed -i '$s,$,\ndeb http://ftp.acc.umu.se./debian wheezy-backports main,' /etc/apt/sources.list
|
||||
sed -i '$s,$,\nhttp://packages.elasticsearch.org/elasticsearch/1.3/debian stable main,' /etc/apt/sources.list
|
||||
|
||||
echo "update package cache"
|
||||
apt-get update
|
||||
|
@ -23,7 +27,7 @@ apt-get install -y apache2 libapache2-mod-php5 mysql-server memcached zendframew
|
|||
apt-get -t wheezy-backports install -y php-aws-sdk php-doctrine-cache
|
||||
|
||||
echo "general dependencies"
|
||||
apt-get install -y git gnutls-bin runit libapache2-modsecurity curl
|
||||
apt-get install -y git gnutls-bin runit libapache2-modsecurity curl elasticsearch openjdk-7-jre
|
||||
|
||||
echo "created required directories"
|
||||
mkdir -p /srv/zotero/dataserver
|
||||
|
@ -36,6 +40,12 @@ mkdir -p /srv/zotero/log/error
|
|||
# save current directory
|
||||
cur_dir=$(pwd)
|
||||
|
||||
echo "setting elasticsearch to be started during booting"
|
||||
update-rc.d elasticsearch defaults 95 10
|
||||
|
||||
echo "starting elasticsearch"
|
||||
/etc/init.d/elasticsearch start
|
||||
|
||||
echo "download source code of dataserver"
|
||||
git clone git://github.com/zotero/dataserver.git /srv/zotero/dataserver
|
||||
|
||||
|
@ -47,6 +57,9 @@ git checkout fc607170ab2ca751097648d48a5d38e15e9d5f6a
|
|||
echo "install add_user script"
|
||||
cp add_user /srv/zotero/dataserver/admin
|
||||
|
||||
echo "install change_password script"
|
||||
cp change_password /srv/zotero/dataserver/admin
|
||||
|
||||
echo "patch master.sql"
|
||||
cp master.sql /srv/zotero/dataserver/misc
|
||||
|
||||
|
|
Loading…
Reference in New Issue