× Warning! This forum is in archival status. New contributions may not work.
Problems installing Booktype1.6.1 on Debian 7 and Ubuntu 14.04
  • As suggested by Aleksandar here: https://forum.sourcefabric.org/discussion/comment/31569#Comment_31569 I have decided to go for a 1.6.1 installation for a live site.

    I followed the install guide Alexandar pointed to http://sourcefabric.booktype.pro/booktype-16-for-authors-and-publishers/_draft/_v/1.0/before-you-install/
    both on Debian 7 and Ubuntu 14.04

    When I came to this part after installing Django:

    Then install the libraries:

    sudo pip install -r requirements/postgresql.txt
    I got the following error:
    root@debian:~# sudo pip install -r requirements/postgresql.txt
    Could not open requirements file: [Errno 2] No such file or directory: 'requirements/postgresql.txt'
    Storing complete log in /root/.pip/pip.log
    root@debian:~#

    As I am in Debian I also tried without using sudo

    root@debian:~# pip install -r requirements/postgresql.txt
    Could not open requirements file: [Errno 2] No such file or directory: 'requirements/postgresql.txt'
    Storing complete log in /root/.pip/pip.log
    root@debian:~#

    I have also tried the exact same thing in Ubuntu 14.04, and got the same error at the same place. 

    Any idea how I can fix this step?
    Post edited by Graabein at 2015-01-10 12:45:59
  • 20 Comments sorted by
  • Ok, it is very confusing with two different installation guides that say different things about the installprocedure:

    This one suggested by Alexandar:
    http://sourcefabric.booktype.pro/booktype-16-for-authors-and-publishers/_draft/_v/1.0/installation-on-gnulinux/
    and this one pointed to by the Sourcefabric website itself: https://wiki.sourcefabric.org/display/Booktype/How+to+install+it+on+Ubuntu

    The installguides is not updated, some solutions are indicated in some of the comments in the wiki, but not actually updated in the wikiarticle itself.  And it looks like the code has changed, so the instructions in the installguide does not correspond with the directory structure in the files themselves.  So installing this one is not easy.

    After a lot of trial and error I managed to get past the opening post mentioned problem related to this command from one of the installguides:

    sudo pip install -r requirements/postgresql.txt (it should be prod.txt and not postgresql.txt)


    Anyway, I managed to figure it out, but soon I ran into other problems.  So below I describe all the steps I have taken

    I started with this guide https://wiki.sourcefabric.org/display/Booktype/How+to+install+it+on+Ubuntu#HowtoinstallitonUbuntu-BooktypewithPostgreSQL


    INSTRUCTIONS 1: https://wiki.sourcefabric.org/display/Booktype/How+to+install+it+on+Ubuntu#HowtoinstallitonUbuntu-BooktypewithPostgreSQL

    # Install needed packages
    sudo apt-get install python python-dev git-core python-pip python-virtualenv
    sudo apt-get install libjpeg-dev zlib1g-dev redis-server libxml2-dev libxslt-dev
    sudo apt-get install postgresql postgresql-server-dev-9.1


    WHAT I DID:

    sudo apt-get install python python-dev git-core python-pip python-virtualenv
    sudo apt-get install libjpeg-dev zlib1g-dev redis-server libxml2-dev libxslt-dev
    sudo apt-get install postgresql postgresql-server-dev-9.1 (this did not work, so I had to seach for other solutions)


    I THEN:

    Followed this guide for my distribution 14.04 Trusty: http://www.postgresql.org/download/linux/ubuntu/

    sudo nano /etc/apt/sources.list.d/pgdg.list

    Input this code:
    deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main

    Closed out with CTRL+o, hit ENTER, then CTRL+x to close nano


    Import the repository signing key, and update the package lists:

    wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -

    sudo apt-get update

    sudo apt-get upgrade

    sudo add-apt-repository ppa:pitti/postgresql

     ATTENTION: The functionality of this has been moved to http://apt.postgresql.org, this PPA is deprecated. apt.postgresql.org has a lot more packages, and also better QA. This PPA will still be kept for Ubuntu 10.04's life time, but will NOT receive ANY UPDATES any more. More info: https://launchpad.net/~pitti/+archive/ubuntu/postgresql
    Press [ENTER] to continue or ctrl-c to cancel adding it

    gpg: keyring `/tmp/tmpuazylgch/secring.gpg' created
    gpg: keyring `/tmp/tmpuazylgch/pubring.gpg' created
    gpg: requesting key 8683D8A2 from hkp server keyserver.ubuntu.com
    gpg: /tmp/tmpuazylgch/trustdb.gpg: trustdb created
    gpg: key 8683D8A2: public key "Launchpad PPA for Martin Pitt" imported
    gpg: Total number processed: 1
    gpg:               imported: 1  (RSA: 1)
    OK

    sudo apt-get update

    sudo apt-get install postgresql postgresql-server-dev-9.4


    After this I continued to follow guide at https://wiki.sourcefabric.org/display/Booktype/How+to+install+it+on+Ubuntu#HowtoinstallitonUbuntu-BooktypewithPostgreSQL


    INSTRUCTIONS 2:

    # Create Python Virtual Environment
    virtualenv --distribute mybooktype
    cd mybooktype
    source bin/activate


    WHAT I DID:


    graabein@booktypeU64:~$ virtualenv --distribute mybooktype
    New python executable in mybooktype/bin/python
    Installing setuptools, pip...done.
    graabein@booktypeU64:~$ cd mybooktype
    graabein@booktypeU64:~/mybooktype$ source bin/activate
    (mybooktype)graabein@booktypeU64:~/mybooktype$


    If I understand this, I am now in some Phyton virtual environment called "mybooktype"?


    INSTRUCTIONS 3:

    # Fetch Booktype source
    git clone https://github.com/sourcefabric/Booktype.git


    WHAT I DID:


    (mybooktype)graabein@booktypeU64:~/mybooktype$ git clone https://github.com/sourcefabric/Booktype.git


    INSTRUCTIONS 4:

    # Install needed Python modules
    pip install -r Booktype/requirements/postgresql.txt


    WHAT I DID:

    (mybooktype)graabein@booktypeU64:~/mybooktype$ pip install -r Booktype/requirements/prod.txt


    INSTRUCIONS 5:

    # Create Booktype project
    ./Booktype/scripts/createbooki --database postgresql mybook  (#### This did not work ####)


    WHAT I DID:

    (mybooktype)graabein@booktypeU64:~/mybooktype$ ./Booktype/scripts/createbooktype --database postgresql mybook

    This last command fulfills with displaying some directory structure:

    Check [/home/graabein/mybooktype/mybook] directory for created files:
       booktype.env        -  Environment variables
       manage.py           -  Manage file

       conf/                 -  Configuration files
         wsgi.apache         -  Apache config file
         gunicorn.nginx      -  Nginx config file
         fastcgi.nginx       -  Nginx config file

       lib/                  -  Local python libraries
       static/               -  Deployed static files
       data/                 -  Attachments, Covers, ...

       mybook_site            -  Booktype project
         locale/             -  Local translations
         templates/          -  Local templates
         static/             -  Local static files
         wsgi.py             -  WSGI file for Apache

         settings/           -  Settings configurations
           base.py           -  Base configuration
           dev.py            -  Development configuration
           prod.py           -  Production configuration

         urls/               -  URL routers
           dev.py            -  For Development profile
           prod.py           -  For Production profile

    For further instructions read INSTALL file.


    INSTRUCTIONS 6:

    # Create PostgreSQL user and enter password
    sudo -u postgres createuser -SDRP booktype

    WHAT I DID:

    (mybooktype)graabein@booktypeU64:~/mybooktype$ sudo -u postgres createuser -SDRP booktype

    Then was asked to creat password, which I did.


    INSTRUCTION 7:

    # Create PostgreSQL database
    sudo -u postgres createdb -E utf8 -O booktype booktype

    WHAT I DID:

    (mybooktype)graabein@booktypeU64:~/mybooktype$ sudo -u postgres createdb -E utf8 -O booktype booktype



    ########### NOW COMES PROBLEMS ##########################

    The guide at https://wiki.sourcefabric.org/display/Booktype/How+to+install+it+on+Ubuntu#HowtoinstallitonUbuntu-BooktypewithPostgreSQL

    tells me to do this:

    You will need to enter database info in the settings file. Edit mybooktype/mybook/settings.py file and put this as database info (you will need to enter username password also).

    DATABASES = {
        'default': {
            'ENGINE': 'django.db.backends.postgresql_psycopg2',
            'NAME': 'booktype',                     
            'USER': 'booktype',
            'PASSWORD': 'ENTER PASSWORD HERE',
            'HOST': 'localhost',
            'PORT': ''
        }
    }


    WHAT I DID:

    (mybooktype)graabein@booktypeU64:~/mybooktype$ nano mybooktype/mybook/settings.py

    It looked empty, so I put in the above DATABASE code bracket content, input the password, then tried to save settings.py and got the following error message:

    [ Error writing mybooktype/mybook/settings.py: No such file or directory ]


    PROBLEM SOLVING STEP 1:

    I then looked at the files and folderstructure, and saw that the given path is not correct

    Instead i tried:

    (mybooktype)graabein@booktypeU64:~/mybooktype$ nano mybooktype/mybook/mybook_site/settings/prod.py

    I pasted in the above mention DATABASE code bracket content, input the password, then tried to save prod.py and got the following error message:

    [ Error writing mybooktype/mybook/mybook_site/settings/prod.py: No such file or directory ]


    PROBLEM SOLVING STEP 2:

    I logged into my VirtualBox maching using another instance of Putty, so I got out of the virtual environment commandpromt:

    so instead of (mybooktype)graabein@booktypeU64:~/mybooktype$

    i was back at: graabein@booktypeU64:~$

    I then did:

    graabein@booktypeU64:~$ nano mybooktype/mybook/mybook_site/settings/prod.py

    NOW THE FILE SUDDENLY HAD CONTENT, a lot of different content, and I edited the databaseinformation in the middle of the file putting in my password, then saved the file ctrl+o, hit ENTER, then ctrl+x


    PROBLEM SOLVING STEP 3:

    Now I went back to the first putty.exe instance command promt, where I was back in the "mybooktype" virtual environment:

    (mybooktype)graabein@booktypeU64:~/mybooktype$


    INSTRUCTION 8:

    Allow connections to database booktype for user booktype. This can depend of your requirements. Edit /etc/postgresql/9.1/main/pg_hba.conf (full file name depends of PostgreSQL version) file and put this inside.
    local   booktype    booktype                      md5

    Restart PostgreSQL server after this.
    sudo service postgresql restart


    WHAT I DID:

    (mybooktype)graabein@booktypeU64:~/mybooktype$ sudo nano /etc/postgresql/9.4/main/pg_hba.conf

    input the code

    local   booktype    booktype                      md5

    then saved and closed.

    To make sure, I reapeated the process using postgresql 9.3

    (mybooktype)graabein@booktypeU64:~/mybooktype$ sudo nano /etc/postgresql/9.3/main/pg_hba.conf

    input the code

    local   booktype    booktype                      md5

    then saved and closed.


    then finally:

    sudo service postgresql restart


    INSTRUCTIONS STEP 9:

    You can continue now with initialisation.
    source mybook/booki.env (it should be booktype.env)
    django-admin.py syncdb --noinput
    django-admin.py migrate
    django-admin.py createsuperuser

    WHAT I DID:

    (mybooktype)graabein@booktypeU64:~/mybooktype$ source mybook/booktype.env

    (mybooktype)graabein@booktypeU64:~/mybooktype$ django-admin.py syncdb --noinput
    Syncing...

    ImproperlyConfigured: settings.DATABASES is improperly configured. Please supply the NAME value.

    SO HERE I AM, STUCK at this ImproperlyConfigured: error message.

    Anyone willing to help me further?



     
    Post edited by Graabein at 2015-01-09 12:56:32
  • Hmm, looks like install instructions are a mess.

    Instructions are probably ment for
    http://downloads.sourceforge.net/project/booktype/Booktype-1.6.1/Booktype-1.6.1.tar.gz

    while the instructions still tell you to download the sources using git

    sudo git clone https://github.com/sourcefabric/Booktype.git


    Which probably means you are following 1.6.1 instructions on Booktype 2.0 sources, that will not go well.

    Am I understanding this correctly?
    Post edited by Graabein at 2015-01-09 16:58:30
  • I tried installing http://downloads.sourceforge.net/project/booktype/Booktype-1.6.1/Booktype-1.6.1.tar.gz in Ubuntu 14.04.  Installation process stopped because installscript could not find PIL

      Could not find any downloads that satisfy the requirement PIL (from -r requirements/_base.txt (line 5))
      Some externally hosted files were ignored (use --allow-external PIL to allow).
    Cleaning up...
    No distributions at all found for PIL (from -r requirements/_base.txt (line 5))
    Storing debug log for failure in /home/graabein/.pip/pip.log

    -----------------------------------------------------------------------------------------

    I tried installing http://downloads.sourceforge.net/project/booktype/Booktype-1.6.1/Booktype-1.6.1.tar.gz in Debian 7, which stopped because it complained about needing postgresql-server-dev, which I tried to install but it would not let me install all dependencies.

    I am frustrated.
    Post edited by Graabein at 2015-01-09 17:52:31
  • Could someone PLEASE help me?
  • Hi,

    Seeing as it's late on Friday night, I don't know if the Booktype team will
    see this over the weekend. But I'll make sure they get to it the first
    thing Monday.

    Best regards,

    douglas




    On Fri, Jan 9, 2015 at 11:28 PM, Graabein <<br />booktype-support@lists.sourcefabric.org> wrote:

    > Could someone PLEASE help me?
    >
    >
    Douglas Arellanes
    Director of Innovation
    Sourcefabric, o.p.s.

    Find a way or make one.
  • Ohh, sorry douglas, I completely forgot it was Friday. :-)
  • Found one solution step for Ubuntu 14.04

    Did this:

    sudo pip install PIL --allow-external PIL --allow-unverified PIL

    Then did

    sudo apt-get install libpq-dev

    Then did this

    sudo pip install -r requirements/postgresql.txt

    So far so good...moving on
    Post edited by Graabein at 2015-01-09 18:05:31
  • Vote Up0Vote Down Daniel JamesDaniel James
    Posts: 844Member, Sourcefabric Team
    Hi, sorry you've had so much trouble installing! It looks like your initial git clone downloaded the 2.0 branch, probably because the default git branch has changed since the manual for 1.6.1 was written. That would explain the discrepancies in requirements and other filenames that you have seen.

    Version 1.6.1 and the git master branch should be the same. You would clone this version with:
    sudo git clone -b master --single-branch https://github.com/sourcefabric/Booktype.git
    I've updated the manual to reflect this change, thanks for alerting me to the issue.

    Please ignore the instructions in the wiki, they are out of date. Our website was relaunched recently, and for some reason the Booktype download page https://www.sourcefabric.org/en/booktype/download/ now points to these old pages. I'll get that fixed.

    Let me know if you need more help :-)

    Cheers!

    Daniel


  • Thank you Daniel

    I figured it out myself after some long troubletime :-)

    I finally managed to make a working installation though, Booktype 1.6.1 on Debian 7.

    I am now setting up a live testdroplet at DigitalOcean (Debian 7) and will try installing it there too.  Some more work as I have to set all up, including mailserver bla bla.

    What I want to do is set up a main website which will be Joomla (installed in root directory), and then install Booktype as a subdomain of the rootdomain, or as an installation in a subdirectory to the rootdomain.

    I have tried installing Booktype in a Apache virtualhost setting /var/www/virtualhostaccounthere (enabled virtual host settings in Apache), but that did not work, at least I did not manage to make it work.

    The working testinstallation I have now is installed in a /home/userdir, well it is working, but I have heard it is not safe to have any such installations in the /home area, so I would prefer to get the virtualhostsetting working.

    What do you guys recommend?  How would you set it up on a dedicated webserver if you should have Joomla or some other CMS as the main landingpage for the rootdomain, and Booktype as a subdomain or subdirectory installation? (BTW I need no help installing Joomla, I have done that a lot of times, and managed many such installations)
    Post edited by Graabein at 2015-01-11 07:46:25
  • I am puzzled.  I have 1.6.1 running in a VirtualBoxed machine on my local network

    Then I installed it on my DigitalOcean Debian droplet.  It works fine in the python virtual environment, but as soon as I try to run it in Apache Configuration, then I get the following errors:

    [Mon Jan 12 07:55:31 2015] [error] [client 78.26.8.27] mod_wsgi (pid=32026): Target WSGI script '/home/graabein/mybooktype/mybook/booki.wsgi' cannot be loaded as Python module.
    [Mon Jan 12 07:55:31 2015] [error] [client 78.26.8.27] mod_wsgi (pid=32026): Exception occurred processing WSGI script '/home/graabein/mybooktype/mybook/book/booki.wsgi'.
    [Mon Jan 12 07:55:31 2015] [error] [client 78.26.8.27] Traceback (most recent call last):
    [Mon Jan 12 07:55:31 2015] [error] [client 78.26.8.27]   File "/home/graabein/mybooktype/mybook/booki.wsgi", line 15, in <module>
    [Mon Jan 12 07:55:31 2015] [error] [client 78.26.8.27]     import django.core.handlers.wsgi
    [Mon Jan 12 07:55:31 2015] [error] [client 78.26.8.27] ImportError: No module named django.core.handlers.wsgi

    Anyone have any idea what might be the problem, and how to solve it?
  • At least I have narrowed down what might be the problem. In many installations (with errors) I had made sure I had changed all needed settings as per the documentation.  Some of these settings.py settings is triggering these errors, and I don't know whitch of them.

    I reinstalled now by ONLY editing the part of settings.py file that is about filling in the database username and password.

    DATABASES = {
    &nbsp;&nbsp;&nbsp;&nbsp;'default': {
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'ENGINE': 'django.db.backends.postgresql_psycopg2',
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'NAME': 'booktype',&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'USER': 'booktype',
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'PASSWORD': 'ENTER PASSWORD HERE',
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'HOST': 'localhost',
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'PORT': ''
    &nbsp;&nbsp;&nbsp;&nbsp;}
    }

    This time the installation went well.

    So, what is the procedure for changing the settings.py, one setting at at time, until I find where the error is?

    The documentation says nothing about how to change configurations in settings.py and what procedure to do to make the changes work.

    I ask, so I dont have to create a totally new installation for each time I change a setting, it must be an easyer way?
  • I found a solution her: https://forum.sourcefabric.org/discussion/16108/new-be-issue-cant-install-booktype-/p1

    QUOTE:
    I helped Nicolaas but I am posting here info for other to see.

    I think he used script https://github.com/aerkalov/booktype-scrolls/blob/master/scripts/install/booktype_install.py
    to install Booktype. It created virtualenv and installed all needed
    packages but did not modify wsgi script to activate the virtualenv.

    File booki.wsgi had to activate virtualenv and everything worked after that.

    activate_this = '__PATH_TO_VIRTUALENV_/bin/activate_this.py'
    execfile(activate_this, dict(__file__=activate_this))

    Aco
    END QUOTE

    I am installing 1.6.1, and in the manual it says "This will not be needed in version 1.5.4 and more"
  • Finally I got this installed on a live Debian server.  Here are the steps taken:

    INSTALL ON DEBIAN WHEEZY: 1.6.1 Booktype with PostgreSQL (Log in as root)

    # Install needed packages as root
    apt-get install python python-dev sqlite3 git-core python-pip python-virtualenv
    apt-get install redis-server libxml2-dev libxslt-dev postgresql
    apt-get install libpq-dev

    (libpq-dev instead of postgres-server-dev)

    # Navigate to root install dir
    cd /var/www


    # Create Python Virtual Environment
    virtualenv --distribute mybooktype
    cd mybooktype
    source bin/activate


    # Fetch Booktype source
    git clone -b master --single-branch https://github.com/sourcefabric/Booktype.git

    # Install needed Python modules
    pip install -r Booktype/requirements/postgresql.txt
     
    # Create Booktype project
    ./Booktype/scripts/createbooki --database postgresql mybook
     
    # Become PostgreSQL user
    su - postgres
     
    # Create PostgreSQL user and enter password
    createuser -SDRP booktype
     
    # Create PostgreSQL database
    createdb -E utf8 -O booktype booktype
     
    # Exit from being PostgreSQL user
    exit


    Allow connections to database booktype for user booktype. This can depend of your requirements. Edit nano /etc/postgresql/9.1/main/pg_hba.conf (full file

    name depends of PostgreSQL version) file and put this inside:

    local   booktype    booktype                      md5


    service postgresql restart


    You will need to enter database info in the settings file. Edit mybooktype/mybook/settings.py file and put this as database info (you will need to enter

    username password also).
    DATABASES = {
        'default': {
            'ENGINE': 'django.db.backends.postgresql_psycopg2',
            'NAME': 'booktype',                     
            'USER': 'booktype',
            'PASSWORD': 'ENTER PASSWORD HERE',
            'HOST': 'localhost',
            'PORT': ''
        }
    }


    You can continue now with initialisation.
    source mybook/booki.env
    django-admin.py syncdb --noinput
    django-admin.py migrate
    django-admin.py createsuperuser

    #QUIT the python virtual environment
    exit


    Deploy using Apache (recommended)
    # Install needed packages
    apt-get install apache2-mpm-prefork libapache2-mod-wsgi

    You need to modify mybook/booki.wsgi file. This will not be needed in version 1.5.4 and more. Be careful and add full path to the mybooktype/bin/activate_this.py file. Add this two lines, after the sys.path.insert line:

    activate_this = 'FULL_PATH_TO/mybooktype/bin/activate_this.py'
    execfile(activate_this, dict(__file__=activate_this))


    # Copy configuration file
    cp mybooktype/mybook/wsgi.apache /etc/apache2/sites-available/booktype
     
    # User www-data should be the owner
    chown -R www-data:www-data mybooktype/
     
    # Edit configuration file
    # You need to add name of the server
    nano /etc/apache2/sites-available/booktype
     
    # Remove default site
    a2dissite default

    service apache2 restart

    # Add your new site
    a2ensite booktype
     
    # Restart Apache server
    service apache2 restart
  • But there are lot of stuff in booktype-error.log.  I am not able to upload profile pictures, among other things going on.
  • To correct the profile picture problem, I had to do the following:

    For Debian Wheezy, the PIL installation does create support for jpeg, png and zip, although these libraries are installed.  It is probably because some installpaths have changed i new Debian version.

    I had to do:

    $ pip uninstall PIL
    $ apt-get install libjpeg-dev libfreetype.so libz.so # (to make sure they are isntalled)
    $ ln -s /usr/lib/x86_64-linux-gnu/libjpeg-dev.so /usr/lib/libjpeg-dev.so
    $ ln -s /usr/lib/x86_64-linux-gnu/libfreetype.so /usr/lib/libfreetype.so
    $ ln -s /usr/lib/x86_64-linux-gnu/libz.so /usr/lib/libz.so
    $ pip install PIL

    $ cd /var/www/mybooktype/mybook

    # Back up modified config files
    $ cp settings.py /var/www/
    $ cp booki.wsgi /var/www/

    $ cd ..

    $ rm -r mybook

    $ source bin/activate
    $ ./Booktype/scripts/createbooki --database postgresql mybook

    $ cp /var/www/settings.py /var/www/mybooktype/mybook/settings.py
    $ cp /var/www/booki.wsgi /var/www/mybooktype/mybook/booki.wsgi


    $ source mybook/booki.env
    $ django-admin.py syncdb --noinput
    $ django-admin.py migrate

    $ cd ..

    $ chown -R www-data:www-data mybooktype/

    ..............................................

    Now profile pictures sometimes work, and sometimes don't work.  I dont understand why.  I upload a profile image, take a refresh, picture is there, then next refresh, picture is gone, then it comes back...frustrating.
    It can be tested here (just reload the page a few times, sometimes picture shows, sometimes the debug page show up)http://folketsforlag.org/_utils/profilethumb/folketsforlag/thumbnail.jpg?width=48


    Also it is not possible to make a book cover, it will not show up. It seems like it is uploading, and you can approve it, but it does not create a cover for the bookdisplay in Booktype.


    Post edited by Graabein at 2015-01-13 10:35:56
  • For the book cover problem, I get the following when uploading a cover:

    booktype-error.log
    [Tue Jan 13 20:10:22 2015] [error] [client 78.26.8.27] File does not exist: /var/www/mybooktype/mybook/static/css, referer: http://folketsforlag.org/velkommen-til-folkets-forlag/_info/
    [Tue Jan 13 20:10:22 2015] [error] [client 78.26.8.27] File does not exist: /var/www/mybooktype/mybook/static/css, referer: http://folketsforlag.org/velkommen-til-folkets-forlag/_info/
    [Tue Jan 13 21:12:36 2015] [error] [client 78.26.8.27] File does not exist: /var/www/mybooktype/mybook/static/css, referer: http://folketsforlag.org/accounts/login/?next=/velkommen-til-folkets-forlag/_edit/
    [Tue Jan 13 20:12:37 2015] [error] [client 78.26.8.27] File does not exist: /var/www/mybooktype/mybook/static/css, referer: http://folketsforlag.org/accounts/login/?next=/velkommen-til-folkets-forlag/_edit/
    [Tue Jan 13 20:14:05 2015] [error] [client 78.26.8.27] File does not exist: /var/www/mybooktype/mybook/static/css, referer: http://folketsforlag.org/velkommen-til-folkets-forlag/_info/
    [Tue Jan 13 20:14:06 2015] [error] [client 78.26.8.27] File does not exist: /var/www/mybooktype/mybook/static/css, referer: http://folketsforlag.org/velkommen-til-folkets-forlag/_info/

    I can see the uploaded coverphotos in the book manager covermanager area, but non shows up on the bookcover itself.  Also when I look in the book_covers directory I only see two "files", numbered/named "4" and "5".  The cover_photos directory is empty.

  • Vote Up0Vote Down Daniel JamesDaniel James
    Posts: 844Member, Sourcefabric Team
    Hi, the problem you are seeing in the log is likely to be due to your virtual host setup for the static directory. Either the alias is wrong, or the 'css' directory was not created. Please take a look at the file for Booktype under  /etc/apache2/sites-enabled/ - mine has a line like this:

         Alias /static/ "/var/www/booktype/instance1/static/"

    Does the directory which your alias for /static/ points to contain a 'css' directory? If not, perhaps you are running a production profile but you have missed the step of running the 
    ./manage.py collectstatic
    command. This is explained better in the 2.0 documentation at http://sourcefabric.booktype.pro/booktype-20-for-authors-and-publishers/installation-on-gnulinux/

    Please let me know what you find, we'd like to get this fixed for you.
  • Tank you Daniel.  I have moved the adress of this installation to http://bokverksted.folketsforlag.org and it is not installed in a virtual host setup.  Instead I installed it in a plain new droplet.

    I now see that mybooktype/mybook/static directory does not contain a 'css' directory, so will do you next step, however the procedure needs to be corrected.

    Here is the main problem:  It is not possible to install 1.6.1 based on the installation steps described neither in http://sourcefabric.booktype.pro/booktype-16-for-authors-and-publishers/_draft/_v/1.0/installation-on-gnulinux/ manual, or this manual https://wiki.sourcefabric.org/display/Booktype/How+to+install+it+on+Debian#HowtoinstallitonDebian-BooktypewithPostgreSQL

    I know you have said "forget about the wiki", but the fact is that the wiki install guide is the most correct one, and the one I have followed (along with my own seach for fixes) in order to get this installation running.

    In above comments I have described in detail the installation steps I took, it is the steps described here: https://forum.sourcefabric.org/discussion/comment/31656#Comment_31656
    followd by the steps described here: https://forum.sourcefabric.org/discussion/comment/31664#Comment_31664

    I really suggest you upgrade the documentation, at least investingate if what I am saying and doing is correct or not.  Because people who just follow your official installation guides as they are now, will simply not be able to install it,  I have tried so many times to prove it, most of my install problems is the proof of it.  So please consider upgrading the documentation.

    So to fixing the remaining problem:

    I can not do a .
    ./manage.py collectstatic
    This is another step of incorrect documentation, because there is no "manage.py" file in the 1.6.1 created files

    Instead it has to be
    django-admin.py collectstatic
    So to correct the problem you suggest I do this (assume I am following the steps here taken https://forum.sourcefabric.org/discussion/comment/31656#Comment_31656)

    #You can continue now with initialisation.
    source mybook/booki.env
    django-admin.py syncdb --noinput
    django-admin.py migrate
    #django-admin.py createsuperuser (not do this one, as I don't want to reinstall my database, already have superuser and other users)
    django-admin.py collectstatic

    Then quit the virtual python environment and reset the directory permissions to www-data?

    Will this be correct? Do I risk something with my current installation, other than fixing it? :-)
    Post edited by Graabein at 2015-01-16 06:17:20
  • (mybooktype)root@folketsforlag:/var/www/mybooktype# django-admin.py collectstatic
    Unknown command: 'collectstatic'
    Type 'django-admin.py help' for usage.
    (mybooktype)root@folketsforlag:/var/www/mybooktype#

  • Thanks for your detailed description of the problems you are having installing BookType as well as your workarounds.

    WRT the PIL install issue that you mentioned once, I also came across this error, and googling led me to this description of the problem: http://stackoverflow.com/questions/21242107/pip-install-pil-dont-install-into-virtualenv.

    I have fixed the problem for myself by editing the Booktype/requirements/_base.txt file and inserting the following 3 lines before the last line so that the last 4 lines now look like this:

    # Need to enable external location for the PIL library
    --allow-external PIL
    --allow-unverified PIL
    PIL

    I'll submit these changes as a patch but I'm not in a position to check their backwards compatibility with older versions of pip.
    Post edited by Rob Hills at 2015-02-02 01:23:56