Installation and configuration¶
Installation¶
Note
This guide describes how to install RemoteApp on Debian10.
Note
For the application to work, you must have installed and configured: Mariadb, Apache2 with the WSGI plugin, Redis.
Important
First need to do setting up the environment. All commands are executed only from superuser.
Mode superuser:
sudo -i
Save the list of previously installed packages before starting the installation, this will allow you to painlessly restore the system in case of damage. Run the following commands to do this:
mkdir -p /tmp/rollback/remoteapp pip3 freeze > /tmp/rollback/remoteapp/pip_before.txt
After that, directory
/tmp/rollback/remoteapp
will contain filepip_before.txt
with list of installed applications.Install package RemoteApp:
pip3 install remoteapp
Save the list of installed packages after installation to be able to roll back changes:
pip3 freeze > /tmp/rollback/remoteapp/pip_after.txt
Set up environment variables:
export PIP_INDEX_URL=http://pypi.accentos.ru/simple/ export PIP_TRUSTED_HOST=pypi.accentos.ru
Configuration¶
Add user:
adduser --system --group --disabled-login aos
Create directory for config files with the right permissions:
mkdir /etc/remoteapp chown -R aos:aos /etc/remoteapp
Create directory for the log files that was specified in the configuration file with the right permissions. For example:
mkdir /var/log/remoteapp/ chown -R aos:aos /var/log/remoteapp/
Create a directory for remote connection files with the required permissions. For example:
mkdir /var/lib/remoteapp/ chown -R aos:aos /var/lib/remoteapp/
Create database using MySQL as an example, set rights, database type and other parameters:
# Login to the database using the root password mysql -uroot -p # Create remoteapp database CREATE DATABASE remoteapp; # Give permission to read, edit, perform any actions on all tables in remoteapp database GRANT ALL PRIVILEGES ON remoteapp.* TO 'aos'@'localhost' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON remoteapp.* TO 'aos'@'%' IDENTIFIED BY 'password'; # Exit the database
Perform command
remoteapp-configure
to configure systemd service files:remoteapp-configure
Migrate database:
FLASK_APP=remoteapp.cloudapi.app flask db upgrade
In the configuration file, specify the address of cloud with which the application will work. Change other parameters as needed.
Enable and start systemd services:
systemctl daemon-reload systemctl enable ra-api.service systemctl start ra-api.service systemctl enable ra-listener.service systemctl start ra-listener.service
Create templates for generating files. To do this run following commands:
ra-client create type type=mstsc template=default ext=rdp os_type=appv ra-client create pub type=win configure=windows ext=reg
os_type
is type of operating system that will be used for connection. Possible values are:linux
- for Linux applications,rdp
- for getting Windows desktop,appv
- for getting Windows applications.
Create symlinks to Apache remoteapp configuration:
ln -s /etc/apache2/conf-available/remoteapp-web.conf /etc/apache2/conf-enabled/remoteapp-web.conf systemctl restart apache2
After starting services, the application functionality is available on port 8080 through any browser:
http://HOST_IP:8080
Configuration file¶
Configuration file is presented in ini
format and consists of the following sections and parameters:
Section | Parameter | Description | Default value |
---|---|---|---|
DEFAULT |
log_level |
Parameter that specifies the set level logging. Detail description is available in section Logging levels. | INFO |
DEFAULT |
api_logfile |
Name and path to the log file. | /var/log/remoteapp/api.log |
DEFAULT |
db_url |
Setting up connection to database. | mysql+pymysql://aos:password@localhost:3306/remoteapp |
DEFAULT |
max_pool_size |
This is the largest number of connections that will be kept persistently in the pool. | 5 |
DEFAULT |
max_overflow |
The maximum number of additional connections that can be created when the maximum number of active connections limit is reached. | 50 |
DEFAULT |
pool_recycle |
What amount of time must pass before database connections are reloaded. | 3600 |
DEFAULT |
pool_timeout |
How long (in seconds) a database connection must attempt to establish before it is considered unsuccessful. | 30 |
DEFAULT |
retry_interval |
What amount of time should pass before retrying to establish a connection to the database if it fails. | 2 |
DEFAULT |
max_retries |
Maximum number of attempts to establish a connection to the database. | 5 |
DEFAULT |
cloud_url |
Cloud URL that the app will work with. | localhost |
DEFAULT |
cloud_admin |
Name of user for creating and registering applications. | remote |
DEFAULT |
api_ip |
URL-address that remoteapp API service will run. | 127.0.0.1 |
DEFAULT |
api_port |
Port that remoteapp API service will run. | 8001 |
DEFAULT |
templates |
Path to templates for generating remote connection files. | /etc/remoteapp/templates |
DEFAULT |
ra_files |
Path to remote connection files. | /var/lib/remoteapp |
DEFAULT |
redis_url |
Setting up connection to Redis. | redis://:password@localhost:6379/0 |
DEFAULT |
session_lifetime |
Session duration for Redis (in seconds). | 86400 |
DEFAULT |
session_cookie_secure |
Setting the secure flag to receive browser cookies via HTTPS. | False |
DEFAULT |
messaging_url |
Connection string to RabbitMQ. | amqp://aos:password@localhost:5672/aos |
DEFAULT |
nova_rabbit_vhost |
Virtual host of Nova service message broker. | / |