Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I publish a blazor client/server app to a linux web server? Don't have access to ssh and dotnet publish doesn't give an index.html

I've built a blazor app that has no issues at the moment. When I call "dotnet publish -c Release" I get a published project, except the output is an executable file that ubuntu picks up as an octet-stream or something along the lines. If I run it, it just opens the server on localhost:5000. Copying this to my web server through cpanel did nothing -- even trying to test out a generic blazor Wasm app and publishing it gave me an index.html, but it would never actually load anything when I uploaded it to my web server. How can I get dotnet to publish this with an index.html file? All I get is the js and css folders and the executable file on the outer "wwwroot" folder.

(P.S. I'm using webhostingpad.com with shared hosting, so I don't have access to ssh to do things like installing nginx or a parallel route through IIS or Azure or something)

like image 503
Daniel S. Avatar asked Aug 31 '20 20:08

Daniel S.


1 Answers

Blazor WebAssembly:

https://docs.microsoft.com/en-us/aspnet/core/blazor/host-and-deploy/webassembly?view=aspnetcore-3.1#standalone-deployment

  • scroll down to "Apache"

Blazor server:

https://docs.microsoft.com/en-us/aspnet/core/blazor/host-and-deploy/server?view=aspnetcore-3.1#linux-with-apache

like image 54
Jinjinov Avatar answered Oct 07 '22 16:10

Jinjinov