Proving the concept

Proof of Concept for .NETCore on Ubuntu 18.04.

Well if you can see this, then hosting .NETcore on Ubuntu is functioning

Well worth reading Publishing and running your ASP.NET Core project on Linux but to summarise

wget -q -O packages-microsoft-prod.debwget -q -O packages-microsoft-prod.debwget -q -O packages-microsoft-prod.deb

sudo dpkg -i packages-microsoft-prod.deb

sudo add-apt-repository universe

sudo apt-get update

sudo apt-get install apt-transport-https

sudo apt-get update

sudo apt-get install dotnet-sdk-3.0

sudo pico /etc/systemd/system/kestrel-aspnetcoredemo.service

Description=Example ASP .NET Web Application running on Ubuntu 18.04
ExecStart=/usr/bin/dotnet /var/www/www.domain.ext/aspnetcoredemo.dll

sudo systemctl enable kestrel-aspnetcoredemo.service

sudo systemctl start kestrel-aspnetcoredemo.service

sudo a2enmod proxy proxy_http proxy_html

sudo systemctl daemon-reload

If you need a different version of the runtime then:

sudo apt-get install aspnetcore-runtime-2.1

and you will need to add a virtual host conf file in /etc/apache2/sites-available/www.domain.ext.conf

<VirtualHost *:80>
ServerAdmin serveradmin@domain.ext
ServerName www.domain.ext
ServerAlias domain.ext
ProxyPreserveHost On
ProxyPass /
ProxyPassReverse /
ErrorLog /var/log/apache2/aspnetcoredemo-error.log
CustomLog /var/log/apache2/aspnetcodedemo-access.log

Visual studio (17) - Publish your project and then copy the content of your projects bin\Release\[.netcoreapp(ver)] folder i.e. dlls etc to your kestrel.service WorkingDirectory
and then your projects wwwroot folder into the same WorkingDirectory.
restart your kestrel service (sudo service kestrel-aspnetcoredemo restart).