Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

vNext on Apache webserver

I've been fiddling around with vNext a bit and got the sample projects running. I created an Ubuntu VM, installed the required packages and got it all running with k run (console app) and k kestrel (MVC app).

Now, onto the next step: running several projects on a dedicated webserver. Kestrel is (at least for now) just a simple development webserver used for vNext. Chances it will develop into a full-blown webserver seem small.

Thus, I would like to get the thing running on Apache. I guess mod-mono would come into play somewhere. However, at the moment I don't think it supports the latest vNext framework yet. On the other hand, I guess we'll need the KRE somewhere.

Any news out there that we'll be running ASP.NET projects on Apache anytime soon? Anyone managed to do it?

I'm greatly fascinated by the idea of cross platform .NET applications. My current employer is investing a great deal in projects using cross-platform and open-source software. I'd like to gain some knowlegde in advance and try to lead the way in migrating completely to Linux web servers instead of Windows servers.

Thanks!

like image 432
Nullius Avatar asked Feb 20 '15 14:02

Nullius


People also ask

What is Apache vhosts?

Apache was one of the first servers to support IP-based virtual hosts right out of the box. Versions 1.1 and later of Apache support both IP-based and name-based virtual hosts (vhosts). The latter variant of virtual hosts is sometimes also called host-based or non-IP virtual hosts.

What is Apache web server?

This time it's all about the Apache web server, a piece of software that's been around for decades, happily serving up small and large websites without fail. Apache works seamlessly with MySQL, PHP, and a host of other packages, so you can serve up simple static or incredibly dynamic websites. How do you install and configure the server?

Which virtual hosts are supported by Apache?

Versions 1.1 and later of Apache support both IP-based and name-based virtual hosts (vhosts). The latter variant of virtual hosts is sometimes also called host-based or non-IP virtual hosts.

How do I verify that Apache is running on my VM?

Verify that Apache is running: Test that your VM is serving traffic on its external IP. In the Cloud Console, go to the VM Instances page. Copy the external IP for your VM under the External IP column.


1 Answers

I'm happy to see there are plenty of us trying to get vnext up and running outside Windows environment:)

Of course you are right about kestrel. It will probably end up as a simple web server just like it works right now in the node.js Hello World tutorial. You can try to use it as a production environment by running it in the background Running K Kestrel in the background on a webserver and then pass requests to kestrel by Apache Proxy

VirtualHost example proxying requests to kestrel started on *:5004

<VirtualHost *:80>
ServerName example.com:80

ProxyRequests On

<Proxy *>
Order deny,allow
Allow from all
</Proxy>

ProxyPreserveHost Off

ProxyPass / http://localhost:5004
ProxyPassReverse / http://localhost:5004

</VirtualHost>

But I do not recommend above solution. There are some issue with kestrel that prevents you to send an output outside tty and therefore you can't run it at startup with a startup script. So the website you've started will last as long as your server stays online :)

What I do recommend is to use Docker. It's kind of a wrapper for ASP.NET that is being supported by Microsoft. You could make a better use of that in this stage.

Here's more info

http://blogs.msdn.com/b/webdev/archive/2015/01/14/running-asp-net-5-applications-in-linux-containers-with-docker.aspx

like image 159
Niewiadomski Paweł Avatar answered Sep 20 '22 04:09

Niewiadomski Paweł