A web server with D

Robert Clipsham robert at octarineparrot.com
Sun Jun 20 05:14:12 PDT 2010


On 20/06/10 12:54, Mengu wrote:
> Hi,
>
> I have been interested in and learning D for a while and currently developing
> a web development IDE with it. I can say that I have a middle level knowledge
> that I have been trying to increase. Anyway. I want to develop a web server
> for Python and Ruby web applications some months later from now,
> after completing the IDE. But until then I want all my research to be
> completed and I have enough knowledge that I need to develop this web server,
> in addition to D and within D.
>
> So, my two questions are these:
>
>    1) What do I need to know in order to develop a web server, generally?

A good starting point would be taking a look at current web servers and 
seeing what they do well etc. Apache httpd is the most widely used one 
which would be a good starting point, particularly feature wise, but 
it's also worth taking a look at others such as lighttpd, nginx and 
cherokee. Note that the main selling points for the latter are speed 
rather than functionality (although I believe this is changing).

 From doing quite a bit of server sided development myself I'd also 
recommend reading the HTTP RFC[1] thoroughly, a good few times and 
making sure you understand it completely. Understand its downfalls and 
intricacies, places where you could encounter issues, make sure you've 
thought about how you're gonna get around them before you start. A lot 
of web servers have already got them covered, so again taking a look at 
them would be a good starting point.

It would also be worth taking a look at best practices server-wise. I 
can't think of any off the top of my head, I know there are some things 
which are better done one way than another - you should take a look at 
these before you start too.

As an afterthought, it could be a good idea to take a look at security 
issues that have been reported for other httpd's, and making sure such 
vulnerabilities don't exist in your server in the first place! There 
will be some that are very httpd specific, I have no doubt there will be 
others that crop up from time to time relating to similar parts of the 
httpd.

>    2) What do I need to know within D to make this good enough?

Why settle with good enough when you can settle for great? I don't think 
there's anything you specifically need to know within D for making a 
webserver, but you should make sure you know your way around the 
concurrency/threading code and also the sockets interface so you can 
make good use of them. Concurrency support continues to evolve in D, so 
it'd be worth keeping an eye on.

> Thanks everyone in advance.

Thanks,

Robert

[1] http://www.w3.org/Protocols/rfc2616/rfc2616.html - yes, I know it's 
a bit of a monster read, if you're gonna do this you need to do it 
properly though :)


More information about the Digitalmars-d mailing list