Preparing Your System¶
These instructions cover manual installation of the prerequisites for OpenBlock and installation of the base Openblock software.
(You can skip this if you are cloning our AMI image.)
If you have problems...¶
Please drop a line to the ebcode google group or visit the IRC channel #openblock on freenode with any problems you encounter.
See System Specific Prerequisites on the developer wiki for specific lists of packages to install based on your distribution or OS.
Linux, OSX, or some other Unix flavor is required. Windows is not supported by the OpenBlock team, and may never be; but patches are welcome :)
Generally, you need:
- python 2.6 or 2.7 (2.5 is too old; 3 is a whole different world.)
- Postgresql 8.3 or later
- PostGIS 1.4 or 1.5
- libxml2 and libxslt
Optionally, it may be helpful to install prebuilt packages for the following if your distribution provides them:
- python lxml bindings
- python gdal bindings
- python imaging library (PIL)
- python shapely library
See http://developer.openblockproject.org/wiki/InstallationRequirements for details on installing these on particular operating systems.
(If you don't install these packages globally, the install process will attempt to build them, which means you need a C compiler, the Python development libraries, and various other things installed.)
GeoDjango's platform-specific instructions may have some useful information as well, as the majority of OpenBlock's requirements are just those of GeoDjango + PostGIS.
Don't forget ldconfig!¶
Typically after installing libraries, you will need to run this command:
$ sudo ldconfig
... in order for new libraries to be found while building software.
GeoDjango requires a spatial database; more specifically, OpenBlock requires PostGIS. This documentation generally assumes you are installing OpenBlock and Postgres on the same server. If you are using a remote server, please read Running PostGIS on a remote server and make adjustments accordingly.
OpenBlock is known to work with Postgresql 8.3, 8.4, 9.0, or 9.1, and PostGIS 1.4 or 1.5.
PostGIS template setup¶
Regardless of whether you run postgresql locally or on another host, you'll want a PostGIS template database. Some platforms install this automatically for you, some don't.
You (or your database admin) should follow the instructions for Creating a Spatial Database Template for PostGIS in the GeoDjango documentation and be sure to heed the Note about varying names and locations of the relevant files.
Database Access Settings¶
The following instructions (and the default settings) assume that there is an openblock database user which can create a database for use with openblock. You can create an openblock user by running:
$ sudo -u postgres createuser --createrole --createdb openblock
Depending on your database security setup, you may need to adjust the instructions, settings of postgres and/or settings of openblock.
Postgres administration is beyond the scope of these instructions, but as a quickstart, you can disable postgres security for local users by changing the pg_hba.conf file under etc (the precise location varies, but for postgresql 8.4 on Ubuntu it's /etc/postgresql/8.4/main/pg_hba.conf), comment out any line that starts with local all, and add a line like this:
local all all trust
Then restart postgresql. This is not suitable for production.
Testing Database Access¶
If the openblock user is configured correctly, you should be able to execute:
$ createdb -U openblock test_ob_access $ dropdb -U openblock test_ob_access