RejectedSoftware Forums

Sign up

Beginning development using Vibe.d

Hello!

The site does have a quite nice getting started guide/tutorial and API documentation, I fail to find information I need on the internet however.
As mentioned above I would like to use Vibe.d for my web applications (It offers an http server). I need help figuring out a few things, I would be grateful for any help with these.
(Whenever I mention Vibe.d I mean my application using Vibe.d of course)
First I need to know how to get vibe running as my web server so when someone visits apott.net (my website) vibe.d responds to the request. I have disabled Apache2 and such but as far as I know Vibe.d doesn't have permission to listen on port 80, which is why it listens on 8080. Of the little information I have been able to find on this subject it appears I have to setup something called a reverse proxy with nginx? This I know absolutely nothing about as I have absolutely no experience with nginx, help with this or at least pointing me in the right direction would be fantastic.

As I mentioned above I need to have the ability to run two websites/applications on my server (which I have dubbed big bertha if you would like to know xD). I would like to do this with vibe for both applications, pointing me in the right direction with this would also help greatly.

Thanks a lot for any pointers, help, or suggestions!

Re: Beginning development using Vibe.d

Perhaps the title wasn't as descriptive as it should have been... Sorry about that.
Any help though?

Re: Beginning development using Vibe.d

On Thu, 09 Jan 2014 23:39:11 GMT, APott wrote:

First I need to know how to get vibe running as my web server so when someone visits apott.net (my website) vibe.d responds to the request.

I have written small introductional article on topic of setting up basic application last year:

http://dicebot-old.blogspot.de/2013/07/setting-up-simple-vibed-application.html - environment
http://dicebot-old.blogspot.de/2013/07/setting-up-simple-vibed-application-app.html - application

May be outdated in some places but shoud be still useful on most part.

as far as I know Vibe.d doesn't have permission to listen on port 80, which is why it listens on 8080.

This is not true. You can run it on any port including 80 and vibe.d is perfectly capable of doing so. It is however recommended to put it behing reverse proxy for security / configurability reasons as vibe.d own HTTP server while being very fast is not that robust feature-wise.

... setup something called a reverse proxy with nginx? This I know absolutely nothing about as I have absolutely no experience with nginx, help with this or at least pointing me in the right direction would be fantastic.

First of my linked articles provides example of nginx configuration that can be used with vibe.d

nginx is a bit similar to Apache you are familiar with never acts as application server (like mod_php) - it simply forwards requests to another HTTP server or CGI/FastCGI process. nginx is also much faster than Apache by design. Definitely worth getting familiar with if you are going to do any serious web development.

As I mentioned above I need to have the ability to run two websites/applications on my server (which I have dubbed big bertha if you would like to know xD). I would like to do this with vibe for both applications, pointing me in the right direction with this would also help greatly.

If those are completely independent I'd recommend compiling those as two different applications binding to different ports and then use nginx to route matching domains to these ports. If you will be still no sure how to do it after reading linked stuff, please repeat your request and I will provide small sample.

Re: Beginning development using Vibe.d

On Fri, 10 Jan 2014 10:48:30 GMT, Dicebot wrote:

On Thu, 09 Jan 2014 23:39:11 GMT, APott wrote:

First I need to know how to get vibe running as my web server so when someone visits apott.net (my website) vibe.d responds to the request.

I have written small introductional article on topic of setting up basic application last year:

http://dicebot-old.blogspot.de/2013/07/setting-up-simple-vibed-application.html - environment
http://dicebot-old.blogspot.de/2013/07/setting-up-simple-vibed-application-app.html - application

BTW, I find those posts great - especially considering the amount of "tutorial" material there is. Once I saw the "Blog deleted" message on one of my bookmarks I nearly had a stroke =) It was a relief to find those with "-old" suffix, but still, why did you archive the blog in the first place? =)

Re: Beginning development using Vibe.d

On Fri, 10 Jan 2014 11:17:03 GMT, Sergei Nosov wrote:

On Fri, 10 Jan 2014 10:48:30 GMT, Dicebot wrote:

On Thu, 09 Jan 2014 23:39:11 GMT, APott wrote:

First I need to know how to get vibe running as my web server so when someone visits apott.net (my website) vibe.d responds to the request.

I have written small introductional article on topic of setting up basic application last year:

http://dicebot-old.blogspot.de/2013/07/setting-up-simple-vibed-application.html - environment
http://dicebot-old.blogspot.de/2013/07/setting-up-simple-vibed-application-app.html - application

BTW, I find those posts great - especially considering the amount of "tutorial" material there is. Once I saw the "Blog deleted" message on one of my bookmarks I nearly had a stroke =) It was a relief to find those with "-old" suffix, but still, why did you archive the blog in the first place? =)

I have deleted my Google account and forgot those blogs where attached to it. Luckily, there was a full backup of all data made before deletion so I was able to put it back once have noticed it.
Probably it will be moved to own domain at some point but right now I have neither time nor real desire to do any blogging so it is just preserved as-is.

Re: Beginning development using Vibe.d

On Fri, 10 Jan 2014 11:46:00 GMT, Dicebot wrote:

On Fri, 10 Jan 2014 11:17:03 GMT, Sergei Nosov wrote:

On Fri, 10 Jan 2014 10:48:30 GMT, Dicebot wrote:

On Thu, 09 Jan 2014 23:39:11 GMT, APott wrote:

First I need to know how to get vibe running as my web server so when someone visits apott.net (my website) vibe.d responds to the request.

I have written small introductional article on topic of setting up basic application last year:

http://dicebot-old.blogspot.de/2013/07/setting-up-simple-vibed-application.html - environment
http://dicebot-old.blogspot.de/2013/07/setting-up-simple-vibed-application-app.html - application

BTW, I find those posts great - especially considering the amount of "tutorial" material there is. Once I saw the "Blog deleted" message on one of my bookmarks I nearly had a stroke =) It was a relief to find those with "-old" suffix, but still, why did you archive the blog in the first place? =)

I have deleted my Google account and forgot those blogs where attached to it. Luckily, there was a full backup of all data made before deletion so I was able to put it back once have noticed it.
Probably it will be moved to own domain at some point but right now I have neither time nor real desire to do any blogging so it is just preserved as-is.

Ok, thx, I was just curious. And double thx for the posts themselves!

Re: Beginning development using Vibe.d

Thank you for the reply! I am not home at the moment but when I am I will definitely take a look and get started! Thanks for the help and I'm sure this will get me on track.

Re: Beginning development using Vibe.d

That works great!Whats your suggested way to serve static files (css, js, images etc...) with nginx on a subdomain? (static.apott.net for example)
Also, what's the best way to correctly stop the vibe.d http server? If you ctrl-z (obviously not a good way to stop a program) it turns into a zombie process clogging up the port it's listening on, making it necessary to manually clear it out. This is an issue when debugging since I don't know how to properly do this while rebuilding etc...
Thanks for any help!

Re: Beginning development using Vibe.d

On Sat, 11 Jan 2014 00:57:30 GMT, APott wrote:

Whats your suggested way to serve static files (css, js, images etc...) with nginx on a subdomain? (static.apott.net for example)

Based on snippet in linked article:

    server
    {
        listen                80 default_server;
        server_name           example.com;

        location /
        {
            proxy_pass        http://localhost:8080;
            proxy_set_header  X-Real-IP  $remote_addr;
            proxy_set_header  Host $host;
        }
    }

    server
    {
        listen                80;
        server_name           static.example.com;

        location /
        {
            root              /home/http/static/;
            index             index.html;
            expires           1d;
        }
    }

Also, what's the best way to correctly stop the vibe.d http server? If you ctrl-z (obviously not a good way to stop a program) it turns into a zombie process clogging up the port it's listening on, making it necessary to manually clear it out. This is an issue when debugging since I don't know how to properly do this while rebuilding etc...

Ctrl+C is default way to stop any linux program. You can also send interrupt singal from shell: "kill -2 `pidof mybinaryname`". "kill -9" (SIGKILL) to kill it in a harder way instead.

Re: Beginning development using Vibe.d

Fantastic!