Hide

YetaWF Documentation

Display
Print

Installing YetaWF for .NET on Linux

.NET SDK

YetaWF uses .NET 6.0. The .NET 6.0 SDK is required to build YetaWF. It can be downloaded and installed from https://dotnet.microsoft.com/download/linux-package-manager/ubuntu18-04/sdk-current.

Visual Studio Code

To make changes to YetaWF, a code editor like Visual Studio Code is required. It can be downloaded and installed from https://code.visualstudio.com/download.

Git

In order to clone the Git repository you'll need the Git tools. If these are not present on your development system you can install them from https://git-scm.com/book/en/v2/Getting-Started-Installing-Git.

nodejs

Nodejs and npm are used by YetaWF for the build pipeline and JavaScript package management. Nodejs, which includes npm, can be downloaded and installed from https://nodejs.org/en/download/package-manager/.

YetaWF was tested with nodejs 16.14.2, gulp >4.

Gulp

Gulp can be installed from the command line:

sudo npm install -g gulp

It also requires the latest version of gulp-cli.

sudo npm install -g gulp-cli

Clone The YetaWF Depot

Open a Windows Command Prompt and create an appropriate folder on your development system. Then make the new folder the current directory:

mkdir YetaWFTest
cd YetaWFTest

Clone the YetaWF Solution2 repository (make sure to include the trailing period in the clone statement to indicate the current folder) and retrieve all the required submodules:

git clone --recursive https://github.com/YetaWF/YetaWF-Solution2 .

Important: Once completed, run the following command which creates the required symlinks and additional JavaScript packages are downloaded/installed:

./post-clone.sh

The above executes the following statements so you don't have to enter them manually. Depending on your Linux flavor, you may need to change this a bit.

#!/bin/bash
# Change ownership of all files/folder
sudo chown $USER -R .
# get libgdiplus for webp image support
sudo apt-get update
sudo apt-get install -y libgdiplus libc6-dev
# Build and run ProjectSettings tool to set all symlinks
dotnet build PublicTools/ProjectSettings
dotnet run -p PublicTools/ProjectSettings SymLinks
# Build the website
cd Website
npm install
npm rebuild cwebp-bin
dotnet build

Do not run the web project until after deciding whether to use files or a database server below.

Files Or Database Server

The default installation can run as-is and will create data files. This is intended for use with small sites (few pages or users) and for initial testing.

If you want to use files for data storage, you're ready to run the Website project. This will start your new website. Otherwise, for large scale use, it is recommended to use a database to store all site data.

Microsoft SQL Server

In order to use a SQL database, the connection string has to be specified in the AppSettings.json file.

AppSettings.json

The SQL DB is defined in AppSettings.json (located in folder ./Website/Data).

First, in the "Default" section, change the IOMode setting to "SQL".

Then add the connection string, by removing "notused_" (part of the SQLDbo and SQLConnect keys) and provide the connection string ("Data Source= ....").

      . . .
      "Default": {
        "LanguageId": "en-US",
        "IOMode": "File",
        "notused_SQLDbo": "dbo",
        "notused_SQLConnect": "Data Source=....;Initial Catalog=....;User ID=username;Password=password;TrustServerCertificate=True",
        . . .

AppSettings.json shown with connection string ("Data Source=") which you would provide.

      . . .
      "Default": {
        "LanguageId": "en-US",
        "IOMode": "SQL",                    <<<<<< CHANGED
        "SQLDbo": "dbo",                    <<<<<< CHANGED
        "SQLConnect": "Data Source=yoursource;Initial Catalog=yourcatalog;User ID=yourusername;Password=yourpassword;TrustServerCertificate=True",  <<<<<< CHANGED
        . . .

The DB itself has to be created in SQL (usually with SQL Server Management Studio). Once the DB has been created, the site can be rebuilt and started. All tables will be created automatically during site startup.

PostgreSQL Server

In order to use a PostgreSQL database, the connection string has to be specified in the AppSettings.json file.

AppSettings.json

The PostgreSQL DB is defined in AppSettings.json (located in folder ./Website/Data).

First, in the "Default" section, change the IOMode setting to "PostgreSQL".

Then add the connection string, by removing "notused_" (part of the PostgreSQLSchema and PostgreSQLConnect keys) and provide the connection string ("Host=...").

      . . .
      "Default": {
        "LanguageId": "en-US",
        "IOMode": "File",
        . . .
        "notused_PostgreSQLSchema": "public",
        "notused_PostgreSQLConnect": "Host=...;Port=5432;Username=...;Password=...;Database=...",
        . . .

AppSettings.json shown with connection string ("Data Source=") which you would provide.

      . . .
      "Default": {
        "LanguageId": "en-US",
        "IOMode": "PostgreSQL",             <<<<<< CHANGED
        . . .
        "PostgreSQLSchema": "public",       <<<<<< CHANGED
        "PostgreSQLConnect": "Host=yourhost;Port=5432;Username=yourusername;Password=yourpassword;Database=databasename",  <<<<<< CHANGED
        . . .

The DB itself has to be created in PostgreSQL (usually with pgAdmin). Once the DB has been created, the site can be rebuilt and started. All tables will be created automatically during site startup.

Running The Web Project

For first time startup of the site, make sure to build a Debug build (but don't run the debugger when starting the site).

Once all of the above steps have been completed, the Website project can be started.

cd Website
dotnet run

Once started, you can view the site in your browser:

http://localhost:50000

As the site starts up, it will guide you through the initial installation.

Once the site has been created, shut down the website (Cltr-C to to shut it down), and restart it:

dotnet run

Your site is now up and running and you can view it again in your browser:

http://localhost:50000

YetaWF can also be containerized as shown in YetaWF On Docker.