OpenShift is an IaaS (Infrastructure as a Service) platform with a free tier for development and low-intensity applications. It turns out to be very easy to get OpenBiblio up and running on OpenShift. This makes it ideal for small personal libraries, though not perhaps ready for mainstream since there is an unresolved timezone issue (see below).
Quick guide for experts
Start a new OpenShift gear with the PHP 5.4, MySQL 5.5 and phpMyAdmin cartridges installed. Install OpenBiblio into the gear with the following
define("OBIB_HOST", getenv('OPENSHIFT_MYSQL_DB_HOST')); define("OBIB_DATABASE", getenv('OPENSHIFT_GEAR_NAME')); define("OBIB_USERNAME", getenv('OPENSHIFT_MYSQL_DB_USERNAME')); define("OBIB_PWD", getenv('OPENSHIFT_MYSQL_DB_PASSWORD'));
The application should just work. Backup and restore can be done with phpMyAdmin.
In more detail
OpenShift provides platforms known as 'gears' for hosting web applications. Each gear has its own domain name composed of the name of the gear chosen by the user and the username, thus for example
Note that GIT has a staged commit and upload procedure: changes are first committed locally, then pushed onto the server.
Working with OpenShift presumes some familiarity with unix. In particular I have found that managing an OpenShift application is best done from within a unix environment, such as one of the flavours of GNU/Linux. Also, to execute all the steps below, some kind of authentication is likely to be required. You may need to make sure you have an SSH key pair set up, as described in the OpenShift documentation.
After signing up to OpenShift and sorting out the authentication, the first step to getting OpenBiblio up and running is to launch a new gear. Choose one with an appropriate PHP cartridge installed, and once it is up and running you can add the MySQL and phpMyAdmin cartridges. Now check that you can see your application by pointing a web browser to
The next step is to install OpenBiblio into the gear. To do this, first clone the gear using
At this point if you now browse to
Once you are at the database table installation step, you can simply go ahead and have OpenBiblio create default database tables. However if you want to populate the tables with data from somewhere else, for example from a pre-existing server, it is probably better to add the data first. If you have installed the phpMyAdmin cartridge, this can be done by browsing to
Alternatively, it is possible to use
At this point if you browse to
Guests can browse the library through an OPAC at
You might want to delete the
The timezone problem
In the install step, you might notice that PHP and MySQL are not set to the same timezone (or at least, it's unlikely they will be): PHP is likely set to the GMT timezone (ie UTC, or unix time), and MySQL is likely set to the SYSTEM timezone. The latter depends on where the virtual server thinks it is (it is probably on Eastern time). It's very difficult to access the configuration files in OpenShift to fix this. This arises from the constrained functionality that goes with an IaaS platform. One can access a local timezone variable in MySQL using phpMyAdmin and set it to
This is all symptomatic of a wider problem. The best solution would be to extend the OpenBiblio Library Settings to include a timezone variable. Then, all internal calculations can use UTC (unix time) and all dates/times reported to the user would be converted at the last moment to the required timezone. The timezone variable can be stored in the library settings table in the database, and the time/date conversions can be done in PHP using existing packages.
Other suggestions of how to handle this are welcomed!