GNUstepWeb Build Guide

Mr. Dennis Leeuw

Pieter Bothstraat 32
3531 GZ
Utrecht
NL

Permission to use, copy, modify and distribute this Guide and its accompanying documentation for any purpose and without fee is hereby granted in perpetuity, provided that the above copyright notice and this paragraph appear in all copies.

The copyright holders make no representation about the suitability of this Guide for any purpose. It is provided "as is" without expressed or implied warranty.


Table of Contents
Preface
Important Note
Credits
Introduction
1. GDL2
Dependencies
Getting the sources
Build and install GDL2
2. GNUstepWeb
Getting the sources
Dependencies
Build and install GNUstepWeb
3. Configuring Apache
List of Tables
1. Credits

Preface

The GNUstepWeb Build Guide describes the steps you need to go through to build, install and configure your system for the use of GNUstepWeb with the use of the GNUstep Database Library 2.


Important Note

Since both GDL2 and GNUstepWeb are based upon GNUstep it is expected that GNUstep is installed on the system. This document will not go into the details of installing it, and it expects that the dependencies for GNUstep are met, so things needed for GDL2 or GNUstepWeb that are also required for building GNUstep are expected to be there, this is especialy true for e.g. the -dev packages.

GNUstep is a development environment and it is thus expected that headerfiles are present.


Credits

Table 1. Credits

NameComments
Manuel GuesdonMaintainer of GNUstepWeb
David AyersMaintainer of GDL2

Apple, Mac and Mac OS are trademarks of Apple, Inc., registered in the U.S. and other countries.

Enterprise Objects, Enterprise Objects Framework, NeXT, NextStep, Objective-C and OpenStep are trademarks of NeXT Software, Inc., registered in the U.S. and other countries.


Introduction

The general idea behind GNUstepWeb is that you write an application in an object oriented language which you can access through a web interface. For this GNUstep is used. GNUstepWeb is an extension to the GNUstep development environment, hence the name.

By means of the programming interface of GNUstepWeb you write an application that can be run on a server which listens to a certain port. In Unix™ terminology one would describe it as a daemon.

Next to that GNUstepWeb provides an interface to a webserver, it extends the webserver so to speak. For e.g. Apache GNUstepWeb provides a module that handles the requests to the server and forwards them to the actual application.

This way GNUstepWeb enables you to create applications that can be accessed across the Internet through a normal web-server, and thus accessable with any browser. GNUstepWeb can thus be used as an ASP, or an Application Service Provider.


Chapter 1. GDL2

The GNUstep Database Library 2 (GDL2) is a set of libraries to map Objective-C™ objects to rows of relational database management systems (RDBMS). It aims to be compatible with Enterprise Objects Framework™ (EOF) as released with WebObjects™ 4.5 from Apple Inc.


Dependencies

To install GDL2 one needs the PostgreSQL database, currently no other databases are supported. If you install PostgreSQL from package make sure you also install the -dev package.


Getting the sources

To get GDL2 from CVS use:

export CVS_RSH="ssh"
cvs -z3 -d:ext:anoncvs@savannah.gnu.org:/cvsroot/gnustep co gdl2


Build and install GDL2

cd gdl2
./configure
make GNUSTEP_INSTALLATION_DIR=$GNUSTEP_SYSTEM_ROOT install


Chapter 2. GNUstepWeb

GNUstepWeb is a library which was designed to be compatible with WebObjects™ 4.x (developed by NeXT Inc.). This library is an extension of the GNUstep project.


Getting the sources

To get GNUstepWeb from CVS use:

export CVS_RSH="ssh"
cvs -z3 -d:ext:anoncvs@savannah.gnu.org:/cvsroot/gnustep co gsweb


Dependencies

GNUstepWeb ofcourse depends on a webserver to be present. In this document we will use Apache as that webserver. When installing apache from packages make sure you also install the -dev package.

Another dependency for GNUstepWeb, or actually the webserver adapter is libPropList. If your system supplier provides packages for libPropList, make sure that you here also install the -dev package.

Since most distro's do not supply libPropList we will quickly describe how to install it.

The purpose of libPropList is to closely mimick the behaviour of the property lists used in GNUstep/OPENSTEP (there formed with the NSString, NSData, NSArray and NSDictionary classes) and to be compatible with it.

grep Version `cod -a proplist.h`
Which should return:
/* Version number: 0.10.1
or higher.

Download URL

http://windowmaker.org/pub/libs/

Filename

libPropList-0.10.1.tar.gz

./configure
make
make install
ldconfig

Note

If you installed it in /usr/local (the default) make sure to add /usr/local/lib to the /etc/ld.so.conf! Otherwise apache might not find it when loading the module.


Build and install GNUstepWeb

cd gsweb
./configure
make
make install

cd GSWAdaptors/Apache
If you installed Apache from packages it might be that some header files are not installed in e.g. /usr/include but in /usr/include/apache-1.3. If this is case you have to adjust the following files:
../common/GSWUtil.h
../common/GSWUtil.c
../common/GSWStats.c
to include the right httpd.h and http_log.h

Adjust in mod_gsweb.c:

#include "httpd.h"
#include <http_config.h>
#include <http_request.h>
#include <http_core.h>
to
#include <apache-1.3/httpd.h>
#include <apache-1.3/http_config.h>
#include <apache-1.3/http_request.h>
#include <apache-1.3/http_core.h>

As you might have noticed this build is aimed at apache version 1, but the same is true for apache version 2. To build the module for apache there are two makefiles. For version 1 use:

make -f GNUmakefile-Apache1x
for version 2 use:
make -f GNUmakefile-Apache2x

Check /etc/apache/modules.conf to see where your modules are installed. In my case the modules are installed in /usr/lib/apache/1.3/. So I copied my module like this:

cp mod_gsweb.so /usr/lib/apache/1.3/

To also have a test to see if everything works do:

cd ../../Examples/hello
make install


Chapter 3. Configuring Apache

Add to /etc/apache/modules.conf:

LoadModule GSWeb_Module /usr/lib/apache/1.3/mod_gsweb.so
AddModule mod_gsweb.c

Add to /etc/apache/httpd.conf:

<IfModule mod_gsweb.c>
        GSWeb_ConfigFilePath /etc/gsweb/gsweb.plist
</IfModule>

<Location /GSWeb*>
	SetHandler GSWeb
</Location>

Create /etc/gsweb/gsweb.plist that looks like:

{
  canDumpStatus = YES;

  GSWExtensionsFrameworkWebServerResources =
            "/GSW/GSWExtensions/WebServerResources";

  applications = {
	hello = {
		adaptorTemplatesPath =
		         "/etc/gsweb/GSWAdaptorTemplates";
		canDump = YES;
		instances = {
                   1 = {
		         host=127.0.0.1;
		         port=9001;
		         parameters = { transport=socket; };
		   };
		};
  	};
   };
}

cd /usr/GNUstep/System/GSWApps/Hello.gswa/
./Hello

Start the webserver

And point your browser to http://127.0.0.1/GSWeb/hello