Ever since Pressbooks announced it was open sourcing its plugin, I had it on my to do list to download it and give it a try. Their own site is pretty slick and I’d enjoyed making an e-book with their tools. The plugin install has gone pretty smoothly, with most bumps coming as I prepared my system for the it. I’m still not 100% operational but I’m making progress.
Prepare the Backend
The plugin comes as a zipped download. You will want to get the readme.txt file out of it for additional configuration information, particularly in relation to exports. I’m running Ubuntu 12.04, MySQL, Apache 2, and PHP 5. Since I was already running WordPress (both multisite and standalone), I already had the basic stack of software to get the plugin running.
Except that my version of PHP was older than the version required for Pressbooks. To get this, I had to add a new repository for the PHP 5.4 software (I was on 5.3) and upgrade the software. It made some additional changes to my Apache environment which caused me some problems but otherwise it was pretty straightforward.
My PHP.ini Cheese Moved
First, the PHP.ini file changes. So if you are pointing at a mysql.so extension in the /usr/lib/php5 folder, you may find that the folder name has changed/disappeared. Mine was now /usr/lib/php5/20121212/mysql.so. The change needs to be made in your PHP.ini file, which in my case is at /etc/php5/apache2/php.ini
Apache, Rewrites, and .HTACCESS
something else goes haywire. I have not figured out the why for this one but all of my sites went offline, reporting back a 500 error. It was tied to how Apache was handling the .htaccess files at the root of each WordPress site. As you may know, WordPress uses a bunch of rewrites to make the blog post and other content Web addresses more user-friendly.
When I reviewed my Apache error logs (at /var/log/apache2/error.log), I saw that it was choking on the rewrites. Specifically, I was getting this error: Rewrite engine not available here or Rewrite cond not available here. I fooled around with it for a bit before I found the answer, which was to add a <Directory> directive to the Apache2.conf file and enable AllowOverride.
As I mentioned, I run a bunch of WordPress sites and thought that I would need to create a Directory entry for each one. But it’s applies to subdirectories, so I was able to add this:
to my Apache2.conf file and solve the problem for all of my sites below that www folder.
Adding the Plugin
I won’t go through installing WordPress multi-site. This is well documented and is, in essence, installing a single WordPress site and adding a line to your wp-config.php file afterwards. Pressbooks says to create a new, clean multisite install. So I didn’t, although I already have a multi-site running. I created a new folder, dropped WordPress in, and got started. If you’ve got that readme.txt file from the zip file, it will walk you through all the preliminaries.
This was just as easy as any other WordPress plugin. Once you’ve download the zip file, you can choose to upload the new plugin. The file format it needs is zip, so you’re ready to go. Make sure you’ve activated the network from the WordPress dashboard and then add the plugin.
If you haven’t used multisite before, you’ll want to use the Network dashboard to enable all of the Pressbook e-book themes. When I create a new book (which is a new site in the multisite network), the Pressbook plugin is not automatically activating for me, like it does on their site. To get the proper look and feel, navigate to the new book (site), go to plugins and activate Pressbook.
I exported my original e-books from Pressbook – one I’d made public and a second I was fooling around with – to see if they’d import. I used the WordPress XML export and they import fine. You will need to activate the WordPress importer (free plugin) and you will need to make sure the Pressbook plugin is active. Otherwise, you may get “type” errors because Pressbook uses chapters, front matter, etc., not just posts and pages.
All in all, it probably couldn’t have gone much more smoothly. However, I’m not quite operational and need to finish some final items. First, while I’ve downloaded the relevant EPUB and MOBI format export tools from Google and Amazon, I have not been able to successfully export with them.
The dashboard UI relies on jQuery and the installed version is out of date. To be honest, I have no idea where this is located. It’s an easy fix, though, and I’ll grab the latest version and knock that off the list of wrap up items. Update 08042012: versions 2.1 and 2.2 of the Pressbooks plugin are not compatible with WordPress 3.6; stay on 3.5.2. You can also replace the contents of the blockUI script located in wp-content/plugins/pressbooks/symbionts/jquery/jquery.blockUI.js as some other 3.6 users are, but I’m not finding it fixes my editor problem (which is that it doesn’t appear). Since I’m just noodling, I’m going to stick with 3.6 and keep digging around.
Also, while the dashboard works just as I expected, I cannot get any of the books to load from the visitor side. While the books are set to be publicly visible, I’m hanging on a sending request message. There were other weird calls, like one to Facebook even though I don’t use the Facebook button. I will need to dig around a bit to figure out where the hang up is. I have a feeling it’s got something to do with the themes.
Once I can get the front end sorted out, and get the export features working, I’ll be in great shape. I’m looking forward to having the option of creating e-books in non-PDF format. The themes are excellent for making texts readable. While you can create e-books using desktop tools as well, it makes sense to me that a document that’s born in HTML stays there.