How to host a Blazor ServerSide app on a VPS - blazor-server-side

I'm experimenting with the Blazor Server App and want to host it on my own VPS. I followed about every official documentation there is, but I can't get it to work.
VPS info:
Runs on Hostinger -> Ubuntu 18.04 64bit with Webmin
Installed all required dotnet versions on VPS:
When creating a test index.html and place it inside var\www\html\ it can be accessed through a browser and the content is shown
Blazor Server App info:
Start a new project > Blazor Server App > Publish > Local folder
Copy files from bin\release\netcoreapp3.1\publish* into VPS\var\www\html\
The files can be seen when browsing, but nothing executes
What am I missing here? How can what I want to do be done?
I was expecting the application to run, just like it did when executing it in Visual Studio.
I followed this tutorial based on a similar question
https://www.jeremymorgan.com/blog/linux/blazor-in-linux/, but I'm not using CentOS so it did not help much.

Related

Visual studio code auto refresh browser with apache

Is there a way to set up (extension, etc...) Visual studio code to auto-refresh browser (Firefox Dev, Chrome Dev) as soon as the file I am working on is saved? (Like Live Server extension)
I am working with local installation of Apache (Yes, I am working on WordPress :)
Using this tutorial from youtube you will install the Live Server VSCode extension for use with html files. However, you will most likely (although you haven't mentioned) be using PHP or other languages because apache supports it. For this, use this tutorial from GitHub. It installs a browser extension (compatible with chrome/chromium-based/firefox browsers) that connects to a server instance and serves the reload function to that webserver. This does NOT install a web server (in this case it shouldn't matter). If you follow the tutorial, it should be really self-explanatory.

ColdFusion 2016 stopped rendering website after Mac software update

ColdFusion 2016 stopped rendering website files in browser after I updated my Mac software to latest one, Mojave 10.14.1. Instead of seeing the rendered page in the browser I can see my repository files only.
I noticed that some previous settings regarding local server and Apache were removed after update. I did restore missing settings back how they were before and even reinstalled ColdFusion 2016, but still have that problem with rendering websites on the ColdFusion platform.
After running /Applications/ColdFusion2016/cfusion/runtime/bin and sudo ./wsconfig, I the get Web Server Configuration Window with content inside
[ localhost ] Apache : /private/etc/apache2.
Is there anyone who can help to resolve this issue please?
Change the directory to
/Application/ColdFusion2016/cfusion/runtime/bin
Run
sudo ./wsconfig
The documentation does not mention sudo, but I am suggesting it to be safe.
Source: https://helpx.adobe.com/coldfusion/configuring-administering/web-server-management.html
After testing ColdFusion 2016 platform using port :8500 I found out that CF server uses Tomcat path (wrong path) instead of Apache one (for Mac virtual directory file: httpd-vhost.conf) and both of them are running at the same time.

How to create and access a folder structure in .Net core web API after hosting it on Docker

Currently I am using
1. Windows 7
2. Docker Toolbox
3. Visual studio 2017
4. Asp.net core 2.0 Web API
Problem:- First I have created an asp.net core 2.0 web API, which uses a physical path for reading files. It was running perfectly before hosting it to docker.
Then I have enabled support for Docker, build and run the image.
When i try to hit the URL it is giving me exception that "could not find the part of path"
You can see How I declared a path here. Is that right way to do this? Or do I need to make some changes to dockerfile?
Docker toolbox runs on virtual machine but the path I was given is of my windows machine. As I am creating the image on Linux container I also need to map location from where it can get the data file.
It solves the problem when I mapped the app folder while running the container.

How to run Php Pages in Netbeans

I have just successfully deployed Quercus on Glassfish 4.1. I tested in the browser
http://localhost:8080/quercus-4.0.39/ and saw this:
Congratulations! Quercus™ Open Source 4.0.39 is interpreting PHP
pages. Have fun!
Then ran Netbeans Tools > Options > PHP > Activate PHP Support
It worked. I now see this:
So I made 3 tests:
I ran a php page in an html application but instead of displaying the page it prompts a download box to open in Notepad
I created a new PHP project with below configuration:
But when I run the app with above configuration I receive this error:
Firefox can't establish a connection to the server at localhost.
So I tried with a third test with other configuration:
When I run this third test I get a HTTP Status 404 - Not Found error on GlassFish server.
What am I doing wrong? Thank you!
The problems with your tests are:
PHP needs to be interpreted by a web server. Your browser doesn't know what to do with a PHP file, so it just treats it like a file rather than a page to render. Apache is the most common and easiest server to do that with, GlassFish is unnecessary and probably not the best choice for PHP.
In this test, you are trying to visit a web server which doesn't exist. You don't have any server that listens on port 80.
Here, GlassFish is reporting that it can't find the resource you requested. Have you made sure to put your PHP project in the right directory for Quercus (like in step 4 of your documentation link) and made sure you're visiting a valid URL?
I think the best thing for you to do is move away from Quercus. The latest version of it is very old and implements an old version of PHP (version 5, whereas the latest is 5.6). Looking at the official website, the project appears to be dead, with broken links and very old documentation.
I would suggest you investigate installing a WAMP (Windows, Apache, MySQL, PHP) or LAMP (Linux, Apache, MySQL, PHP) stack. There are lots of very easy installers for this approach which will help you get up to speed and a lot of helpful tutorials and documentation.
For those who using tomcat, below are the steps :-
Right click your project --> properties --> Run Configuration --> For Run As, select PHP Built-in Web Server
Go to Tools --> Options --> PHP tab --> in Php 5 interpreter, browse the correct location for php
Then it should works !
In my case , my php is in /usr/bin/php7.0, so I put the path in Php 5 interpreter.

Kestrel / IIS Express requires restart before edited .cshtml view changes are shown in browser

I'm in the process of setting up my first ASP.NET vNext web application project.
I've got as far as getting the default project to build and run fine in both Windows and OSX. I've tested with kestrel on the mac, and in Windows IIS Express along with kestrel.
The problem I have encountered is that in Windows, editing a cshtml View file while the web server is running isn't reflected when I next refresh the browser.
In OSX, I can run 'dnx web' and navigate to localhost:5000 and browse the site. I can then edit the .cshtml View files, switch back to the browser, hit refresh, and I can see all the changes. This is what I expect to happen and happened in previous versions.*
In Windows, I can either run dnx web or IIS Express on the same site as I was using on OSX, navigate to localhost:5000 (or for IIS Express its own port number) and browse the site. I then switch to edit the cshtml View files, but when I switch back to the browser to reset, the changes aren't shown. It's not until I restart kestrel or IIS express that the changes are shown.
Curiously, however, I can edit a .cs Controller file and the site then recompiles by itself and I don't need to re-start it - in Windows at least. (In OSX, editing a controller file doesn't cause an auto-recompile, but that's an aside, I believe dnx-watch will fix that).
Is there something that I've missed in the project.json, or another setup file, which is causing the issue in Windows?
I have tried:
creating a second completely clean web application project
reinstalling ASP.NET
desperately, lastly, creating a clean install of Windows 10 with Visual Studio 2015 Community Edition, to no avail
What's the way to get Kestrel or IIS Express in Windows to serve the updated cshtml View file after it's been edited, without restarting the server?
*side note, ASP.NET MVC in OSX is awesome!
Following on from #SRQ Coder's response, in particular the reassurance that it's supposed to work as I hoped, I found the reason but as yet no decent solution.
My project directory is located on a network share and I load the projects directly from there (I run Parallels Desktop on a mac). This works great with ASP.NET 4.x / MVC 5 (and earlier). However it looks like ASP.NET 5 doesn't support this setup.
The moment I copied the project folder to the local C: drive it all worked fine
When opening the project from a \\network-share, the project loads and I can run/debug the website, but CSHTML edits aren't shown in browser until IIS Express/Kestrel is restarted
Opening the project from a X:\ mapped network drive doesn't make any difference
I'm not able to recreate your problem on my machine: VS2015; Win10 etc. in either the IIS mode or Web: localhost/5000 mode and on multiple browsers.
I can edit both 'shared' cshtml files like '_Layout' and also the default 'home/index cshtml file with no problem.
Since you've re-installed so much of your system, I'm wondering if you have not re-installed web-essentials and enabled 'browser link'.
I feel your pain...