Rawdata-app.ruc.dk: Publish your content
A description of how to publish a .NET core project on the webserver rawdata-app.ruc.dk. The .NET core is cross-platform and can be developed on both Mac, Windows, and Linux – but this description is done on a Windows machine.
About The Server
Rawdata-app is a webserver hosted at RUC and used for hosting web projects for students enrolled in the rawdata course. Each group of students has its own subdomain and is responsible for the content of the individual sites. The server supports .NET core 2.2 applications.
Prerequisites:
You need to have the following five things ready before you can upload your project to the server
- Your projects release build .dll files including any (unusual) dependencies
- Credentials for the server
Each group of students will be given a username and a password for the server at the begining of the course - A VPN client for RUC
You are not allowed to connect to the server outside RUC and you therefore have to use a VPN connection (even though you are using the eduroam wifi at campus)
You can download the vpn client here: https://vpn.ruc.dk
We hope to change this in the future but that’s how it is for now! - A FTP client
I am using the FileZilla crossplatform ftpclient in this tutorial but feel free to use what ever you like as long as you can transfer files with it - A SSH client to access the server and start newly uploaded websites
Linux and mac have one built-in and windows user can download PuTTy
Your Web Application
You cannot just upload any web application to the rawdata-app server, unfortunately. Your application must use .net core 2.2.
Newer versions of .net will not work and earlier might not work either, backward compatibility has not been tested.
When your application is ready for deployment you should build your project as a release instead of for debugging. The release build is optimized for better performance instead of debugging. You can read more about debug and release build in visual studio here
build your solution including the .dll files from NuGet packages used in your project
You will most likely need to install some NuGet packages in your project and that might give you some errors when you want to run the project on the server. In the case below I have added the Npgsql package in order to access the PostgreSQL database and that package is not installed on the rawdata-app server. The solution is to add line #6 where I tell the project to copy all assemblies to the build folder. you access the .csproj file by double-click on your project name in the Solution Explorer.
<Project Sdk="Microsoft.NET.Sdk.Web"> <PropertyGroup> <TargetFramework>netcoreapp2.2</TargetFramework> <AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel> <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies> </PropertyGroup> <ItemGroup> <PackageReference Include="Microsoft.AspNetCore.App" /> <PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" /> <PackageReference Include="Npgsql" Version="4.0.8" /> </ItemGroup> </Project>Uploading your project
You need some kind of (s)ftp client to upload your project and I suggest that you use FileZilla and you don’t need the ‘pro’ version. If you are unfamilar with ftp clients you can take a look at this youtube tutorial where he explain how to use filezilla.
You should use the sitemanager to store the information about the connection to the rawdata-app serber. that will save you some time on the long run when you need to upload changes later.
Configure your connection to this:
Protocol: SFTP - SSH File Transfer Protocol Host: rawdata-app.ruc.dk User: [provided to you by the lecturer] Password: [also provided to you by the lecturer]
The files you need to upload is inside your project in the bin\Release\netcoreapp2.2 folder. Just copy it all into the ‘public_html’-folder on the server.
Start Your Application
After having uploaded your files you need to start or restart your application. The server will continue serving the old application unless you tell it to restart. Mac an dLinux has a ssh client in the terminal but on windows you need to download a client. A effective client for windows is PuTTy.
log in to the sever and restart your application by typing ‘supervisorctl restart raw1’ if you want to restart raw1 e.g.
Database access?
The rawdata-app server also run a PostgresSQL server and give you the opportunity to use create database content an use it in your project: you can access the PgAdmin administration interface here https://rawdata-app.ruc.dk/phppgadmin/
You need your credentials from your teacher to access the PgAdmin tool on the server
A Brief Summary / TL;DR
- make sure your project is a .NET core 2.2 project
- add >CopyLocalLockFileAssemblies> true >/CopyLocalLockFileAssemblies> to your .csproj file
- upload the files from the bin/release folder to the ‘public html’- folder on the server with an ftp client
- restart the application through SSH by using the supervisor
Having problems?
You are always welcome to come by FlexLab and get some help uploading your application to the rawdata-app server
Drone Java rawdata Tello web