Installation guide

Prerequisites

Artifacts

  • KissLog.Backend.AspNetCore.zip

  • KissLog.Frontend.AspNetCore.zip

Artifacts can be downloaded from here.

Services

Installation

MongoDB

For instructions installing MongoDB server, please check the official tutorial.

MS-SQL / MySql

We will not cover the installation guide for these services. There is a high possibility that the existing server will already have a running instance of MySQL or MS-SQL server.

IIS web applications

  1. On the machine hosting the IIS server, install .NET Core 3.1 Runtime

  2. Create two IIS applications:

    • KissLog.Backend

    • KissLog.Frontend

  3. Update the Application Pool settings for both of the applications to the following:

    KissLogFrontend

    KissLog.Backend

    KissLog.Frontend Application Pool KissLog.Backend Application Pool
  4. Copy into each IIS application folder the corresponding deploy package

    KissLogFrontend

    KissLog.Backend

    Example: C:\inetpub\wwwroot\KissLog.Frontend

    KissLog.Frontend Application Pool

    Example: C:\inetpub\wwwroot\KissLog.Backend

    KissLog.Backend Application Pool

Configuration

On the first deployment you need to update the required configuration options.

The configuration file for each application (KissLog.Frontend and KissLog.Backend) is located under Configuration\KissLog.json.

KissLog.Backend

Replace the following mandatory properties with corresponding values:

C:\inetpub\wwwroot\KissLog.Backend\Configuration\KissLog.json
{
    "KissLogBackendUrl": "http://my.kisslog-backend.com",
    "KissLogFrontendUrl": "http://my.kisslog-frontend.com",
    "Database": {
        "Provider": "MongoDb",
        "MongoDb": {
            "ConnectionString": "mongodb://localhost:27017",
            "DatabaseName": "KissLog"
        },
        "AzureCosmosDb": {
            "AccountEndpoint": "https://my-cosmosdb.documents.azure.com:443/",
            "AccountKey": "A889wNrmGpCmScnZcVr2SprEUHCvUz74rVZgeYyXQyGt9PPW2NBNDwpJauXdmAEUZtdHJ4MVjVM92T5kNg53VB==",
            "DatabaseName": "KissLog"
        }
    }
}

Description

KissLogBackendUrl

Url pointing to KissLog.Backend application

KissLogFrontendUrl

Url pointing to KissLog.Frontend application

Database.Provider

Possible values: MongoDb, AzureCosmosDb

Database.MongoDb { }

Required if Database.Provider = MongoDb

Database.AzureCosmosDb { }

Required if Database.Provider = AzureCosmosDb

KissLog.Frontend

Replace the following mandatory properties with corresponding values:

C:\inetpub\wwwroot\KissLog.Frontend\Configuration\KissLog.json
{
    "KissLogBackendUrl": "http://my.kisslog-backend.com",
    "KissLogFrontendUrl": "http://my.kisslog-frontend.com",
    "Database": {
        "Provider": "SqlServer",
        "KissLogDbContext": "Data Source=192.168.16.11;Initial Catalog=KissLog_Frontend;UID={_username_};PWD={_password_};"
    }
}

Description

KissLogBackendUrl

Url pointing to KissLog.Backend application

KissLogFrontendUrl

Url pointing to KissLog.Frontend application

Database.Provider

Possible values: SqlServer, MySql

Database.KissLogDbContext

Database connection string

Initial startup

After the configuration files have been updated, you can run the applications.

The initial startup will bootstrap all the necessary components including MongoDB and SQL databases.

Startup logs (including errors) will be generated under Logs folder:

  • C:\inetpub\wwwroot\KissLog.Backend\Logs

  • C:\inetpub\wwwroot\KissLog.Frontend\Logs

Startup steps

  1. Make a single request to KissLog.Backend root URL (”http://kisslog-backend.myapp.com”)

    If the startup process went successful, a 200 OK "Running" response will be returned.

    KissLog.Backend Startup
  2. Make a single request to the KissLog.Frontend root URL (”http://kisslog.myapp.com”).

    If the startup process went successful, you will see the home page.

    KissLog.Frontend Startup

Login

To login, you must create a JWT token signed with the secret provided under Authorization\HS256Secret property from KissLog.Frontend\Configuration\KissLog.json file.

Generating Login Token
KissLog.Frontend Login
Login Token
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiZGV2ZWxvcGVyIn0.DF98byyHSWMhsPAarLEwJpFzgrt7CojlleRZAbOlqp4

Troubleshooting

Startup logs (including errors) will be available under \Logs folder. Here should be the first place to check.

  • C:\inetpub\wwwroot\KissLog.Backend\Logs

  • C:\inetpub\wwwroot\KissLog.Frontend\Logs

Quick checklist

  1. Make sure you deploy and run KissLog.Backend first

  2. If there are any confiuguration errors, you should see them under the \Logs folder.

  3. KissLog.Backend will try to connect to MongoDB. If the MongoDB server is not reachable, you should see an error:

    C:\inetpub\wwwroot\KissLog.Backend\Logs\21-03-2021.log
    KissLog.Backend startup failed
    DatabaseName: KissLogBackend
    Exception: A timeout occured after 30000ms selecting a server using CompositeServerSelector{ Selectors = MongoDB.Driver.MongoClient+AreSessionsSupportedServerSelector, LatencyLimitingServerSelector{ AllowedLatencyRange = 00:00:00.0150000 } }. Client view of cluster state is { ClusterId : "1", ConnectionMode : "Automatic", Type : "Unknown", State : "Disconnected", Servers : [{ ServerId: "{ ClusterId : 1, EndPoint : "Unspecified/localhost3:27017" }", EndPoint: "Unspecified/localhost:27017", ReasonChanged: "Heartbeat", State: "Disconnected", ServerVersion: , TopologyVersion: , Type: "Unknown", HeartbeatException: "MongoDB.Driver.MongoConnectionException: An exception occurred while opening a connection to the server.
    ---> System.Net.Sockets.SocketException (11001): No such host is known.
    
  4. KissLog.Frontend will try to connect to MS-SQL / MySql server.
    On the first run, KissLog.Frontend will also create the database (if not already exists).
    Any database errors, such as connection errors or database permissions, will be saved under the \Logs folder.

    Important:

    If the SQL user does not have permissions to create the database, you will have to create it manually.
    The database generation script will be generated under KissLog.Frontend\Logs\CreateDatabaseScript.txt.
  5. KissLog applications (KissLog.Frontend and KissLog.Backend) connect to each other using HTTP requests.
    Make sure there is no firewall blocking the connection.
  6. If the application fails to start and there are no log messages, enable IIS logs:
    Update web.config, set <aspNetCore stdoutLogEnabled="true" />, then restart the application.
    C:\inetpub\wwwroot\KissLog.Backend\web.config
    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
        <location path="." inheritInChildApplications="false">
            <system.webServer>
                <handlers>
                    <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
                </handlers>
                <aspNetCore processPath="dotnet" arguments=".\KissLog.Backend.AspNetCore.dll" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" />
            </system.webServer>
        </location>
    </configuration>
    <!--ProjectGuid: 4EC40754-6618-4D7D-B45E-C7FE1D6B8EF6-->
    

    Important:

    Create an empty Logs folder if one does not already exist.

Need help?

Open a GitHub issue or send an email to catalingavan@gmail.com.