Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

javascript on server?

1 view
Skip to first unread message

c051n3

unread,
Nov 23, 2005, 7:04:17 PM11/23/05
to
After googling for the past few days I'm still uncertain if an
implementation exists that would allow a JS scripting environment to be
configured and executing within a web server (something along the lines
of PHP but using JS obviously).

I have seen slight comments here and there about a mod-js module for
apache but cannot find source or executable anywhere (vaporware?). I've
also read quite a few comments that indicate interest in this. This
product niche appeals to me and thus I am considering its development
and would glady welcome others with similar interests.

Assuming a final MPL'd or LGPL'd product integrated with
NSPR/JS(SpiderMonkey) running as a module under Apache's httpd -
- Are there any technical constraints or licensing restrictions
regarding NSPR and JS that would prevent me from doing this?

Thank you for your time and thoughts.

relevant quote: "The journey of 1000 steps begins with the first step..."

Matthew Mondor

unread,
Nov 23, 2005, 8:31:37 PM11/23/05
to
On Thu, 24 Nov 2005 00:04:17 GMT
c051n3 <c05...@yahoo.com> wrote:

> After googling for the past few days I'm still uncertain if an
> implementation exists that would allow a JS scripting environment to be
> configured and executing within a web server (something along the lines
> of PHP but using JS obviously).
>
> I have seen slight comments here and there about a mod-js module for
> apache but cannot find source or executable anywhere (vaporware?). I've
> also read quite a few comments that indicate interest in this. This
> product niche appeals to me and thus I am considering its development
> and would glady welcome others with similar interests.

Take a look at whitebeam perhaps, which indeed is an apache module which
supports server-side javascript using spidermonkey

Other possibilities exist, like for instance I wrote a server js shell
in C on which was built an httpd in javascript, allowing server-side js
for an embedded application... (an older partially complete demo if this
exists at http://chat.pulsar-zone.net, this is still missing signal
handling such as SIGPIPE, though, so not usable for production use, but
if it can only inspire others, it has met its purpose :)

Considering the popularity of rhino, I wouldn't be surprised if there
existed a tomcat module for server-side js scripting or such. I never
checked though, not using java products in our environments here

> Assuming a final MPL'd or LGPL'd product integrated with
> NSPR/JS(SpiderMonkey) running as a module under Apache's httpd -
> - Are there any technical constraints or licensing restrictions
> regarding NSPR and JS that would prevent me from doing this?

For the embedded application above, we made no modifications to
spidermonkey and it consists of the only dependency (apart from a
unix-like OS, NetBSD in our case, built without the GNU utils subtree),
so the application was dynamically linked against it and spidermonkey
library provided with its source, to avoid any such possible problems.

I myself would like to have more information about possible licensing
issues, I find it troubling a bit that spidermonkey is somewhat/partly
tainted by the LGPL (a MIT or BSD license would have been easier to deal
with even with advertizing clause to be included in product
documentation)... Dual licensing for products usually has been the
result of great confusion, especially that the multiple licenses
generally contradict themselves on important respects... Since choosing
to use the code according to LGPL appears to override the conditions of
the MPL (if I properly interpreted the license block in the code
modules), we considered it as LGPL for our application and treated it as
such.

You can use LGPL code for personal and commercial purposes, but you must
also redistribute the source of the library if you made any
modifications, and also open source your application if linking it
statically with it, but can provide your application closed source if
linking it dynamically against the library and leaving the choice to the
user to recompile the library from source directly and use it with the
application. This, of course implies that you'll distribute your
application. Using it commercially on a single server you admin
yourself has no such implications, you're not distributing the
application then (if you make modifications to the LGPL software you are
using, you must redistribute the modified source for it, though).

Of course, changing licensing is not simple, it requires contacting
software authors who contributed to verify if they agree to relicense
their code, another problem by itself. Some people also claim that
licensing under GPL/LGPL helps to raise the popularity of a project

I'm not so sure if those licensing woes belong on this list, but since
we're talking about spidermonkey, it's perhaps still relevant here...

Matt

--
Note: Please only reply on the list, other mail is blocked by default.
Private messages from your address can be allowed by first asking.

Peter Wilson

unread,
Nov 24, 2005, 1:40:56 AM11/24/05
to
Matthew Mondor wrote:
> On Thu, 24 Nov 2005 00:04:17 GMT
> c051n3 <c05...@yahoo.com> wrote:
>
>> After googling for the past few days I'm still uncertain if an
>> implementation exists that would allow a JS scripting environment to be
>> configured and executing within a web server (something along the lines
>> of PHP but using JS obviously).
>>
>> I have seen slight comments here and there about a mod-js module for
>> apache but cannot find source or executable anywhere (vaporware?). I've
>> also read quite a few comments that indicate interest in this. This
>> product niche appeals to me and thus I am considering its development
>> and would glady welcome others with similar interests.
>
> Take a look at whitebeam perhaps, which indeed is an apache module which
> supports server-side javascript using spidermonkey
>
Please do take a look at Whitebeam (http://www.whitebeam.org). The
project has just reached it's 5th birthday (first commercial release
November 2005 - first OS release June 2001)so it's mature and robust
with a number of quite large applications.

Whitebeam is superficially similar to PHP - but with JavaScript - it's
built around an XML model rather than text model though. This lets you do lots
of interesting things like manipulate the HTML DOM on the server to generate
output rather than rely on pure text generation.

There is an article comparing Whitebeam to PHP:
http://www.whitebeam.org/library/guide/overview/phpasp.rhtm

It's written in 'C' and uses the SpiderMonkey engine.

At the moment it's licensed under what is effectively the Mozilla license,
but we are as we speak changing this to a BSD license - I've just got to
get through all the source files and change the license statements :-(.
Almost there!

With the exception of the SpiderMonkey component this means you can
build an entire web-application development environment under a BSD
license:
OpenBSD + Whitebeam + Postgres + Apache

(Note if you really want BSD you have to stick with Apache 1.3.29,
after which the Apache Foundation changed their license).

For the less purists at heart - you can use Linux + Apache 2 + Postgres.

The move to a BSD license is partly an attempt to avoid license uncertainties
that crop up from time to time with PHP/mySQL combination.

Why haven't more people heard about it? Probably because the small team
doing the work are basically techies. We're not good at the getting out there
and promoting it - but it does have some distinct advantages over
PHP - and as a language JavaScript knocks the socks off PHP (IMHO)

Would we appreciate some help in that department as well as everything
else? YES :-)

Want more information - please feel free to get in touch.

Pete
--
The Whitebeam Project (http://www.whitebeam.org) (http://www.yellowhawk.co.uk)
-------

czv

unread,
Nov 24, 2005, 2:15:42 AM11/24/05
to
On Nov 24, 2005, at 2:31 AM, Matthew Mondor wrote:

> Considering the popularity of rhino, I wouldn't be surprised if there
> existed a tomcat module for server-side js scripting or such. I never
> checked though, not using java products in our environments here

There is Helma, which comes with Jetty as built-in http server and can
be deployed through mod_jk/mod_jk2.

http://helma.org/

And there is Rhinola, which uses the mod_gcj Apache module.

http://mod-gcj.sourceforge.net/rhinola.html

Cheers, Chris

ch...@czv.com +41 329 41 41 41
Chris Zumbrunn Ventures - http://www.czv.com/
Internet Application Technology - Reduced to the Maximum

c051n3

unread,
Nov 24, 2005, 2:32:11 AM11/24/05
to
Peter Wilson wrote:

> Please do take a look at Whitebeam (http://www.whitebeam.org). The
> project has just reached it's 5th birthday (first commercial release
> November 2005 - first OS release June 2001)so it's mature and robust
> with a number of quite large applications.
>
> Whitebeam is superficially similar to PHP - but with JavaScript - it's
> built around an XML model rather than text model though. This lets you
> do lots
> of interesting things like manipulate the HTML DOM on the server to
> generate
> output rather than rely on pure text generation.

Yes, that is similar to the approach I would have taken

>
> There is an article comparing Whitebeam to PHP:
> http://www.whitebeam.org/library/guide/overview/phpasp.rhtm
>
> It's written in 'C' and uses the SpiderMonkey engine.

and C++ based on those classes you have sprinkled around in the source ;-)

>
> At the moment it's licensed under what is effectively the Mozilla license,
> but we are as we speak changing this to a BSD license - I've just got to
> get through all the source files and change the license statements :-(.
> Almost there!
>

The whole Redbourne Public License thing was pushing me away from
considering whitebeam. Using the BSD license instead should help
attract devs and garner more public recognition.

[-snip-]

> Why haven't more people heard about it? Probably because the small team
> doing the work are basically techies. We're not good at the getting out
> there
> and promoting it - but it does have some distinct advantages over
> PHP - and as a language JavaScript knocks the socks off PHP (IMHO)

As a professional C/C++ dev with almost 2 decades of coding under my
belt (yes , I'm ancient, I know :-P) I immediately became attached to JS
(despite it's small warts). I can see it has a bigger purpose in life.

>
> Would we appreciate some help in that department as well as everything
> else? YES :-)
>
> Want more information - please feel free to get in touch.
>

I shall.

Peter Wilson

unread,
Nov 24, 2005, 3:00:39 AM11/24/05
to
c051n3 wrote:
> Peter Wilson wrote:
>
>> Please do take a look at Whitebeam (http://www.whitebeam.org). The
>> project has just reached it's 5th birthday (first commercial release
>> November 2005 - first OS release June 2001)so it's mature and robust
>> with a number of quite large applications.

I did of course mean first commercial release in November *2000* - time
flies by!

>>
>> Whitebeam is superficially similar to PHP - but with JavaScript - it's
>> built around an XML model rather than text model though. This lets you
>> do lots
>> of interesting things like manipulate the HTML DOM on the server to
>> generate
>> output rather than rely on pure text generation.
>
> Yes, that is similar to the approach I would have taken

>>
>> There is an article comparing Whitebeam to PHP:
>> http://www.whitebeam.org/library/guide/overview/phpasp.rhtm
>>
>> It's written in 'C' and uses the SpiderMonkey engine.
>
> and C++ based on those classes you have sprinkled around in the source ;-)

Yep - quite mainly C++ :-)

>
>>
>> At the moment it's licensed under what is effectively the Mozilla
>> license,
>> but we are as we speak changing this to a BSD license - I've just got to
>> get through all the source files and change the license statements :-(.
>> Almost there!
>>
>
> The whole Redbourne Public License thing was pushing me away from
> considering whitebeam. Using the BSD license instead should help
> attract devs and garner more public recognition.
>

My thoughts as well - it's just taken a little time to get all the
contributing organisations to agree to the BSD change.

Hoping to get the change in the next few days so it's in the
anniversary month (November) - but the reality of paying the
mortgage keep getting in the way.

> [-snip-]
>
>> Why haven't more people heard about it? Probably because the small team
>> doing the work are basically techies. We're not good at the getting
>> out there
>> and promoting it - but it does have some distinct advantages over
>> PHP - and as a language JavaScript knocks the socks off PHP (IMHO)
>
> As a professional C/C++ dev with almost 2 decades of coding under my
> belt (yes , I'm ancient, I know :-P) I immediately became attached to JS
> (despite it's small warts). I can see it has a bigger purpose in life.

Ancient here as well having spent a similar two decades using C/C++
in a wide variety of environments before the move to 'web'
in 2000. That's probably why I find PHP syntax to be so cumbersome
and JavaScript to be so elegant ($ in variable names just take
me back to school years and BASIC!)

>
>>
>> Would we appreciate some help in that department as well as everything
>> else? YES :-)
>>
>> Want more information - please feel free to get in touch.
>>
>
> I shall.

Thank you!
Pete

c051n3

unread,
Nov 24, 2005, 3:21:26 AM11/24/05
to
czv wrote:

> On Nov 24, 2005, at 2:31 AM, Matthew Mondor wrote:
>
>
>>Considering the popularity of rhino, I wouldn't be surprised if there
>>existed a tomcat module for server-side js scripting or such. I never
>>checked though, not using java products in our environments here

I checked, and couldn't find. Actually, I would be surprised if I did
find a scripter as Tomcat's raison d'etre is to Java-enable Apache.
With the dizzying array of Java products pumped out of Apache I
eventually see an Apache JVM(i.e. harmony) running an Apache Java http
server using Apache built Java tools and sdks. Apache wants to own the
OS Java space and, if past performance is indicative of future success,
my money's on them. ;-)

>
>
> There is Helma, which comes with Jetty as built-in http server and can
> be deployed through mod_jk/mod_jk2.
>
> http://helma.org/
>
> And there is Rhinola, which uses the mod_gcj Apache module.
>

Yes, I did research those two projects. However, (I should have perhaps
narrowed the scope of my initial request, my apologies) I was aiming for
a more non-java/jvm/classpath approach. The reason being is I want to
enable all those JS scripters to develop server code by simply
continuing to code in what they know using the language, tools, and
environments they are already familiar with, without being burdened by
the complexities of additional software requirements. Try porting gnu
gcj/classpath to Windows for those JS coders who develop and test from
their home PC and you'll understand my reasoning. I envision the end
user of the product as either not a fulltime software engineer - or - an
engineer that needs to accomplish something fast without contemplating
class hierarchy or an intricate sdk (something I hope JavaScript does
not become).

Rob Swindell

unread,
Nov 29, 2005, 5:00:13 PM11/29/05
to
To: Peter Wilson
Re: Re: javascript on server?
By: Peter Wilson to netscape.public.mozilla.jseng on Thu Nov 24 2005 06:40 am

> Matthew Mondor wrote:
> > On Thu, 24 Nov 2005 00:04:17 GMT
> > c051n3 <c05...@yahoo.com> wrote:
> >
> >> After googling for the past few days I'm still uncertain if an
> >> implementation exists that would allow a JS scripting environment to be
> >> configured and executing within a web server (something along the lines
> >> of PHP but using JS obviously).
> >>
> >> I have seen slight comments here and there about a mod-js module for
> >> apache but cannot find source or executable anywhere (vaporware?). I've
> >> also read quite a few comments that indicate interest in this. This
> >> product niche appeals to me and thus I am considering its development
> >> and would glady welcome others with similar interests.
> >
> > Take a look at whitebeam perhaps, which indeed is an apache module which
> > supports server-side javascript using spidermonkey
> >
> Please do take a look at Whitebeam (http://www.whitebeam.org). The
> project has just reached it's 5th birthday (first commercial release
> November 2005 - first OS release June 2001)so it's mature and robust
> with a number of quite large applications.
>
> Whitebeam is superficially similar to PHP - but with JavaScript - it's
> built around an XML model rather than text model though. This lets you do lo

> of interesting things like manipulate the HTML DOM on the server to generate
> output rather than rely on pure text generation.
>
> There is an article comparing Whitebeam to PHP:
> http://www.whitebeam.org/library/guide/overview/phpasp.rhtm

The right-most portion of that document is truncated (missing), at least, when
viewed in IE.

digital man

Snapple "Real Fact" #20:
Broccoli is the only vegetable that is also a flower.
--- Synchronet 3.13b-Win32 NewsLink 1.83
* Vertrauen - Anaheim Hills, California - telnet://vert.synchro.net

Mike Moening

unread,
Jan 3, 2006, 9:51:10 AM1/3/06
to
I'm very close to completing a project that is quite similar to what you
have described.
We originally started out writing a web based (AJAX like) javascript
debugger that you can attach to any spidermonkey context. That naturally
let to the need for a web server to serve up the debugger IDE. Well of
course now we've got a full blown JSP/ASP like web server with spidermonkey
at the heart of it. We maintain a pool of compiled server side scripts and
JSContexts. The way it is built you can either use the web server stand
alone or the Javascript debugger or both. The web server is multi-threaded
of course, as is the Javascript debugger. We can debug the server side
Javascript remotely, which is really nice.

You are a few months ahead of our release schedule but I would hate to see
sombody else go through this much work again.
Oh.yeah...Its written in C++.

Let me know if you are interested.

Sorry for the double post. I replied to the wrong message initially. :-(

"c051n3" <c05...@yahoo.com> wrote in message
news:5s7hf.7911$MW6.2920@trndny08...

Mike Moening

unread,
Jan 3, 2006, 9:48:29 AM1/3/06
to
I'm very close to completing a project that is quite similar to what you
have described.
We originally started out writing a web based (AJAX like) javascript
debugger that you can attach to any spidermonkey context. That naturally
let to the need for a web server to serve up the debugger IDE. Well of
course now we've got a full blown JSP/ASP like web server with spidermonkey
at the heart of it. We maintain a pool of compiled server side scripts and
JSContexts. The way it is built you can either use the web server stand
alone or the Javascript debugger or both. The web server is multi-threaded
of course, as is the Javascript debugger. We can debug the server side
Javascript remotely, which is really nice.

You are a few months ahead of our release schedule but I would hate to see
sombody else go through this much work again.
Oh.yeah...Its written in C++.

Let me know if you are interested.

"c051n3" <c05...@yahoo.com> wrote in message
news:5s7hf.7911$MW6.2920@trndny08...

Peter Wilson

unread,
Jan 3, 2006, 4:03:35 PM1/3/06
to
Whitebeam is similar (http://www.whitebeam.org). Uses SpiderMonkey in an
Apache module to provided a 'PHP' but with a few differences:
1. Well - it's JavaScript for a start
2. Server side DOM allowing manipulation of the XML tree on the
server.
3. Designed for scalability to 'n' servers with load-balancers.
4. For those that want it a set of 'templates' that abstract the
database. For those that don't, raw access to Postgres.
5. Open license (BSD) (change to BSD is very recent - all code
checked in just haven't made the announcement and update the
web-site)
6. All code available from CVS on sourceforge
(http://www.sourceforge.net/projects/whitebeam)

Written in 'C/C++'.

Mature - Just coming up to it's 6th birthday - 5 years since the first
commercial release before we open-sourced it.

One thing we don't have - which sounds interesting - is the ability to
use something like Venkman to debug server-side scripts.

If anyone is interested then let me know.

Pete
--
www.whitebeam.org
www.yellowhawk.co.uk
---------

Jon Brisbin wrote:
> I would be very interested in learning abou this product...
>
> Thanks!
>
> Jon Brisbin
> Webmaster
> NPC International, Inc.

>> _______________________________________________
>> mozilla-jseng mailing list
>> mozill...@mozilla.org
>> http://mail.mozilla.org/listinfo/mozilla-jseng
>>
>>
>>

0 new messages