login to rate this
How to install the Origami applications on Linux
2 months ago
0
0
|
In this post I will teach you how to install both Origami applications on your Linux server. Please, bear with me when I say that there are so many different distros in the market, so I will try to keep this tutorial as generic as it can be.
In order to be succesful at this step, you will need skills:
- On installing the .NET 10 SDK
- On Creating new linux users and the proper directories
- Know how to upload files into your linux webhost
- Know how to edit the dbsettings.json file
- On running a .NET application with the --master-password parameter set
- Know how to install Apache2 or NGINX as a reverse proxy
- Know how to create systemd services
First, you need to connect to your linux server via SSH (do it so with a login with elevated privileges).
Installing the .NET 10 SDK and the SQL package tool (globally)
Head to Google (or chatGPT) and search for .NET 10 SDK installation page. Most linux distros have a neat way to install the framework straight from their package distribution systems to get things going.
After doing that, you execute the following shell command to install the sqlpackage dotnet tool (needed to backup/restore your info inside the blog):
dotnet tool install -g microsoft.sqlpackage
Creating a new linux user and the proper directories for Origami
Execute the following commands, one-by-one, and replacing {new-origami-user} with a better username.
sudo useradd -m -s /bin/bash {new-origami-user}
sudo passwd {new-origami-user}
mkdir /home/{new-origami-user}/Sites
One last step from this section: create a directory inside Sites named with your internet domain (omit subdomains, like www and so on, because we are talking about 2 applications in the package: one front-end and another one admin). For example: /Sites/myawesomeblog.com.
Uploading the solution to the host via SFTP
For this step, I often use FileZilla to help me upload files inside my linux server. Google/ask chatGPT how to use that application and upload files inside the Sites internet domain folder. You must upload the entire Origami-{version}{-suffix} inside that Sites subdirectory.
Editing the dbsettings.json configuration file
Change directories to /home/{new-origami-user}/Sites/{internet domain}/{origami-version}/Origami.Files/. You should see a file called dbsettings.json lying in there. Open it with your favorite text editor (FileZilla also provides a way to edit that file locally from the machine accessing the server via SFTP) and change the configuration to the Server, Database, User Id and Password with the information you had set up at the database installation step. Save your changes... this step is very important! Otherwise, your applications won't run properly...
First time running Admin
The fresh database doesn't have an admin user configured for you to use it by default (and because of security reasons). You need to run the admin application with a master-password to create a new capable user.
So execute the following commands, one-by-one, in your SSH window, and replacing the {variables} with the proper values from your environment:
cd /home/{new-origami-user}/Sites/{internet domain}/{origami-version}/Origami.UI.Admin/
dotnet Origami.UI.Admin.dll --master-password {your-onetime-strong-password}
The application must run without outputting any errors, like database connectivity issues and so on.
Now you need to access the admin application to start the step of configuring a new admin user. With your browser window opened at https://{your-server-ip:7210}, you should see a help me button at the admin login page. Click on it.
The application will now give you the opportunity to enter the master-password you had set up, enter it and click on Proceed.
You should see a window giving you the opportunity of adding a new admin user for you to use in the admin application. Most of the fields are pre-filled, so you don't have to worry about them. Please, make sure you don't have obvious usernames, like admin, user and root, for example. This avoids brute force attacks on your login page, since user blocking is not a feature at the moment.
To test run the front-end portion of the solution, you run the following commands:
cd /home/{new-origami-user}/Sites/{internet domain}/{origami-version}/Origami.UI.FrontEnd/
dotnet Origami.UI.FrontEnd.dll
Installing Apache2 or NGINX as a reverse proxy in your webhost
There are numerous tutorials online on how to achieve this step, so I won't discuss that any further. You should also configure your blog internet domain on the reverse proxy, with HTTP to HTTPS redirection in order to take advantage of social network login capabilities. Social network logins won't work on HTTP websites alone. Please, pay attention that the front-end website of the solution runs on ports 7200 and 5200 (HTTPS, HTTP respectively). The admin website of the solution runs on ports 7210 and 5210 (again, HTTPS and HTTP).
For SSL certificates, go with let's encrypt, even though the certificate update routines can be dangerous.
Ask Google or chatGPT, they will be your friends for this journey.
Creating the front-end and admin services on systemd distros
There are numerous tutorials online on how to achieve this step, so I will only provide the templates for systemd distros. But basically, you need to create the services, enable them, daemon-reload the systemctl and check whether they are running actively. Please, find the systemd service templates below:
[Unit]
Description=your-internet-domain (admin)
After=network.target
[Service]
WorkingDirectory=/home/{new-origami-user}/Sites/{internet domain}/{origami-version}/Origami.UI.Admin/
ExecStart=dotnet Origami.UI.Admin.dll
Restart=always
# Specify the user and group for running the service
User={new-origami-user}
Group={new-origami-user}
# Optional environment variables
Environment=ASPNETCORE_ENVIRONMENT=Production
Environment=DOTNET_PRINT_TELEMETRY_MESSAGE=false
[Install]
WantedBy=multi-user.target
And the front-end template:
[Unit]
Description=your-internet-domain (admin)
After=network.target
[Service]
WorkingDirectory=/home/{new-origami-user}/Sites/{internet domain}/{origami-version}/Origami.UI.FrontEnd/
ExecStart=dotnet Origami.UI.FrontEnd.dll
Restart=always
# Specify the user and group for running the service
User={new-origami-user}
Group={new-origami-user}
# Optional environment variables
Environment=ASPNETCORE_ENVIRONMENT=Production
Environment=DOTNET_PRINT_TELEMETRY_MESSAGE=false
[Install]
WantedBy=multi-user.target
And voilà, you just installed Origami into your linux server. Enjoy!

We use cookies and similar technologies to enhance your browsing experience, analyze site traffic, personalize content, and serve targeted advertisements. By continuing to use our site, you consent to our use of cookies. And click OK to close this pop-up window.