Install in Ubuntu 10.04 : it works ! and it prints !
  • Hi

    After weeks of tries and errors, I tried one more time. And it was good for me.

    I used https://github.com/sourcefabric/Booktype/wiki to install in a virtual machine LXC with Ubuntu 10.04.

    And it works well. With Apache and Postgresql. And behind my reverseproxy.

    Only a few things.

    By default, postgres doesn't work with utf8, then I had to use google to fix that.
    As allways, pb with PATH for python to make django-admin.py works, then I had to add PATH=${PATH%:/home/... in a root session.
    And I put in settings.py :

    I like very much Booktype.

    Good luck for everyone

  • 7 Comments sorted by
  • I have managed to get Booktype to work (in Ubuntu Precise), with PostgreSQL, but I can't seem to get objavi working locally. For some (probably simple) reason, Apache wants to display the contents of objavi.cgi rather than run the file. I have tried all sorts of things to get this to work (copying the scripts to /usr/lib/cgi-bin/, changing the configuration paths in the virtual host file, adding and removing various settings for python mods, paths, and options), but to no avail.

    Have you successfully installed Objavi as well, on your locahost machine? It looks like you are using objavi.booktype.pro, so maybe you did not install objavi locally. But if you (or others) have installed objavi locally, any insight is welcome.

    And yes, Booktype seems immensely cool...
  • I use objavi.booktype.pro. I can't install a working objavi. Too many errors and python is so strange for me... Sorry. I'm searching too to install my own objavi.

    I'm using LXC virtual machine then I'll try one more time to install objavi after a backup of my working booktype.

    I'll give informations if I succeed in this forum.

    I agree : Booktype is a good soft, with plenty of promises, for particular and for teachers...

  • Vote Up0Vote Down Micz FlorMicz Flor
    Posts: 184Administrator
    I once made these notes installing Booktype and Objavi on Ubuntu 10.04. I am not sure if this works with the latest version, but I have proof that it works: it is part of the bootable ISO with all Sourcefabric products which you can find here: http://files.sourcefabric.org/LiveCD/

    Hope this helps, even though it does not tackle the problem described here directly.

    INSTALL BOOKTYPE
    ----------------

    sudo apt-get install git-core
    mkdir Booktype_Source
    cd Booktype_Source/
    git clone https://github.com/sourcefabric/Booktype.git
    sudo apt-get install python-pip
    sudo apt-get install libxml2-dev libxstl-dev
    sudo apt-get install libapache2-mod-wsgi
    sudo apt-get install python-lxml
    sudo apt-get install redis-server

    sudo pip install Django==1.3
    sudo pip install South==0.7.5
    sudo pip install unidecode lxml
    cd Booktype/
    ./scripts/createbooki --database sqlite /home/sourcefabric/Booktype_Source/booktypeserver
    cd ../booktypeserver/
    nano booki.wsgi
    # make sure this line is in the file or you need to add it (anywhere BEFORE application=...)
    sys.path.insert(0, '/usr/local/lib/python2.6/dist-packages/')
    # important: no space at the beginning of the line

    sudo cp wsgi.apache /etc/apache2/sites-available/
    cd /etc/apache2/sites-available/
    sudo nano wsgi.apache
         ServerName booktype.local 
         SetEnv HTTP_HOST "booktype.local"
    sudo mv wsgi.apache booktype-vhost
    sudo a2ensite booktype-vhost
    cd /home/sourcefabric/Booktype_Source/booktypeserver/
    . booki.env
    django-admin.py  syncdb --noinput
    django-admin.py  migrate
    django-admin.py loaddata documentation_licenses
    sudo chown -R sourcefabric:www-data /home/sourcefabric/Booktype_Source/booktypeserver/
    sudo chmod -R 775 /home/sourcefabric/Booktype_Source/booktypeserver/
    django-admin.py createsuperuser
      Username (Leave blank to use 'sourcefabric'):
      E-mail address: contact@sourcefabric.org
      Password:
      Password (again):
      Superuser created successfully.
    - Now start Booktype in browser: booktype.local
    - log in
    - import books, e.g.: http://booki.flossmanuals.net/booktype/

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

    INSTALL OBJAVI
    --------------

    cd Booktype_Source/
    git clone https://github.com/sourcefabric/Objavi.git
    sudo apt-get install python-lxml
    sudo apt-get install pdftk
    sudo apt-get install pdfedit
    sudo apt-get install texlive-latex-base
    sudo apt-get install xvfb
    sudo apt-get install fontconfig
    sudo apt-get install psutils
    sudo apt-get install poppler-utils
    sudo apt-get install calibre

    cd Objavi/
    bash setup.sh
    sudo chown -R sourcefabric:www-data htdocs/*.cgi
    sudo chmod -R 775 htdocs/*.cgi

    wget http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.11.0_rc1-static-i386.tar.bz2
    bunzip2 -c wkhtmltopdf-0.11.0_rc1-static-i386.tar.bz2 | tar xf -
    sudo cp wkhtmltopdf-i386 /usr/local/bin/wkhtmltopdf
    # check if the bin is found
    which wkhtmltopdf
    rm wkhtmltopdf-0.11.0_rc1-static-i386.tar.bz2
    rm wkhtmltopdf-i386

    # add this to /etc/hosts
      127.0.1.1       objavi.local
    sudo cp doc/deployment/example-apache.conf /etc/apache2/sites-available/objavi-vhost
    sudo nano /etc/apache2/sites-available/objavi-vhost
    # edit / add the following lines to:
      ServerName objavi.local
      DocumentRoot /home/sourcefabric/Booktype_Source/Objavi/htdocs
      <Directory /home/sourcefabric/Booktype_Source/Objavi/htdocs>

    sudo a2ensite objavi-vhost

    mkdir -m 775 htdocs/books
    mkdir -m 775 htdocs/booki-books
    mkdir -m 775 htdocs/tmp
    mkdir -m 775 cache
    mkdir -m 775 log
    sudo chgrp -R www-data htdocs/books
    sudo chgrp -R www-data htdocs/booki-books
    sudo chgrp -R www-data htdocs/tmp
    sudo chgrp -R www-data cache
    sudo chgrp -R www-data log

    # Objavi uses the booki python module from Booktype, create a link to it
    ln -s ../Booktype/lib/booki booki

    # edit Booktype config: booktypeserver/settings.py
    THIS_BOOKI_SERVER = 'booktype.local'
    OBJAVI_URL = "http://objavi.local/objavi.cgi"
    ESPRI_URL = "http://objavi.local/espri.cgi"
    TWIKI_GATEWAY_URL = "http://objavi.local/booki-twiki-gateway.cgi"

    gedit objavi/config.py
    # search for booki.cc and duplicate the entry right beneath
    # and change the first line to objavi.local.
    # then it should look like this:
        'booktype.local': {
            'css-book': '/static/en.flossmanuals.net.css',
            'css-web': '/static/en.flossmanuals.net-web.css',
            'css-newspaper': '/static/en.flossmanuals.net-newspaper.css',
            'css-openoffice': '/static/en.flossmanuals.net-openoffice.css',
            'lang': 'en',
            'dir': 'LTR',
            'toc-encoding': None,
            'display': True,
            'interface': 'Booki',
            'toc_header': 'Table of Contents',
            },

    sudo /etc/init.d/apache2 reload

  • This is very helpful and comprehensive. Thanks very much. I'll give it a go.
  • Cool !!!
     I tried again and it's working.

    One virtual machine LXC is booktype. And I can write my books.
    The seconde virtual machine LXC is Objavi. And I can publish. But ...

    ... only with epub format.

    Pdf is not working.

    First idea. I think it's a outline_file or outline.txt problem I think.
    NB : xvfb is installed.

    Second idea. A problem with Xauthority (I have an empty file called the same in folder in tmp). I don't know what is Xauthority.

    If someone could help me...


  • Reply to @ph+all: Do you have a working wkhtmltopdf installed somewhere in PATH?  If you send me the log output from Objavi I could take a look and see what the problem could be.
  • I answer myself (with the help of Borko Jandras) : I put the wrong wkhtmltopdf, a 32-bit version and not the right, a 64-bit because of my 64-bit Ubuntu.

    It's good now.