www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Apache HTTPD server module in D (linux)

reply Justin Johansson <procode adam-dott-com.au> writes:
Seeing this topic discussed here before but unable to ascertain a definitive
answer on the issue, please forgive me for asking again.

Is there any technical reason (e.g. position dependent code) why DMD 1.0 +
Phobos cannot be used to build an Apache HTTPD server module as a linux shared
object (.so)?  I've tried linking some D + C code together (the C code already
being working apache module) and have encountered unresolved symbol issues
(which undoubtedly is no surprise).

There was some previous report that gcd would cut it, but for this project I
need to stick with DMD or my D project will be hosed.  I dread the thought of
going back to Tomcat + Java.

Now I've read how to build a Windows DLL with D and well understand the GC
mechanics.  If its just a matter of hacking the runtime (CRT) startup code I'm
prepared to get my hands dirty but need some hints to get there.

Alternative perhaps is to link the D module statically into the Apache core but
this doesn't fit well having to distribute a custom build of Apache server.

Any hints or help on this mercy assignment would be much appreciated.

Again my apologies if this topic has been definitively dealt with before on
this forum.

Thanks.
Sep 09 2009
next sibling parent Justin Johansson <procode adam-dott-com.au> writes:
Sorry all.  Just realized that this question belongs in D.learn.
Sep 09 2009
prev sibling next sibling parent reply Alan Knowles <alan akbkhome.com> writes:
Have a look at fastcgi -
http://www.akbkhome.com/svn/rooscript/src/fcgi.d
http://www.akbkhome.com/svn/rooscript/src/fastcgi/

Ignore the licence in fcgi.d - that only relates to dmdscript related 
code - the fastcgi implementation is BSD style (with no restrictions)

Regards
Alan

Justin Johansson wrote:
 Seeing this topic discussed here before but unable to ascertain a
 definitive answer on the issue, please forgive me for asking again.
 
 Is there any technical reason (e.g. position dependent code) why DMD
 1.0 + Phobos cannot be used to build an Apache HTTPD server module as
 a linux shared object (.so)?  I've tried linking some D + C code
 together (the C code already being working apache module) and have
 encountered unresolved symbol issues (which undoubtedly is no
 surprise).
 
 There was some previous report that gcd would cut it, but for this
 project I need to stick with DMD or my D project will be hosed.  I
 dread the thought of going back to Tomcat + Java.
 
 Now I've read how to build a Windows DLL with D and well understand
 the GC mechanics.  If its just a matter of hacking the runtime (CRT)
 startup code I'm prepared to get my hands dirty but need some hints
 to get there.
 
 Alternative perhaps is to link the D module statically into the
 Apache core but this doesn't fit well having to distribute a custom
 build of Apache server.
 
 Any hints or help on this mercy assignment would be much appreciated.
 
 
 Again my apologies if this topic has been definitively dealt with
 before on this forum.
 
 Thanks.
 
Sep 10 2009
parent Justin Johansson <procode adam-dott-com.au> writes:
Thanks for the suggestion Alan.
That approach had not occurred to me and looks quite workable.
Cheers
Justin

Alan Knowles Wrote:

 Have a look at fastcgi -
 http://www.akbkhome.com/svn/rooscript/src/fcgi.d
 http://www.akbkhome.com/svn/rooscript/src/fastcgi/
 
 Ignore the licence in fcgi.d - that only relates to dmdscript related 
 code - the fastcgi implementation is BSD style (with no restrictions)
 
 Regards
 Alan
Sep 11 2009
prev sibling parent Tim M <tim.matthews7 gmail.com> writes:
Justin Johansson Wrote:

 Seeing this topic discussed here before but unable to ascertain a definitive
answer on the issue, please forgive me for asking again.
 
 Is there any technical reason (e.g. position dependent code) why DMD 1.0 +
Phobos cannot be used to build an Apache HTTPD server module as a linux shared
object (.so)?  I've tried linking some D + C code together (the C code already
being working apache module) and have encountered unresolved symbol issues
(which undoubtedly is no surprise).
 
 There was some previous report that gcd would cut it, but for this project I
need to stick with DMD or my D project will be hosed.  I dread the thought of
going back to Tomcat + Java.
 
 Now I've read how to build a Windows DLL with D and well understand the GC
mechanics.  If its just a matter of hacking the runtime (CRT) startup code I'm
prepared to get my hands dirty but need some hints to get there.
 
 Alternative perhaps is to link the D module statically into the Apache core
but this doesn't fit well having to distribute a custom build of Apache server.
 
 Any hints or help on this mercy assignment would be much appreciated.
 
 Again my apologies if this topic has been definitively dealt with before on
this forum.
 
 Thanks.
 
Is this the sort of thing you are looking for? http://www.britseyeview.com/dcat/
Sep 11 2009