mod_gb FAQ
Last updated on Oct. 31st, 2002
Marco Ridoni <marco.ridoni@virgilio.it>

1 - Overview
1.1 What is mod_gb?
1.2 Where does mod_gb come from?
1.3 What is ASP?
1.4 What is VBScript?
1.5 Are there alternatives to Gnome Basic?
1.6 Are there alternatives to mod_gb?
1.7 What are the aims of mod_gb?

2 - Technical
2.1 What features does mod_gb_support?
2.2 How much is mod_gb different from Gnome Basic?
2.3 How was the code reworked?
2.4 What are classlibs?
2.5 Are sessions supported?
2.6 What about database support?
2.7 What ASP version does mod_gb support?
2.8 Where can I find a good reference on ASP?
2.9 Where can I find more reference materials?
2.10 How is testing being done?
2.11 What about security?

3 - The Project
3.1 Do you accept patches/submissions?
3.2 Will feature XXX be implemented? When?
3.3 Can I write my own classlibs?
3.4 Will mod_gb stay free software?
3.5 Are there any plans for Apache 2.x?


1.1 What is mod_gb?
mod_gb is a module for the Apache web server. It comes in the form of a DSO (Dynamic Shared Object) which can be loaded when Apache is started. mod_gb allows your server to serve dynamic pages written according to the ASP specification in what is the most widely used ASP language (i.e. VBScript).

1.2 Where does mod_gb come from?
In 1998 Michael Meeks and other people started a project named Gnome Basic, with the aim of building a MS Visual Basic work-alike for the Gnome desktop. GB was meant as a full-fledged app, including Forms, Classes, a project parser and all the tools needed to run actual VB programs. Preliminary support for ASP compatibility was somehow present in the project but, anyway, GB never reached the state of maturity. A few months after the Mono project was started, GB was declared "dead" for good, since, for the task of running VB apps, a much better alternative was available. I started from where GB was left, but quite in a different direction, and mod_gb was born. For more details, see 2.3 How was the code reworked?

1.3 What is ASP?
ASP is the acronym for Active Server Pages, a Microsoft technology which allows to serve dynamic content from a web server (IIS, Microsoft Intern Information Services), in a fashion very similar to Apache
when coupled with PHP, Perl, Python or CGI programs. The ASP specification, in its version 2.0 defines five "objects" (Application, Session, Request, Server and Response) which are used to manage different parts of the web request processing. ASP 3.0 added several extensions to VBScript and more objects.

1.4 What is VBScript?
It is common knowledge that ASP == VBScript. Wrong. ASP is simply a specification for a web programming environment which can be used by several languages. VBScript is certainly the most popular, but ASP pages can also be written in JScript (Microsoft's own version of Javascript) and there is also a Perl module (Apache::ASP) which allows you to use the ASP objects from Perl.

VBScript is a subset of Visual basic for Applications, which in turn is a subset of Visual Basic. The syntax stays the same for the most part, the most notable difference being that the only type of variable available in VBScript is "Variant". mod_gb, at least for now, supports some Visual basic extensions, owing to its origin.

1.5 Are there alternatives to Gnome Basic?
If you need to run VB programs under Linux/*nix, there is no alternative that I know of. But the Mono project is progressing at a steady pace, so keep looking.

1.6 Are there alternatives to mod_gb?
If you need to run ASP/VBScript pages under Linux here and now there are two commercial alternatives: Sun One Active Server Pages (previously known as Chili!Soft ASP) and Stryon InstantASP 2.1 (previously known as Halcyon InstantASP). Both are quite expensive (US$ 495 and 995 respectively) but seem to do their job quite well. Of course they're closed source.

1.7 What are the aims of mod_gb?
mod_gb aims at being fully compatible with ASP/VBScript and at being a tool able to ease the migration towards free/open-source solutions. Many people in the free software community are scared of the possibility that as the level of compatibility with closed/commercial solutions increases, the role of free software and the possibility of having "strong" free-software applications are both diminished. On the other side a tool like mod_gb, when at a stable state, will allow to migrate your web applications towards a free (both as in "free speech" and in "free beer") environment in a more gradual way. Most sysadmins I know (includeing myself, of course) would scrap their WinNT/IIS server this very moment; but they simply can't, because there are too many apps (and too many clients) out there who need/want ASP/VBScript support. While a major rework of a given web site could be the chance to move it to, say, PHP or mod_perl, you simply can't throw out of the window (no pun intended...) thousands of lines of ASP code which was probably fully debugged and paid for.


2.1 What features does mod_gb_support?
All the ASP 2.0 standard objects (Application, Request, Response, Server, Sessions) are supported. This doesn't mean that all their properties/methods are there, but that they are properly instantiated and are available at runtime. More properties and methods are being added. I have ported first those objects and associated/methods/properties which I believe are more widely in use or possibly useful. For now, this is a list of what is currently working:

Request: Cookies, Form, QueryString, ServerVariables
Response: Write
Server: CreateObject, MapPath, HTMLEncode*, URLEncode*
Session: Item
Application: N/A

* these are stubs which return the same parameter passed to them

For what it concerns classlibs (see 2.4):
ADODB supports Connection and Recordset obejcts with a few Basic methods:
Connection: Open, Close, ConnectionString
Recordset: Open, Close, MoveNext, MoveFirst
, Update

FileSystemObject supports the File and TextStream objects with enough methods to read a file from a local filesystem.

2.2 How much is mod_gb different from Gnome Basic?
The core of mod_gb is an almost direct recompile (read below) of the old GB core (interpreter + runtime + runtime library) with several features added (i.e. object instancing a-la Set MyObject = New MyClass was still missing) and several bugs ironed out.

2.3 How was the code reworked?
mod_gb uses a different/simpler build system (I plan to reintroduce autoconf in a not-too-distant future) from GB. More notably, the whole codebase was ported from GTK+ 1.2/X11 to GLib 2.0 (particularly the type system) in order to eliminate the dependencies on X11 and Gnome (which were actually minimal)

2.4 What are classlibs?
Classlibs are external shared libraries which are loaded dynamically when the module handler starts up. They're somewhat similar to Microsoft ASP Objects/ActiveX classlibs and contain object definitions and code which can be instantiated and used by user ASP code (with the Server.CreateObject method). I chose this approach in order to keep mod_gb as modular as possible. Moreover this will allow to restrict access to some classlibs for a given virtual server on Apache.

2.5 Are sessions supported?
Yes, with some limitations; currently it is possible to store only string-data (and data which can be promoted to String type) in Session.Item's. To store objects or, at least, arrays, a serializer/deserializer is needed and planned.

2.6 What about database support?
mod_gb supports databases thru unixODBC, so any DB which has a driver for this library should work. Tests are currently done on MySQL .

2.7 What ASP version does mod_gb support?
Version 2.0, but take it with caution and a grain of salt, since a few hings do not make sense on *nix platforms. Anyway class support (ASP 3.0 level) is on the table and schedelued for inclusion in a month or two.

2.8 Where can I find a good reference on ASP?
Well, I suppose Microsoft's MSDN is the primary reference for ASP programming, but also sites like www.15seconds.com, www.asp101.com can be useful. Anyway, Google is your friend... :-)

2.9 Where can I find more support/reference materials?
mod_gb/GB code is documented where possible but, unfortunately, a good reference on its internals is lacking, so you will have to study the code or ask a few questions. There are two mailing lists devoted to this task.

2.10 How is testing being done?

I am the designer/programmer/mantainer/whatever of several ASP sites which make heavy use of databases, sessons, etc. I'm using my own code to test mod_gb, trying to leave it unmodified (apart from obvious things like connection strings, filesystem paths, etc.), in order to test compliance with "real" ASP behaviour. When more features will be present, I plan to test how some common toolkits (forums, e-commerce apps) work.

2.11 What about security?
mod_gb currently is not geared towards security, but in a stabler versions, this will be cared for in due manner. Please keep in mind that the great majority of attacks against IIS servers exploit holes in the server itself, and not in the ASP engine. As Apache is reasonably secure, this should lead to some degree of confidence.


3.1 Do you accept patches/submissions?
No. Well, sort of. Currently, mod_gb's codebase is a moving target, with a lot of code being reworked, removed or added, so I prefer to be free to mess with the code until mod_gb reaches a more stable state. This does NOT mean, of course, that if you discover a bug, have some idea or have coded a patch or an extension, you should keep it for yourself. Contact me or use the mailing lists instead.

3.2 Will feature XXX be implemented? When?
So far there is not a real roadmap but one can still ask (I said ask, not request or demand... :-) )

3.3 Can I write my own classlibs?
Yes, of course. As soon as possible I will put online a tutorial with sources. Anyway you can look at the code for current classlib implementations and try to reuse that.

3.4 Will mod_gb stay free software?

Of course it will! I couldn't make it proprietary even if I wanted (and I absolutely DON'T want this). This means that source will always be freely available for you to view, modify, criticize, destroy, etc.

3.5 Are there any plans for Apache 2.x?

Not right now, since Apache 2.0 API is very different from its 1.3.x counterpart (thread model, different module structure, different handles and a gazillion of other differences) but surely I will take a stab at it in the future.