Jump to content
Forumu Destekleyenlere Katılın ×
Paticik Forumları
2000 lerden beri faal olan, çok şukela bir paylaşım platformuyuz. Hoşgeldiniz.

Online Calibre Arşivi Rehberi


GERGE

Öne çıkan mesajlar

  • Genel Yönetici
Yeni rehber ile merhaba =)

Bu sefer Calibre arsivimizi online yapiyoruz, her yerde kitaplara erisebiliyoruz. Ubuntu 14.04.1 kullandim ben. Ilk once bir VPS edinip SSH ile baglanmaniz lazim, orasi size kalmis. Sonra kurulum asamasi geliyor:

Ilk once sunu girin terminal'de:

sudo -v && wget -nv -O- raw.githubusercontent.com/kovidgoyal/calibre/master/setup/linux-installer.py | sudo python -c "import sys; main=lambda:sys.stderr.write('Download failedn'); exec(sys.stdin.read()); main()"

Tek satir bu. Calibre'yi yukleyecek. Evet diyin sordugu her seye. Ardindan su dosyayi acin ve yoksa su iki satiri ekleyin: /etc/environment

LC_ALL=en_US.UTF-8
LANG=en_US.UTF-8

Simdi gerekli bagimliliklari yukleyelim:

sudo apt-get install xdg-utils imagemagick python-imaging python-mechanize python-lxml python-dateutil python-cssutils python-beautifulsoup python-dnspython python-poppler libpodofo-utils libwmf-bin python-chm

Son olarak headless olarak calistirmak icin gerekli seyleri yapalim, iki dosya yaratilacak, biri editlenecek.

Once yaratip birakacaginiz dosya: /etc/init.d/calibre-server

#! /bin/sh

# Copyright (C) 2011- by Mar2zz
# released under GPL, version 2 or later

################################################
# #
# TO CONFIGURE EDIT /etc/default/calibre-server #
# #
################################################

### BEGIN INIT INFO
# Provides: Calibre server instance
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts instance of Calibre server
# Description: starts instance of Calibre server using start-stop-daemon
### END INIT INFO

# main variables
DAEMON=/opt/calibre/calibre-server
SETTINGS=/etc/default/calibre-server

SETTINGS_LOADED=FALSE

DESC='Calibre Server'

# only accept values from /etc/default/calibre-server
unset RUN_AS LIBRARY PORT PID_FILE

. /lib/lsb/init-functions

[ -x $DAEMON ] || {
log_warning_msg "$DESC: Can't execute daemon, aborting. See $DAEMON";
return 1; }

[ -r $SETTINGS ] || {
log_warning_msg "$DESC: Can't read settings, aborting. See $SETTINGS";
return 1; }

check_retval() {
if [ $? -eq 0 ]; then
log_end_msg 0
return 0
else
log_end_msg 1
exit 1
fi
}

load_settings() {
if [ $SETTINGS_LOADED != TRUE ]; then
. $SETTINGS

[ -n $APP_PATH ] || {
log_warning_msg "$DESC: path to $DESC not set, aborting. See $SETTINGS";
return 1; }

[ $ENABLE_DAEMON = 1 ] || {
log_warning_msg "$DESC: daemon not enabled, aborting. See $SETTINGS";
return 1; }

[ -n $RUN_AS ] || {
log_warning_msg "$DESC: daemon username not set, aborting. See $SETTINGS";
return 1; }
[ -z ${RUN_AS%:*} ] && exit 1

DAEMON_OPTS="--daemonize"
[ -n $LIBRARY ] && DAEMON_OPTS="$DAEMON_OPTS --with-library=$LIBRARY"
[ -n $PORT ] && DAEMON_OPTS="$DAEMON_OPTS --port=$PORT"
[ -n $USERNAME ] && DAEMON_OPTS="$DAEMON_OPTS --username=$USERNAME"
[ -n $PASSWORD ] && DAEMON_OPTS="$DAEMON_OPTS --password=$PASSWORD"
[ -n $COVERSIZE ] && DAEMON_OPTS="$DAEMON_OPTS --max-cover=$MAX_COVER"
[ -n $EXTRA_OPTS ] && DAEMON_OPTS="DAEMON_OPTS $EXTRA_OPTS"
[ -n $PID_FILE ] || PID_FILE=/var/run/calibre/calibre-server.pid
DAEMON_OPTS="$DAEMON_OPTS --pidfile=$PID_FILE"
[ $ENABLE_DEVELOPMENT = 1 ] && DAEMON_OPTS="$DAEMON_OPTS --develop"
SETTINGS_LOADED=TRUE
fi
return 0
}

load_settings || exit 0

is_running () {
# returns 1 when running, else 0.
PID=$(pgrep -f "$APP_PATH/bin/calibre-server $DAEMON_OPTS")
RET=$?
[ $RET -gt 1 ] && exit 1 || return $RET
}

handle_pid () {
PID_PATH=`dirname $PID_FILE`
[ -d $PID_PATH ] || mkdir -p $PID_PATH && chown -R $RUN_AS $PID_PATH > /dev/null || {
log_warning_msg "$DESC: Could not create $PID_FILE, aborting.";
return 1;}
}

start_calibre () {
if ! is_running; then
log_daemon_msg "Starting $DESC"
[ $WEB_UPDATE = 1 ] && enable_updates
handle_pid
start-stop-daemon -o -c $RUN_AS --start --pidfile $PID_FILE --exec $DAEMON -- $DAEMON_OPTS
check_retval
else
log_success_msg "$DESC: already running (pid $PID)"
fi
}

stop_calibre () {
if is_running; then
log_daemon_msg "Stopping $DESC"
start-stop-daemon -o --stop --pidfile $PID_FILE --retry 15
check_retval
else
log_success_msg "$DESC: not running"
fi
}

case "$1" in
start)
start_calibre
;;
stop)
stop_calibre
;;
restart|force-reload)
stop_calibre
start_calibre
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart|force-reload}" >&2
exit 1
;;
esac

exit 0



Ardindan degistrimeniz gereken dosya, dosyayi okuyun bir, degistirmeniz gereken yerleri anlarsiniz: /etc/default/calibre-server

# This file is sourced by /etc/init.d/calibre-server
#
# When calibre server is started using the init script
# is started under the account of $USER, as set below.
#
# Each setting is marked either "required" or "optional";
# leaving any required setting unconfigured will cause
# the service to not start.

# [required] set path where calibre is installed:
APP_PATH=/opt/calibre

# [optional] change to 1 to enable daemon
ENABLE_DAEMON=1

# [required] user or uid of account to run the program as:
RUN_AS=kullanici adiniz

# [optional] full path to the libraryfolder of your choice;
# otherwise, the default location set by calibre itself is used:
LIBRARY=Calibre kutuphanesinin yeri

# [optional] port number to listen on, defaults to port 8080:
PORT=

# [optional] Username for access. By default, it is: 'calibre'
USERNAME=calibre kullanici adi

# [optional] Set a password to restrict access. By default access
is unrestricted.
PASSWORD=calibre kullanicisi sifresi

# [optional] full path for the pidfile
# otherwise, the default location /var/run/calibre/calibre-server.pid is used:
PID_FILE=

# [optional] The maximum size for displayed covers. Default is ‘600x800’.
MAX_COVER=

# Development mode. Server automatically restarts on file changes and
# serves code files (html, css, js) from the file system instead of
# calibre's resource system. (change to 1 to enable development mode)
DEVELOPMENT=0

# [optional] Extra options you want to set. See calibreserver --help for more info.
# This needs to be wrapped in quotes "" properly.
EXTRA_OPTS=""



Bundan su iki komutu girin:

sudo chmod +x /etc/init.d/calibre-server
sudo update-rc.d calibre-server defaults

Acilista kendi kendine baslayacak, siz de su iki komut ile baslatabilirsiniz:

sudo /etc/init.d/calibre-server start
sudo /etc/init.d/calibre-server stop

Simdi VPS'de Calibre'yi kurduk ve actik. Kendi makinemizden yonetmek icin ve VPS ile yerel kutupanenin ayni olmasi icin Bittorrent Sync kullanacagiz. Su komutlari girin:

sudo add-apt-repository ppa:tuxpoldo/btsync
sudo apt-get update
sudo apt-get install btsync

Bittorrent Sync yuklendi. Yuklerken sordugu sorulari evet diyerek gecebilirsiniz. Sonra sunucunuza su adres ile baglanin:

1.1.1.1:8888/gui/

Eger sorun olursa su komut ile tekrar yukleme ayarlarini calistirin:

sudo dpkg-reconfigure btsync

Sonra Bittorrent Sync'i makinenize de yukleyin, Calibre kutuphanenizi ekleyin BTSync'a, link'ini kopyalayin, VPS'ye de ekleyin.

En sonunda gordugunuz bu olacak:

http://cl.ly/image/0t3Q3o402H3Z/Screen%20Shot%202014-09-20%20at%2010.10.42.png

Arada sirada Calibre Library yenilenmeye bilir, bir reset atin VPS'ye ya da bekleyin, olur.
Link to comment
Sosyal ağlarda paylaş

×
×
  • Yeni Oluştur...