RejectedSoftware Forums

Sign up

run multiple web apps in the same computer

How can one run two or more Vibe.d web apps in the same computer?

Can some ports be used other than 8080? If not, how can one run multiple web apps on the same computer with a single IP address?

When I try other ports on my local machine, I get:

Failed to listen on 127.0.0.1:80
or
Failed to listen on 127.0.0.1:81
or
Failed to listen on 127.0.0.1:8008

The reason for this is I want to host three web apps in a single Linode box.

Re: run multiple web apps in the same computer

On 2017-06-26 05:14, Rey Valeza wrote:

How can one run two or more Vibe.d web apps in the same computer?

Can some ports be used other than 8080? If not, how can one run multiple web apps on the same computer with a single IP address?

You can use HTTPServerSettings.port to set the port to listen on [1].
You can see some examples of how this is used in the documentation, here
[2] and here [3].

When I try other ports on my local machine, I get:

Failed to listen on 127.0.0.1:80
or
Failed to listen on 127.0.0.1:81
or
Failed to listen on 127.0.0.1:8008

Note that any port below 1024 usually requires root/administrator access
to listen on. That is, you need to use sudo when starting the server.

[1] http://vibed.org/api/vibe.http.server/HTTPServerSettings.port
[2] http://vibed.org/docs#web-interface-generator
[3] http://vibed.org/docs#rest-interface-generator

/Jacob Carlborg

Re: run multiple web apps in the same computer

And if you want to make them all available on port 80 using different DNS names that point to the same IP address, you could use Nginx or Apache to configure multiple virtual hosts. For example, for Nginx you would simply define multiple servers like this. Each one would then have a different server_name and a different port in proxy_pass.

Re: run multiple web apps in the same computer

On Mon, 26 Jun 2017 18:50:33 GMT, Sönke Ludwig wrote:

And if you want to make them all available on port 80 using different DNS names that point to the same IP address, you could use Nginx or Apache to configure multiple virtual hosts. For example, for Nginx you would simply define multiple servers like this. Each one would then have a different server_name and a different port in proxy_pass.

Thanks Sönke and Jacob!