Reputation: 6745
I have asp.net application which and just be substituted with the default MVC 6 project for the purposes of this post. I am trying to decide whether or not to deploy it to my linux Debian 8.2 Jessie Server (Preferred) or an Windows Server 2008 R2 IIS 7.
As far is Linux is concerned I have followed the following sites for instructions and I am confused on how and where to deploy the site files.
How to Install ASP.Net 5 on Ubuntu Linux
Also I'm not sure if i am suppose to be using Kestrel or Mono. Then i hear Docker is being tossed around as well. I just need to know the best way (not necessarily the easiest way) to host an MVC 6 application on linux.
As far is IIS 7 goes i have followed the video instructions Here ASP.NET5 MVC Deployment to IIS Web Server yet i get the following error when i try to view the site:
HTTP Error 403.14 - Forbidden The Web server is configured to not list the contents of this directory. Most likely cause:A default document is not configured for the requested URL, and directory browsing is not enabled on the server.
Please help me out or point me in the right direction for me to resolve this.
***** Edit *****
Okay I have been determined to get this working correctly. Since i have first asked the question i have progressed in a few areas.
Fist i have dnx, dnu, dnvm install properly. I am able to run a dnu restore to get all of my dependencies in. I have nginx installe which directs the incoming requests to the 127.0.0.1:5000 which i had set in my project.json file
project.json:
"commands": {
"web": "Microsoft.AspNet.Server.Kestrel --server Kestrel --server.urls http://localhost:5000",
"ef": "EntityFramework.Commands"
},
nginx:
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /usr/share/nginx/html;
index index.html index.htm;
# Make site accessible from http://localhost/
server_name aspnet.dev www.aspnet.dev;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:5004;
}
}
I then navigate to the root folder and dnx web which brings up the following:
Hosting environment: Production Now listening on: http://localhost:5000 Application started. Press Ctrl+C to shut down.
now since nginx is directing the request to the asp project with
proxy_pass http://127.0.0.1:5004
i can see some request being handled.
info: Microsoft.AspNet.Hosting.Internal.HostingEngine[1]
Request starting HTTP/1.0 GET http://***.**.**.***/
info: Microsoft.AspNet.Mvc.Controllers.ControllerActionInvoker[1]
Executing action method AspNet5.Controllers.HomeController.Index with arguments () - ModelState is Valid'
info: Microsoft.AspNet.Mvc.ViewFeatures.ViewResultExecutor[1]
Executing ViewResult, running view at path /Views/Home/Index.cshtml.
info: Microsoft.AspNet.Mvc.Infrastructure.MvcRouteHandler[2]
Executed action AspNet5.Controllers.HomeController.Index in 0.1468ms
info: Microsoft.AspNet.Hosting.Internal.HostingEngine[2]
Request finished in 0.1849ms 200 text/html; charset=utf-8
But yet it doesn't server any html to the browser. Any suggestions?
Upvotes: 3
Views: 3184
Reputation: 6745
If anyone is intersted in how I just corrected my issue see this post: Hiccups with Hosting ASP .NET 5 apps on Linux (RC1)
Upvotes: 1