Pressbooks in a VM - need help with mail notifications

62 views
Skip to first unread message

Tim F

unread,
Oct 2, 2014, 8:13:16 PM10/2/14
to press...@googlegroups.com
I discovered PressBooks when looking for ways to convert my wife's blog posts into a series of ebooks. I've been working on ebooks for a couple years, so I know how they should be constructed. I tried every WP plugin, and PressBooks is far and away the best of those tools for making ebooks.

I have lots of ebooks to make, so I wanted to set up PB on my own server. On my shared web host, I'm not able to run Java, so I installed PressBooks as a VM in VirtualBox on my Mac (running OSX 10.9). Here are the steps:

  1. Download the TurnKey Linux VM that has WordPress already installed (http://www.turnkeylinux.org/wordpress), unzip the file and move the VMDK file to an appropriate location for your new VM.
  2. Create a new VM guest and use the VMDK file as the hard drive. Allow 512MB CPU, set Network to Bridged (assigning the device, ethernet or wifi, that your host computer uses to connect) and choose the defaults for the rest of the options.
  3. Start the new VM and set up passwords during first run. Record the IPs somehow because you'll need them later.
  4. Go to the command line in the VM, either by choosing the Advanced Setting in the VM and then Q to quit the configuration console or by using a Terminal app to SSH to the VM, and then complete the next 3 steps
  5. Update Linux with
    apt-get upgrade

  6. Install packages for php5-xsl (XSLTProcessor), libxml2-utils (xmllint), and openjdk-7-jdk (Java) using:
    apt-get install packagename

  7. Change the ownership of the Wordpress files (this is needed to allow FTP to work within WP and update plugins and WP):
    chown -R www-data:www-data /var/www

  8. In a browser, go to the IP for Wordpress admin (in my case it was 10.0.1.12/wp-admin), then log into WP and complete the next 3 steps
  9. Deactivate and delete all pre-installed plugins
  10. The VM is running WP 3.6.1, so update to WP 4.0
  11. Change the permalink structure so WP will generate a .htaccess file (otherwise you will need to create the file to complete the instructions in Part I)
  12. Follow Part I of the process for installing PressBooks (creating the .htaccess file if needed)
  13. Initiating the WP multisite option changes the values for the home_url and site_url records in wp_options table to 127.0.0.1. Use PHPMyAdmin or your tool of choice to manually change the values in the MySQL database from 127.0.0.1 to the IP address of the VM
  14. Continue with Part II for installing PressBooks. Use the latest version of PressBooks, currently 2.3.3, which is available from https://github.com/pressbooks/pressbooks
  15. Install the dependencies in Part III of installing PressBooks by completing the next 3 steps (xmllint was installed earlier)
  16. Download the free prince package for Debian from http://www.princexml.com/download/ and install it. The easy way is to use FTP to move the package to /root on the VM and then on the command line install the package with
    dpkg -i prince_9.0-5_debian7.4_amd64.deb

  17. Download epubcheck from https://github.com/IDPF/epubcheck and unzip it. Use FTP or another method to copy all unzipped files to a location in the VM (can use /opt/epubcheck/)
  18. Download Linux version of kindlegen from http://www.amazon.com/gp/feature.html?docId=1000765211 and copy it to a location in the VM (can use /opt/kindlegen)
  19. Update wp-config.php as needed with the locations and filenames of epubcheck and kindlegen (prince and xmllint should work with the locations given in the PressBooks readme.txt)
This is an optional step: Almost all my exports from Pressbooks will be only the epub version, so I edited the options starting at line 102 in /var/www/wordpress/wp-content/plugins/pressbooks-dev/admin/templates/export.php to be true (1) for only epub and epub3.

There's one remaining problem with this setup that I haven't been able to figure out: how to send email from WordPress. Not all my epubs are perfect, alas, and getting the email with the list of errors from PressBooks would be helpful in figuring out what needs to be done to fix them. My setup is a local VM and I don't have a fully qualified domain name (FQDN), so emails sent from www-data@localhost are not being sent. I can see the emails in the postfix mail queue, but it would be much more convenient to have the email delivered to me. Any help would be appreciated.

Tim

nick

unread,
Oct 7, 2014, 11:32:06 AM10/7/14
to press...@googlegroups.com
Try using a SMTP plugin to avoid the local sendmail queue altogether:


_________________________
Nick Ciske
@nciske
Did I help you? Say thanks: http://bit.ly/1lahwy0
Reply all
Reply to author
Forward
0 new messages