+7 902 589 0933
info@trustservice.tech

Installing TrustServer in FreeBSD 13.0

Installing TrustServer in FreeBSD 13.0

This article will cover the typical installation and initial configuration of the administrator account of the TrustViewerPro – TrustServer server part in the FreeBSD 13.0 operating system.

We will install TrustServer on a “clean” FreeBSD 13.0 with an updated port tree and the wget download package installed.
Before installing TrustServer, we will need:
p7zip – an archiver that works with archives .7z;
linux_base-c7 is a basic set of packages for emulating the Linux environment.

To install p7zip, run the following commands:

root@trustservice:~ # whereis p7zip
p7zip: /usr/ports/archivers/p7zip
root@trustservice:~ # cd /usr/ports/archivers/p7zip
root@trustservice:/usr/ports/archivers/p7zip # make install clean

After the installation of p7zip takes place, we will install linux_base-c7:

root@trustservice:~ # whereis linux_base-c7
linux_base-c7: /usr/ports/emulators/linux_base-c7
root@trustservice:~ # cd /usr/ports/emulators/linux_base-c7/
root@trustservice:/usr/ports/emulators/linux_base-c7 # make install clean

Next, we will allow you to enable linux emulation at system startup. To do this, add the line linux_enable=”YES” to /etc/rc.conf:

root@trustservice:~ # echo 'linux_enable="YES"' >> /etc/rc.conf

Restart the system and use the “kldstat” command to check whether the necessary modules are loaded:

root@trustservice:~ # kldstat | grep linux
 6    1 0xffffffff8291f000    388f8 linux.ko
 7    4 0xffffffff82958000     db70 linux_common.ko
 8    1 0xffffffff82966000    30ac8 linux64.ko
root@trustservice:~ #

As you can see, the necessary modules are loaded and you can start installing TrustServer.
Download the current distribution from the developer’s website:

root@trustservice:~ # wget http://pro.trustviewer.com/file/TrustViewerPro-en.7z
--2021-06-09 18:27:16--  http://pro.trustviewer.com/file/TrustViewerPro-en.7z
Resolving pro.trustviewer.com (pro.trustviewer.com)... 194.58.92.117
Connecting to pro.trustviewer.com (pro.trustviewer.com)|194.58.92.117|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 12370975 (12M) [application/x-7z-compressed]
Saving to: ‘TrustViewerPro-en.7z’

TrustViewerPro-en.7 100%[===================>]  11.80M   387KB/s    in 29s

2021-06-09 18:27:45 (415 KB/s) - ‘TrustViewerPro-en.7z’ saved [12370975/12370975]

root@trustservice:~ #

and unpack the archive:

root@trustservice:~ # 7z x TrustViewerPro-en.7z

7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21
p7zip Version 16.02 (locale=C.UTF-8,Utf16=on,HugeFiles=on,64 bits,1 CPU x64)

Scanning the drive for archives:
1 file, 12370975 bytes (12 MiB)

Extracting archive: TrustViewerPro-en.7z
--
Path = TrustViewerPro-en.7z
Type = 7z
Physical Size = 12370975
Headers Size = 507
Method = LZMA2:24 BCJ
Solid = +
Blocks = 2

Everything is Ok

Folders: 7
Files: 9
Size:       15314157
Compressed: 12370975
root@trustservice:~ #

Check, we should have the directory “TrustViewerPro-en”:

root@trustservice:~ # ls
.cshrc                  .login                  TrustViewerPro-en
.history                .profile                TrustViewerPro-en.7z
.k5login                .shrc

Next, you need to create a directory where we will place the TrustServer executable file. TrustServer in FreeBSD runs in a Linux emulation environment, so let’s create a “trustserver” directory in /compat/linux/srv/:

root@trustservice:~ # mkdir /compat/linux/srv/trustserver 

Copy the TrustServer executable file to the created directory, which is located in the unpacked directory at the path TrustViewerPro-en/Server/Linux/TrustServer (for the 32-bit version of the operating system) or TrustViewerPro-en/Server/Linux/TrustServer64 (for the 64-bit version of the operating system):

root@trustservice:~ # cp TrustViewerPro-en/Server/Linux/TrustServer /compat/linux/srv/trustserver/

and make it executable:

root@trustservice:~ # chmod u+x /compat/linux/srv/trustserver/TrustServer

Now let’s create a file for the TrustServer startup script:

root@trustservice:~ # ee /etc/rc.d/trustserver

and add the following code to it:

#!/bin/sh

# PROVIDE: trustserver
# REQUIRE: LOGIN
# KEYWORD: shutdown

. /etc/rc.subr

name="trustserver" ;
rcvar=${name}_enable

# pidfile
pidfile="/var/run/${name}.pid"

# command and arguments
PORT="8443"
DATA="/compat/linux/srv/trustserver/"
LOG="/var/log"
PASS="123456"

command="/compat/linux/srv/trustserver/TrustServer"
command_args="-port $PORT -log $LOG -pass $PASS -data $DATA"

start_cmd="${command} start ${command_args}"
stop_cmd="${command} stop"

load_rc_config ${name}

run_rc_command "$1"

or you can download the finished script file specified in the example and copy it to /etc/rc.d/ :

root@trustservice:~ # wget https://trustservice.tech/download/trustserverFreeBSD
root@trustservice:~ # cp trustserverFreeBSD /etc/rc.d/trustserver

In the script file, pay attention to the lines that need to be corrected if necessary:
PORT=”8443″ – specify the port on which the TrustServer console will be available. You can specify any non-reserved port at your discretion. Note: do not forget to open the specified port in the firewall!
DATA=”/compat/linux/srv/trustserver/” – the path where the working files created by TrustServer will be located.
LOG=”/var/log” – the path where the TrustServer logs will be stored.
PASS=”123456″ – the password of the temporary root account of the TrustServer console for the first login. This password and the root account are blocked after the first initialization of the TrustServer, and in the future it will be impossible to log in with this data.
command=”/compat/linux/srv/trustserver/TrustServer” – specify the path to the TrustServer executable file, but do not forget that the case in the path must match the case in the name of the directories and the file. If you are installing the 64-bit version, then write TrustServer64 instead of TrustServer.

Mark the created script file as “Executable” and allow it to start at system boot by adding the line trustserver_enable=”YES” to /etc/rc.conf:

root@trustservice:~ # chmod u+x /etc/rc.d/trustserver
root@trustservice:~ # echo 'trustserver_enable="YES"' >> /etc/rc.conf

After restarting the system, we will check whether the TrustServer processes have started:

root@trustservice:~ # top | grep Trust
  779 root          2  20    0    18M  4280K select   0:00   0.00% TrustServer
  778 root          1  20    0  7608K  4036K nanslp   0:00   0.00% TrustServer

As you can see, the Trust Server processes are running and now we can proceed to creating a TrustServer administrator account. To do this, open the TrustServer management console in the browser at:

http://your-domain:8443/admin, where “your-domain” is the name or ip address of the host where the TrustServer is installed.
In the console page that opens, in the “Username” field, enter “root”, in the “Password” field, enter the temporary password that was written in the trustserver script, in our case “123456” and click ” Login”

After successfully logging in to the TrustServer Control Panel, go to the “Users” tab, click “Add” and create a TrustServer administrator account with maximum rights.
To do this, fill in the fields:
Username (English only)
Display name
Full name
Password.
In the field “Authorization” be sure to set the rights “Super admin”

Save the account with the “Save” button and exit the console by clicking the “Logout” link in the upper right corner.
Attention! After creating the server administrator account, the temporary account with the “root” login is blocked and subsequent authorizations must be performed with the new account.

This completes the installation of the TrustServer. Further configuration of the TrustServer takes place directly in the management console under an account with super administrator rights.

Discuss article on the forum

Full or partial copying and publication of materials is permitted with the obligatory reference to this article.

Leave a Reply

Your email address will not be published. Required fields are marked *