View Single Post
Old 03-03-2014, 11:57 AM   #1
DouglasK
Member
DouglasK knows the square root of minus one.DouglasK knows the square root of minus one.DouglasK knows the square root of minus one.DouglasK knows the square root of minus one.DouglasK knows the square root of minus one.DouglasK knows the square root of minus one.DouglasK knows the square root of minus one.DouglasK knows the square root of minus one.DouglasK knows the square root of minus one.DouglasK knows the square root of minus one.DouglasK knows the square root of minus one.
 
DouglasK's Avatar
 
Posts: 24
Karma: 7938
Join Date: Oct 2010
Location: Ottawa, Ontario, Canada
Device: Onyx Note Air3, Kobo Aura HD, Nexus 7 (2013)
Question Calibre In Process Server help

I'm seeing a 500 error from Apache trying to load it. I've had the in process server running before without issue (on Ubuntu Linux), but have recently had to rebuild the server due to a h/w failure. Version of Ubuntu is now 13.10, This updated the Apache server from 2.2 to 2.4, not sure if that's relevant.

Any help is appreciated.

In short, Calibre is saying it can't find calibre-wsgi-adapter.py. Here's (what I hope are) the relevant logs and configs:

Here's the error from the Apache logs:
Code:
[Mon Mar 03 10:45:27.971954 2014] [:error] [pid 6767] [client xx.xx.204.206:52282] mod_wsgi (pid=6767): Target WSGI script '/var/www/cgi-bin/calibre-wsgi-adapter.py' cannot be loaded as Python module.
[Mon Mar 03 10:45:27.971987 2014] [:error] [pid 6767] [client xx.xx.204.206:52282] mod_wsgi (pid=6767): Exception occurred processing WSGI script '/var/www/cgi-bin/calibre-wsgi-adapter.py'.
[Mon Mar 03 10:45:27.972012 2014] [:error] [pid 6767] [client xx.xx.204.206:52282] Traceback (most recent call last):
[Mon Mar 03 10:45:27.972058 2014] [:error] [pid 6767] [client xx.xx.204.206:52282]   File "/var/www/cgi-bin/calibre-wsgi-adapter.py", line 31, in <module>
[Mon Mar 03 10:45:27.972119 2014] [:error] [pid 6767] [client xx.xx.204.206:52282]     from calibre.library.server.main import create_wsgi_app
[Mon Mar 03 10:45:27.972142 2014] [:error] [pid 6767] [client xx.xx.204.206:52282] ImportError: No module named calibre.library.server.main
Here's the output of calibre-debug --paths:
Code:
$ calibre-debug --paths
CALIBRE_RESOURCES_PATH=/opt/calibre/resources
CALIBRE_EXTENSIONS_PATH=/opt/calibre/lib/python2.7/site-packages/calibre/plugins
CALIBRE_PYTHON_PATH=/opt/calibre/lib/python2.7:/opt/calibre/lib/python2.7/plat-linux2:/opt/calibre/lib/python2.7/lib-dynload:/opt/calibre/lib/python2.7/site-packages
Here's the content of calibre-wsgi-adapter.py:
Code:
# WSGI script file to run calibre content server as a WSGI app

import sys, os


# You can get the paths referenced here by running
# calibre-debug --paths
# on your server

# The first entry from CALIBRE_PYTHON_PATH
sys.path.insert(0, '/opt/calibre/lib/python2.7')

# CALIBRE_RESOURCES_PATH
sys.resources_location = '/opt/calibre/resources'

# CALIBRE_EXTENSIONS_PATH
sys.extensions_location = '/opt/calibre/lib/python2.7/site-packages/calibre/plugins'

# Path to directory containing calibre executables
sys.executables_location = '/opt/calibre'

# Path to a directory for which the server has read/write permissions
# calibre config will be stored here
os.environ['CALIBRE_CONFIG_DIRECTORY'] = '/var/www/books/calibre-config'

del sys
del os

from calibre.library.server.main import create_wsgi_app
application = create_wsgi_app(
        # The mount point of this WSGI application (i.e. the first argument to
        # the WSGIScriptAlias directive). Set to empty string is mounted at /
        prefix='/calibre',

        # Path to the calibre library to be served
        # The server process must have write permission for all files/dirs
        # in this directory or BAD things will happen
        path_to_library='/home/douglask/CalibreWeb',

        # The virtual library (restriction) to be used when serving this
        # library.
        virtual_library=None
)

del create_wsgi_app
DouglasK is offline   Reply With Quote