Linux Ubuntu
This section provides a step-by-step guide to installing Babel Licensing Service on Linux Ubuntu.
By following these instructions, you will be able to set up and configure the Babel Licensing Service on your Ubuntu system.
Prerequisites
To successfully install Babel Licensing Service on Linux Ubuntu LTS, you will need to ensure that the following prerequisites are met.
Linux Ubuntu 22.04 LTS
MariaDB v9.1 distrib 10.6 or later version
.NET 7 ASP.NET runtime version 7 or the required version for Babel Licensing Service
Babel Licensing Service ZIP package (babel_service_net70_10.0.0.zip)
Babel Obfuscator Server or Data Center License file (
babel.licenses
)
Additionally, ensure you have the root password available during the installation process. This password is required to perform administrative tasks, such as installing files and configuring the system.
Here are the commands you can use to check the versions of the installed components on your Linux Ubuntu system.
To check the Ubuntu version
This command will display detailed information about your Ubuntu distribution, including the version number.
To check the MariaDB version
Running this command will provide you with the version information of the installed MariaDB server.
To check the .NET runtime versions
Executing this command will list the available .NET runtime versions installed on your system.
Install Script
The BabelLicensingService.sh
Bash script is crafted to streamline the installation and configuration of the Babel Licensing Service on Ubuntu Linux environments as outlined in this section.
This script verifies prerequisites such as root privileges, the presence of required tools like MariaDB CLI command, and dotnet
before commencing the installation procedure. It offers an intuitive interface, enabling users to effortlessly install and check the service status.
Throughout the installation, the script manages various tasks including unzipping the installation archive, transferring the license file, initializing the database, adjusting the appsettings.json
for proper connection strings, and setting up the service with the right configurations.
To utilize the BabelLicensingService.sh
script, adhere to the steps below:
Download the script from the provided link.
Move the downloaded script to a temporary directory (the user's home directory).
Position the Babel service zip file (formatted as
babel_service_net70_x.y.z.zip
, where x.y.z represents the version) and the license file (babel.licenses
) in the same temporary directory as the script.After completing the above steps, execute the following commands to initiate the installation process.
If you opt not to use the BabelLicensingService.sh
script, you may proceed to the subsequent sections for detailed instructions on manual service setup.
Setup Files
To install the Babel Licensing Service, copy the ZIP file containing all the service assemblies and the license file to the home directory of the "babel" user (/home/babel). Assuming you are currently in the directory where the ZIP file is located, follow these steps:
Open a terminal.
Run the following command to copy the ZIP file to the desired location
Now, the ZIP file containing the Babel Licensing Service assemblies will be available in the home directory of the "babel" user (/home/babel). You can proceed with the installation and configuration of the Babel Licensing Service using the files in this directory.
Create the "svc/babel" folder under "/var/www" and extract the contents of the ZIP archive:
In the terminal window, run the following command to create the "svc/babel" folder under "/var/www"
You will be prompted to enter your password, as "sudo" grants administrative privileges for creating directories under the system directory.
Change the current working directory to the newly created "babel" folder:
Extract the contents of the ZIP archive into the current directory ("/var/www/svc/babel"):
By following these steps, you will create the necessary folder structure and extract the contents of the ZIP archive into the "/var/www/svc/babel" directory. This will allow you to proceed with the installation and configuration of the Babel Licensing Service in the appropriate location.
License File
Copy the license file "babel.licenses" into the "/var/www/svc/babel" directory using the following command:
Now, the license file "babel.licenses" is installed in "/var/www/svc/babel" directory, you can proceed with the configuration of the user that will run the Babel Licensing Service user.
Set Application Ownership
With the license file "babel.licenses" successfully installed in the "/var/www/svc/babel" directory, the next step is to configure the user that will run the Babel Licensing Service. In this case, we will set the user as "www-data."
To configure the user, execute the following command in the terminal:
This command changes the ownership of the "/var/www/svc/babel" directory and its contents to the "www-data" user and group. By setting the correct ownership, you ensure that the Babel Licensing Service can be run by the appropriate user, allowing it to access and operate on the necessary files and directories.
Configure Babel Licensing Services
To configure the Babel Licensing Service and edit the appsettings.json
file with the appropriate database connection settings and other application configurations, follow these steps:
In a terminal window, use the following command to open the
appsettings.json
file in the Nano text editor
In the
appsettings.json
file, locate the"Database"
section. Set the"Provider"
value to"MySQL"
to specify that you are using MySQL as the database provider
Find the
"ConnectionStrings"
section. Under the"MySQL"
key, modify the connection string to match your MySQL server configuration. Update theserver
,User
,Password
, andDatabase
values accordingly:
Remember to replace "YourUniquePassword"
with a strong password of your choice. It is highly recommended to use a combination of uppercase and lowercase letters, numbers, and special characters to create a secure password. Keep the password for later use during the database configuration.
Optionally, you can customize other application settings. For example, under the
"Serilog"
section, you can configure logging settings and adjust the minimum log level:
It might be useful for debugging installation issues to set the minimum log level to Debug. When the service is running, we can revert the log level to Information or Warning.
Further down, under the
"Application"
section, you can specify the"LicenseFile"
(babel.licenses) and customize the"SigningKey"
and"TokenExpiration"
values according to your requirements:
Replace the Secret Token Key
with your unique key. This will we used to secure the communication between application clients and the Babel Licensing Service.
To save the changes and exit Nano, press
Ctrl + X
, then pressY
to confirm the changes, and finally, pressEnter
to save the file.
By following these steps, you will have successfully configured the Babel Service by editing the appsettings.json
file. The updated configuration will include the correct database connection settings and any other customizations you have made.
To learn more about the Babel Licensing Service configuration file, please refer to the Configuration paragraph.
Create Database
We need to create the "licenses" database configured in the connection string we set for Babel Licensing Service. Then create the "babel" user, grant privileges to the database, and verify the user's permissions.
Open a terminal.
Log in to the MariaDB console as the root user using the following command:
You will be prompted to enter the root password.
Once you are logged in to the MariaDB console, you can list all existing databases by running the command:
To list all existing users, execute the following query:
Create the "licenses" database using the command:
Create the "babel" user and grant all privileges to the "licenses" database by executing the following commands:
Replace 'YourUniquePassword'
with the password you set for the Babel Licensing Service MySQL connection string.
To verify that the "babel" user has the appropriate permissions, you can use the following statement:
You can now exit the MariaDB console by typing the command quit
then ENTER.
By following these steps, you will have successfully created the "licenses" database, created the "babel" user, granted privileges to the database, and verified the user's permissions.
Start Babel Licensing Service
To start the Babel Licensing Service, follow these steps:
Open a terminal.
Navigate to the directory where the Babel Licensing Service is located. For example:
Run the following command to start the Babel Licensing Service:
If everything is configured correctly, you will see the service starting up. The terminal log will display information about the service initialization, including the creation of tables in the database, depending on the log level you choose in the appsettings.json
file.
Keep an eye on the terminal log for any errors or warnings. If there are any issues, make sure to review the configuration, database connection settings, and permissions to ensure they are set up correctly.
If the Babel Licensing Service starts successfully, it will be ready to handle licensing operations and provide licensing services to your applications.
It is recommended to run the Babel Licensing Service as a background process or set up a service manager to ensure it continues running even after closing the terminal.
Configure As Background Process
In Linux, service files, also known as service unit files, are configuration files with a ".service" extension that are used to control the behaviour of daemons or services. These files define various settings and parameters related to the service, such as its name, description, execution command, working directory, environment variables, and more.
To configure the Babel Licensing Service as a system service in Linux, follow these steps:
Open a terminal.
Run the following command to create and edit the service file:
Paste the following configuration into the file:
Save the file by pressing
Ctrl+O
, then exit the editor by pressingCtrl+X
.Start the Babel Licensing Service by running the following command:
To check the status of the service, use the following command:
This command will display the current status of the service, including any error messages or warnings:
By default, the service is not set to start automatically when the server is started. To enable the service to start automatically, run the following command:
Enabling the service ensures that it will start automatically after the server is rebooted.
With these steps, you have configured the Babel Licensing Service as a systemd service in Linux. The service will start automatically upon system boot and can be managed using the systemctl
command.
Last updated