The Windows Open Source Developer Diaries–Installing stuff

< Previous: The Windows Open Source Development Diaries – The beginning

For those of you who read my previous post on this subject you might have noticed the extra ‘Windows” on the title. Just to make it clear that all these posts refer to windows installations only. Something that it proved all too important when I was trying to install all the different components.

Geoserver installation

I installed  Geoserver 2.2-RC as this is the required version according to the Cartaro documentation Used the Windows Installer following the steps outlined here and accepting most of the default options. I only changed the port number to 8082 from the default 8080 and selected to start Geoserver manually rather than installing it as a Windows service. Installed nicely without the slightest problem. Game on!

It almost went toooo smoothly… I mean I thought I would have to install Apache Tomcat or similar. But looking the windows services revealed nothing. So which web server was Geoserver using? I then found this in the Windows Binary topic in the Geoserver documentation:

The most common way to install GeoServer is using the OS-independent binary. This version is a GeoServer web application (webapp) bundled inside Jetty, a lightweight servlet container system. It has the advantages of working very similarly across all operating systems plus being very simple to set up.

Right. So this sorted this “automagic” mystery. You can actually see the reference to Jetty in the startup.bat file under the [Geoserver_install]\bin folder. So guess in retrospect, it was a good choice not to install as a windows service. Less of a black box.

PostGIS installation

Ok, this is where I cheat a bit. Postgres 9.1 and PostGIS 1.5 were already installed on my laptop so I wont be covering their installation here. However, in my experience installing on Windows is dead easy. You can simply  follow the installation wizard and accept the default options. PostGIS is now included in the Postgres installation as an option, so you can install both in a single step. You can find more information here and download the Windows installer here.

Installing Cartaro

I have to say I found the Cartaro and Drupal documentation a bit chaotic. All the information is there (or most of it anyway), but its all over the place. And as it sometimes happens for OS s/w, Windows-specific documentation is a bit scarce. The actual documentation on the Cartaro site, states that the install guide is based on “Ubuntu Precise (12.04 LTS)”, whatever that is, and that  “You might need to adapt commands depending on your Linux distribution”. Err… ok then. I knew there and then that I was in for a lot of fun…

But hey, at least there is a Cartaro distribution for Windows (basically a zip file). The install.txt file in the zip file, says it requires a web server like Apache (version 2.0 or greater) is and PHP 5.2.4 (or greater). This actually proved to be wrong. It requires the 5.2.11 version. But you only find about this later as I was soon to find out.

Being lazy, I thought the easiest way to install Apache and PHP in one go was to use the OSGeo4W installer Which I did and selected only these two apps to download. The Apache server on the installer is 2.2.14-4 and PHP on 5.2.5. Assumed –incorrectly as it turned out- that these would do the trick.

The OS4GeoW installation created an “Apache OSGeo4W WebServer” windows service. But it didn’t start. I had seen this before and it was because I had IIS Server and they both trying to run on the same port (80). The solution was simple: Went to my Apache install folder and opened the httpd.conf file (in my installation: C:\OSGeo4W\apache\conf.\httpd.conf) Then I edited the file changing the line reading Listen 80 to Listen 8081. Apache now started fine. Cool. Next step was to install Cartaro itself.

Having being spoiled by Geoserver and Postgres/PostGIS and their excellent windows installers I tried to find a package windows installer. I found Acquia and some others but none were specific for Cartaro and most of them were based on MySQL. Just for reference the windows installation instructions (for Drupal in general, NOT Cartaro) can be found here.

In the end I simply unzipped the contents of the installation file under my htdocs Apache folder  (in my installation C:\OSGeo4W\apache\htdocs) under a folder called CartaroInstall. Restarted Apache, opened my browser, typed http://localhost/8081/CartaroInstall  and was welcomed by this soothing page:

image

Surely I am almost there?

Before I continued I had to create and edit the settings.php file as outlined here. The document speaks about setting the correct permissions in the settings.php file so until I knew know exactly what I am doing I gave full control to Everyone (this is just a local site after all) as below:

image

Went back to the install page, clicked on “Save and Continue” and got this- oops!image

Ok, so it looked like some PHP extensions were not enabled. To enable them, I edited the php.ini file (located under C:\OSGeo4W\apache\bin in my installation) and uncommented these lines:

  • extension=php_gd2.dll
  • extension=php_mbstring.dll

I repeated the previous steps, restarting Apache etc., and now got this:

image

SQL Lite??

It turned out I had to edit php.ini again and uncomment this line:  extension=php_pdo_pgsql.dll

This time things looked better:

image

Entered my postgis connection details using the default ‘postgres’ user and clicked “Save and continue”. Well, not so fast:

image

Now its telling me!! Might be a nice to have a note SOMEWHERE. Argh! Anyway, I headed over to  PHP Releases and downloaded 5.2.11 from http://museum.php.net/php5/php-5.2.11-Win32.zip

I then unzipped all the files into the C:\OSGeo4W\apache\php folder.

Note: Since PHP was originally installed with the OSGeo4W installer, I moved the files below in the C:\OSGeo4W\bin  folder.

image

This time I thought I was on a winner as it seemed that it was installing things…

image

But then I got this error:

image

I checked the Apache error log file (C:\OSGeo4W\apache\logs\error.log) The error was the incomprehensible:

PHP Parse error:  syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM, expecting ‘)’ in C:\\OSGeo4W\\apache\\htdocs\\CartaroInstall\\profiles\\cartaro\\modules\\contrib \\geoserver\\geoserver_ui\\plugins\\export_ui\\geoserver_layers_ctools_export_ui.inc on line 126, referer: http://localhost:8081/CartaroInstall/install.php

Excuse me? unexpected T_PAAMAYIM_NEKUDOTAYIM??!! What on earth does that mean? Seemed it was a bug but the first reference I found about this specific for Drupal did not offer any real solutions: http://drupal.org/node/1762546). But then I found this little piece of gem on Stackoverflow:  http://stackoverflow.com/questions/1966010/what-does-this-mean-parse-error-syntax-error-unexpected-t-paamayim-nekudotay 

Apparently Paamayim Nekudotayim is Hebrew and stands for “twice colon” or “double colon” (Hebrew: פעמיים נקודתיים‎. There you go. Picking up foreign languages in the process!

And so I changed line126 in the geoserver_layers_ctools_export_ui.inc file from:

‘#options’ => $layer_type_name::get_sources(),  to ‘#options’ => $layer_type_name->get_sources(),

And that got me into the next and final step:

image

Now, the Cartaro documentation states that:

GeoServer contains a default admin account with username “admin” and password “geoserver”. Either use this account when installing Cartaro, or adapt the account to match your Drupal admin account. 

And also to:

Ensure that your Drupal credentials match up with the credentials for GeoServer because Drupal users will be authenticated with GeoServer on login (this allows for protected layers and GeoServer administration from Drupal)

So I put the default geoserver username and password (admin/geoserver),

image

and clicked on ‘Save and Continue’. This time everything seemed to work ok. I had Cartaro installed. Hurrah!

image

I didn’t worry too much about the email error as I guess this is expected. Will need to configure the PHP mail settings at some point. Clicked on the Visit your new site link and got this nice page:

image

Looking good. Next step is to configure my new site and add a few maps. Stay tuned!

2 thoughts on “The Windows Open Source Developer Diaries–Installing stuff

  1. Hi there! Would you mind if I share your blog with my facebook group?
    There’s a lot of people that I think would really enjoy your content. Please let me know. Thank you

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s