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
  1. 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 file pip_before.txt with list of installed applications.

  2. Install package RemoteApp:

    pip3 install remoteapp
    
  3. Save the list of installed packages after installation to be able to roll back changes:

    pip3 freeze > /tmp/rollback/remoteapp/pip_after.txt
    
  4. Set up environment variables:

    export PIP_INDEX_URL=http://pypi.accentos.ru/simple/
    export PIP_TRUSTED_HOST=pypi.accentos.ru
    

Configuration

  1. Add user:

    adduser --system --group --disabled-login aos
    
  2. Create directory for config files with the right permissions:

    mkdir /etc/remoteapp
    chown -R aos:aos /etc/remoteapp
    
  3. 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/
    
  4. Create a directory for remote connection files with the required permissions. For example:

    mkdir /var/lib/remoteapp/
    chown -R aos:aos /var/lib/remoteapp/
    
  5. 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
    
  6. Perform command remoteapp-configure to configure systemd service files:

    remoteapp-configure
    
  7. Migrate database:

    FLASK_APP=remoteapp.cloudapi.app flask db upgrade
    
  8. In the configuration file, specify the address of cloud with which the application will work. Change other parameters as needed.

  9. 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
    
  10. 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.
  11. 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
    
  12. 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 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