CMS installation

  Installing CMS


  Deploying and running the CMS code

  To perform Deploying operation, download the .zip file with the application code. Using a file manager or the command: $ sudo mkdir -p /var/www/cmsTC create a folder for the CMS application in the NGINX web server directory and move the downloaded .zip file into it, then expand it into this folder. Find the appsettings.json file and edit it as follows: in the "EmailSettings" field, enter the current username and password, etc. to connect to your email account. This will be necessary for confirmation when registering a user on your site. Now you can launch the application itself for the first time. To do this, in the /var/www/cmsTC folder, run the command:

$ sudo dotnet cmsTCfree.dll

If the launch was successful, create a system service that will launch the application at system startup. To do this, create a file with the following contents and reboot the system:

/etc/systemd/system/kestrel-cmsTCfree.service

    [Unit]

    Description=Example .NET Web API App running on Linux

    [Service]

    WorkingDirectory=/var/www/cmsTC

    ExecStart=/usr/bin/dotnet /var/www/cmsTC/cmsTC.Server.dll --urls='https://127.0.0.1:44456'
  
    Restart=always

    # Restart service after 10 seconds if the dotnet service crashes:

    RestartSec=10

    KillSignal=SIGINT

    SyslogIdentifier=dotnet-example

    User=root

    Environment=ASPNETCORE_ENVIRONMENT=Production

    Environment=DOTNET_PRINT_TELEMETRY_MESSAGE=false


    [Install]

    WantedBy=multi-user.target




  Setting up the NGINX web serverX

  Create a new NGINX configuration file with the following content and name. Replace yourdomain.name with your domain and check the path to the .key and .crt certificate files. If the certificate files are missing, you need to create them according to the hosting instructions or create them yourself, for example using Certbot Let's Encrypt.

/etc/nginx/site-enabled/cmsTC
#=========================================================================================
    server {

    listen 80;
    listen [::]:80;
    return 301 https://$host$request_uri;

    }

    server {

    listen 443 ssl http2 default_server;
    listen [::]:443 ssl http2 default_server;
    server_name yourdomain.name *.yourdomain.name;

    ssl_certificate /root/.aspnet/https/cert.crt;
    ssl_certificate_key /root/.aspnet/https/cert.key;

    location / {

    proxy_pass https://localhost:44456;
    proxy_set_header   Host $host;

    }

    }

    upstream dotnet {
    zone dotnet 64k;
    server 127.0.0.1:44456;
    }
 

      Restart your web server:
   $ sudo systemctl restart nginx
   and check your site's performance via a browser.