On Thu, 22 Sep 2016 17:41:26 GMT, Uiy Uiy wrote:

I am having some trouble with the virtual hosts but I think I just have to play around with it.

What I really would like to do is be able to create n independent websites(each one is restricted to it's own "space") and serve them off the same ip but also allow for common functionality to be served between them, such as common templates, etc.

e.g.,

public
source
views
data
images
css
Site1.com
   public
   source
   views
   data
   images
   css
Site2.com
   public
   source
   views
   data
   images
   css
...

Then when Site1.com is accessed, all the files are served from it's subdirectory. It would be nice if some common templates, icons, etc can be stored in the root to be used by all the sites but otherwise secure(no way for someone to access site2's files from site1.

I see no way to set a path for each server or really accomplish this effectively with one vibe.d process. Any ideas?

You can call serveStaticFiles multiple times, as needed:

{ // setup host 1
  auto settings = new HTTPServerSettings;
  settings.hostName = "foo.example.org";

  auto router = new URLRouter;
  router.serveStaticFiles("/public");
  router.serveStaticFiles("/site1/public");

  listenHTTP(settings, router);
}

{ // setup host 2
  auto settings = new HTTPServerSettings;
  settings.hostName = "bar.example.org";

  auto router = new URLRouter;
  router.serveStaticFiles("/public");
  router.serveStaticFiles("/site2/public");

  listenHTTP(settings, router);
}

The two virtual hosts are logically completely distinct, except that both serve the "public" folder of the root directory.

I got this error from your site:

500 - Internal Server Error
(...)

This appears to be issue #25. It has been lying around for quite a wile now, but I'll have to prioritize this some day, as someone regularly hits this.