Two-Server Setup¶
This setup is designed for work environments and involves dividing system services between two servers:
The Staffcop Enterprise, NFS server. rustSrv is enabled on this server.
The file scanner, NFS client, and file scanner database in PostgreSQL.
Attention
Before installation, please check the system requirements.
Staffcop Server Setup¶
Before setup, install the Staffcop Enterprise server with a file server license.
Activating rustSrv and the FILE_TAG_MANAGER Parameter¶
The file scanner interacts with rustSrv, the configuration assignment mechanism. It may already be enabled.
Check the rustSrv status:
staffcop info | grep RustSrvIf active:
RustSrv = True.
Activate rustSrv, if it is inactive:
sudo staffcop enable rustsrv
Enable FILE_TAG_MANAGER in the Staffcop configuration:
sudo sh -c 'echo "FILE_TAG_MANAGER = True" >> /etc/staffcop/config'
Specify the path to the local spooler folder for the file scanner:
echo "SPOOLER_SCANNER_PATH = \"/var/lib/etl/scanner_queue\"" | sudo tee -a /etc/staffcop/configNote
Do not skip this step. If you don’t specify the local folder path, the ETL module may not find the scanner job queue. This will result in failure to extract and transfer data for scanning.
Restart Staffcop to apply changes:
sudo staffcop restart
Database Server and File Scanner Setup¶
PostgreSQL Installation
Add the PostgreSQL repository:
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
Install the selected version, for example PostgreSQL 15:
sudo apt update sudo apt -y --no-install-recommends install postgresql-15
All commands below are listed for version 15. Replace
15with your version number.For basic setup, allow connections:
sudo sed -i "s/#listen_addresses = 'localhost'/listen_addresses = '*'/" /etc/postgresql/15/main/postgresql.conf
Increase the connection limit:
sudo sed -i 's/max_connections = .*/max_connections = 500/' /etc/postgresql/15/main/postgresql.conf
Restart the system to apply all changes:
sudo systemctl restart postgresql@15-main
Creating a User and Database
Connect to the database:
sudo -u postgres psql
Create a user:
CREATE USER file_scanner WITH PASSWORD 'your_complex_password';
Create a database:
CREATE DATABASE file_scanner WITH OWNER = file_scanner TEMPLATE = template0;
Allow the user to create databases:
ALTER USER file_scanner CREATEDB;
Exit the PostgreSQL console:
\q
User Access Setup
Set up user access for
file_scanner. Open the pg_hba.conf file:sudo nano /etc/postgresql/15/main/pg_hba.conf
Append a line to the file for access from the local interface:
host file_scanner file_scanner samenet md5
Restart PostgreSQL:
sudo systemctl restart postgresql@15-main
File Scanner Installation¶
Before installing the file scanner, install the libpq-dev package:
apt install libpq-dev
Download the latest deb package for your OS from the build repository.
Ubuntu 22.04:
wget http://distr.staffcop.su/file-scanner/ubuntu-22.04/file-scanner.deb
Install the package:
sudo apt install ./<deb-package>where
<deb-package>isfile-scanner.deb.
During installation, an interactive script will prompt you for database connection parameters. Enter the following values:
Database name — file scanner database name
Database user — file scanner database user
Database password — the password specified when creating the file scanner user
Database host — IP address of the database server
Database port — 5432 — standard PostgreSQL port
Scanner Initialization¶
Initialize the scanner:
sudo file-scanner init
Scanner Status¶
Check that the scanner is active:
sudo systemctl status file-scanner
The status should be active.
NFS Client Installation and Configuration¶
Install the NFS client:
sudo apt update && sudo apt install nfs-common -y
Create a mount point:
sudo mkdir -p /var/lib/etl/scanner_queue sudo chmod 775 /var/lib/etl/scanner_queue
Set up automatic mounting at boot. For Ubuntu:
echo "<IP_Staffcop>:/var/lib/etl/scanner_queue /var/lib/etl/scanner_queue nfs defaults 0 0" | sudo tee -a /etc/fstabwhere
<IP_Staffcop>— is the NFS server address.
Mount the folder:
sudo mount -a
Check the mount:
mount | grep etlThe mounted NFS folder should be displayed.
Append line
SPOOLER_SCANNER_PATH = "/var/lib/etl/scanner_queue"to the configuration file:
sudo nano /etc/file-scanner/config
Restart the file scanner:
sudo systemctl restart file-scanner
Final Server Setup¶
You can finish the installation at any time after installing the file scanner.
Obtaining an API token from Staffcop¶
Log in to the Staffcop Enterprise web interface as an administrator.
Go to Control Panel → Server Settings.
Find the API_TOKEN for file scanner parameter, copy and save the token.
Inserting a Token into the File Scanner Configuration¶
Open the file scanner configuration file:
sudo nano /etc/file-scanner/config
Find the line
API_TOKEN = ""and enter the copied token between the quotation marks:
API_TOKEN = "COPIED_TOKEN"
Save changes with Ctrl+O, press Enter, and exit using Ctrl+X.
Restart the file scanner:
sudo systemctl restart file-scanner
Specifying the File Scanner URL in Staffcop¶
Return to the Staffcop web interface.
Go to Control Panel → Server Settings.
Find the URL file scanner parameter.
Enter the full HTTP address of your file scanner server in the format
http://<IP_Server_from_FS_DB_and_FS>:8081.Select Save.
Verifying Functionality¶
Make sure all key services are running:
On the Staffcop server:
staffcop info | grep RustSrvMake sure that
rustSrv= True.
On the file scanner server:
sudo systemctl status file-scannerVerify that the service status shows
active (running).
If both checks pass, your two-server setup has been successfully installed and configured.
Optional Data link protection (NFS)¶
To protect transmitted data, you can configure NFS traffic encryption using IPsec.
Last Updated: 24.03.26