RejectedSoftware Forums

Sign up

Virtual host.

Hi

I have some virtual host questions.

How does one run more than one virtual host with vibe ??

I have noticed vibedist but the README is very short and the is no examples.

Also is it possible to run a vibe virtual host alongside a apache
virtual host, if it is then how ??

Thanks, for vibe and hope you can help.
Knud

Re: Virtual host.

Am 23.08.2012 22:09, schrieb Knud Sørensen:

Hi

I have some virtual host questions.

How does one run more than one virtual host with vibe ??

I have noticed vibedist but the README is very short and the is no examples.

Also is it possible to run a vibe virtual host alongside a apache
virtual host, if it is then how ??

Thanks, for vibe and hope you can help.
Knud

Basic virtual hosts are done by simple calling listenHttp() multiple
times with different values for HttpServerSettings.hostName and the same
port.

For running an apache vhost alongside a vibe vhost I would recommend to
use nginx and configure the vhosts there to forward using a reverse
proxy. Last time I checked, Apache didn't support HTTP/1.1 for its proxy
module which would be necessary to let Apache do that directly.

Alternatively, it is also possible put the vibe.d server in front of
Apache by calling listenHttpReverseProxy() with Apache as the
destination and Apache's vhost name in the HttpServerSettings.hostName
field. I still get a sporadic exception that causes the proxy to quit
though - and still waiting for it to be able to track it down. So for
robustness reasons either a watchdog script or the nginx way would
probably be in order.

vibedist still needs some finishing touches to be really useful but I
got stuck when I was somehow forced to start making my own std.process
replacement and then heard that there was a new one in the works
anyways. However, When that part is finished, it will provide a web
frontend and a watchdog to manage and monitor the individual virtual
hosts as separate processes. It will then also get some proper
documentation.

Regards,
Sönke

Re: Virtual host.

Am 25.08.2012 09:08, schrieb Sönke Ludwig:

field. I still get a sporadic exception that causes the proxy to quit
though - and still waiting for it to be able to track it down. So for
robustness reasons either a watchdog script or the nginx way would
probably be in order.

That should be fixed now on master - I got it trapped in the debugger
over night.

Re: Virtual host.

On 2012-08-23 22:09, Knud Sørensen wrote:

Hi

I have some virtual host questions.

How does one run more than one virtual host with vibe ??

I have noticed vibedist but the README is very short and the is no examples.

Also is it possible to run a vibe virtual host alongside a apache
virtual host, if it is then how ??

Thanks, for vibe and hope you can help.
Knud

I just did it like this:

<VirtualHost *:80>

ServerName gtk.d
ProxyRequests On
ProxyPreserveHost On
ProxyVia full
<Proxy *:80>
    Order deny,allow
    Allow from all
</Proxy>

ProxyPass / http://127.0.0.1:4833/
ProxyPassReverse / http://127.0.0.1:4833/

</VirtualHost>

then
a2enmod proxy
a2enmod proxy_http
a2ensite gtkd
service apache2 restart

And it seems to work.

Maybe an virtual host example should be included with vibe.

Knud

Re: Virtual host.

Am 31.08.2012 23:37, schrieb Knud Sørensen:

I just did it like this:

<VirtualHost *:80>

ServerName gtk.d
ProxyRequests On
ProxyPreserveHost On
ProxyVia full
<Proxy *:80>
    Order deny,allow
    Allow from all
</Proxy>

ProxyPass / http://127.0.0.1:4833/
ProxyPassReverse / http://127.0.0.1:4833/

</VirtualHost>

then
a2enmod proxy
a2enmod proxy_http
a2ensite gtkd
service apache2 restart

And it seems to work.

Maybe an virtual host example should be included with vibe.

Knud

Hmm... it turns out it was a long time ago that I've looked at Apache's
mod_proxy. It seems to support HTTP/1.1 beginning with version 1.3...

I agree that a page for this in the documentation is appropriate - then
also including the equivalent nginx setup. A wiki (probably the github
one) also seems like a good place for such things. I'll keep this in mind.