Lianja Server Manager on Mac

From Lianjapedia
Jump to: navigation, search

The Lianja Server on Mac

The Lianja Server on Mac listens for requests for both the Lianja SQL Server and the Lianja Cloud Server. The Lianja Server needs to be running and have a valid and activated license for the requested Server.

See Also

Install Cloud Server on Mac, Install SQL Server on Mac, Lianja ODBC Driver on Linux, Lianja ODBC Driver on Windows, Lianja ODBC Manager on Windows, Lianja Server Manager on Windows, License Management on Mac, SQL System Tables

Managing the Lianja Server on Mac

The lianja-admin command is used to manage the Lianja Server. It must be run with 'sudo':

lianja-admin start [logging] | stop | restart [logging] | status
Option Description
start [logging] Start the Lianja Server.
If the optional logging argument is specified, logging is enabled. By default, log files are created in the /opt/lianja/cloudserver/tenants/public/log/ directory.
An alternative directory can be specified in the DB_LOGDIR environment variable in lianja.conf (see below).
stop Stop the Lianja Server.
restart [logging] Restart the Lianja Server.
If the optional logging argument is specified, logging is enabled. By default, log files are created in the /opt/lianja/cloudserver/tenants/public/log/ directory.
An alternative directory can be specified in the DB_LOGDIR environment variable in lianja.conf (see below).
status Report the status of the Lianja Server.

Configuration

The Lianja Server configuration file is /usr/local/lianja/server/conf/lianja.conf. Edit this text file to change the configuration environment variables. The Lianja Server should be restarted to reflect changes.

lianja-admin sets DB_ROOT to /usr/local/lianja/server/

#!/bin/sh
#==============================================================================
# This is the main Lianja SQL Server configuration file. 
#==============================================================================
#
# Specify API Key for package uploads
DB_APIKEY=""                                    ; export DB_APIKEY
#
DB_WWWDEBUG="false"                             ; export DB_WWWDEBUG
#
# Enable/disable reCAPTCHA on login
DB_WWWRECAPTCHA="false"                         ;export DB_WWWRECAPTCHA
#
# Used to define the date format for the license expiry date.
DB_DATE="american"	 			;export DB_DATE
#
# Used for increased SCO FoxPlus compatibility.
DB_FOXPLUSBUGS="no"                             ;export DB_FOXPLUSBUGS
#
# Used to define the internal heap size, should not be changed
DB_HEAPSIZE=32                                  ;export DB_HEAPSIZE
#
# Used to specify the number of multiple log files to be kept.
DB_LOGVER=10					;export DB_LOGVER
#
# Used to define the maximum number of available cursors.
DB_MAXWKA=100					;export DB_MAXWKA
#
# Used to determine whether the evaluation of logical expressions should be
# optimized.
DB_OPTLOG="OFF"                                 ;export DB_OPTLOG
#
# Used to determine whether the printer eject command is issued by
# SET PRINT OFF.
DB_PRINTEREJECT="no"                            ;export DB_PRINTEREJECT
#
# Used to define check for and report errors in Linux/UNIX printing scripts.
DB_PRINTERROR="no"                              ;export DB_PRINTERROR
#
# Used to enable support of Samba locking.
DB_SAMBA="no"                                   ;export DB_SAMBA
#
# Used to Enable/Disable Multi Processor Sleep Loop 
DB_SLEEP="no"					;export DB_SLEEP
#
# Used to define the number of preallocated symbols for memory variables.
DB_SYMBOLS=200 					;export DB_SYMBOLS
#
# Used to determine whether calls to operating system commands should be
# enabled or disabled.
DB_RUNLOG="FALSE"                               ;export DB_RUNLOG
#
# Used to determine whether the Linux/UNIX PATH should be included in the
# SET PATH list.
DB_UNIXPATH="no"                                ;export DB_UNIXPATH
#
# system wide configuration file for Lianja SQL Server
DB_CONFIG="${DB_ROOT}conf/config.db"           	;export DB_CONFIG
#
# Used to define a directory for Lianja config files.
DB_CONFIGDIR="${DB_ROOT}conf/"           	;export DB_CONFIGDIR
#
# Used to define the language and database compatiblity
DB_COMPAT="${DB_ROOT}/conf/compat.db"         	;export DB_COMPAT
#
# Used to define a default debug directory for Lianja
DB_DEBUGDIR="${DB_ROOT}debug/"                  ;export DB_DEBUGDIR
#
# Used to define a default data directory for Lianja databases.
DB_DATADIR="${DB_ROOT}data/"                   	;export DB_DATADIR
#
# Used to define a default directory for backing up Lianja databases.
DB_BACKUPDIR="${DB_DATADIR}backups/"         	;export DB_BACKUPDIR
#
# Used to define a default error directory for Lianja
DB_ERRORDIR="${DB_ROOT}error/"			;export DB_ERRORDIR
#
# Used to define the directory where the shared libraries are loaded.
DB_LIBDIR="${DB_ROOT}extensions/"               ;export DB_LIBDIR
#
# Used to specify the directory in which log files should be created.
DB_LOGDIR=${DB_ROOT}log/			;export DB_LOGDIR
#
# Used to specify the full path name of a directory for temporary printer
# file creation.
DB_SPOOLDIR="" 					;export DB_SPOOLDIR
#
# Used to specify the full path name of a directory or folder for temporary
# file creation.
if [ "${TMPDIR}" != "" ];then
    DB_TMPDIR="${TMPDIR}/"                     	;export DB_TMPDIR
else
    DB_TMPDIR="${DB_ROOT}tmp/"                  ;export DB_TMPDIR
fi
#
# Used to specify a directory and filename to which user specific logging
# information should be written.
DB_USERLOG="${DB_ROOT}log/${LOGNAME}.log"       ;export DB_USERLOG
#
# Used to define a default directory for Lianja licenses.
DB_LICENSE="${DB_ROOT}licenses/"               	;export DB_LICENSE
#
# Used to specify optional printer commands when using the ">" as the printer
# output.
DB_PRINTOPT=""		 			;export DB_PRINTOPT
#
# Used to specify optional printer commands when using the ">" as the printer
# output.
DB_PRINTOPT="-onobanner -c"			;export DB_PRINTOPT
#
# Used to determine whether the Lianja SQL Server allows local connections
# from specific non-authenticated users.
DB_LOCAL_LOGIN=yes				;export DB_LOCAL_LOGIN
#
# Used to determine whether the Lianja Server expects username
# and password information in connection strings to be encrypted.
DB_ENCRYPTION=no				;export DB_ENCRYPTION
#
# HTTP Service 
DB_HTTP_ENABLED="true"                          ;export DB_HTTP_ENABLED
#
# OData Service
DB_ODATA_READ_ENABLED="true"			;export DB_ODATA_READ_ENABLED
DB_ODATA_UPDATE_ENABLED="true"			;export DB_ODATA_UPDATE_ENABLED
#
# WebSocket Service
DB_WEBSOCKETS_ENABLED="true"			;export DB_WEBSOCKETS_ENABLED
#
# Used to determine if the HTTP Server will also listen on port 80
DB_PORT80_ENABLED="false"                       ;export DB_PORT80_ENABLED
#
# Used to specify a default user account that the HTTP service will run as.
#DB_WWWACCOUNT="root"                           ;export DB_WWWACCOUNT
#
# Used to specify the default web page that will be displayed.
DB_WWWDEFAULT="login.rsp"                     ;export DB_WWWDEFAULT
#
# Used to specify the password for the default user. This is stored in base 64.
#DB_WWWPASSWORD=""                              ;export DB_WWWPASSWORD
#
# Used to specify the file that contains the base 64 encypted password to use
# for the default login user.  Use the lianja-admin command to manage this file.
DB_WWWPWFILE="${DB_ROOT}conf/passwd.db" 	;export DB_WWWPWFILE
#
# Used to determine if the HTTP server can run as a guest account.
DB_WWWRUNASGUEST="true"                        	;export DB_WWWRUNASGUEST
#
# Used to disable PAM (Pluggable Authentication Module) user authentication.
# If this is disabled then ftp will be used for user authentication.
DB_NOPAM="FALSE"				;export DB_NOPAM
#
# Used to determine if how linger is set on the connected sockets.
DB_SET_LINGER="TRUE"				;export DB_SET_LINGER

# Network protocol for Lianja Server Interface.
RSI_PROTOCOL=TCPIP 				;export RSI_PROTOCOL
#
# Used to specify the number of reties performed on a connect.
RSI_RETRIES=30					;export RSI_RETRIES
#
# Used to specify the number of seconds to wait between reties.
RSI_TIMEOUT=1					;export RSI_TIMEOUT
#
# Used to specify the number of seconds waited for the server to start.
RSI_SPAWNWAIT=10				;export RSI_SPAWNWAIT
#
# The root location of the HTTP server web root
DB_WWWROOT=${DB_ROOT}wwwroot/                  	;export DB_WWWROOT
#
# The location of the HTTP server apps
DB_APPSDIR=${DB_WWWROOT}apps/                  	;export DB_APPSDIR
#
# The location of the HTTP server apps
DB_LIBRARYDIR=${DB_WWWROOT}library/             ;export DB_LIBRARYDIR
#
# Used to specify the name of a file containing IP addresses allowed to
# connect to the Lianja SQL Server
DB_UAS_ALLOW="${DB_CONFIGDIR}hosts.allow"	;export DB_UAS_ALLOW
#
# Used to specify the name of a file containing IP addresses denied from
# connecting to the Lianja SQL Server
DB_UAS_DENY="${DB_CONFIGDIR}hosts.deny"		;export DB_UAS_DENY
#
# Used to specify the name of a file containing IP addresses allowed to
# connect to the Lianja HTTP Server.
DB_HTTP_ALLOW="${DB_CONFIGDIR}hosts.allow"	;export DB_HTTP_ALLOW
#
# Used to specify the name of a file containing IP addresses denied from
# connecting to the Lianja HTTP Server.
DB_HTTP_DENY="${DB_CONFIGDIR}hosts.deny"	;export DB_HTTP_DENY
#
#------------------------------------------------------------------------------

DB_WWWRECAPTCHA

From Lianja v4.1 the DB_WWWRECAPTCHA environment variable enables ("true") or disables ("false") the inclusion of Google reCAPTCHA in the login page. See Customizing the Login Page for more details.

DB_WWWRECAPTCHA="true";export DB_WWWRECAPTCHA

Allowing Unauthenticated Apps

From Lianja v5.2, two environment variables have been introduced to handle the support of unauthenticated Apps. By default, a user needs successful authentication of their username and password before being able to access an App.

DB_ALLOWUNAUTHENTICATED_APPS

If the DB_ALLOWUNAUTHENTICATED_APPS environment variable is set to 'true' in the lianja.conf configuration file, Apps that have the Enable guest access App Setting checked and appear in the DB_UNAUTHENTICATED_APPS list can be accessed without authentication.

DB_ALLOWUNAUTHENTICATED_APPS="true";export DB_ALLOWUNAUTHENTICATED_APPS

DB_UNAUTHENTICATED_APPS

The DB_UNAUTHENTICATED_APPS environment variable should be specified in the lianja.conf configuration file as a comma-separated list of App names for Apps that allow unauthenticated access, e.g.

DB_UNAUTHENTICATED_APPS="example_webapp1,example_webapp2";export DB_UNAUTHENTICATED_APPS

As above, the DB_ALLOWUNAUTHENTICATED_APPS environment variable must also be set to 'true' in the lianja.conf configuration file.

User Self-Registration

For details on self-registration (from v8.0), see Cloud Server Registrations.

DB_REGISTRATION_ENABLED

The DB_REGISTRATION_ENABLED environment variable should be set to 'ON' to enable user self-registration.

DB_REGISTRATION_ENABLED="ON";export DB_REGISTRATION_ENABLED

DB_REGISTRATION_ROLES

The DB_REGISTRATION_ROLES environment variable should be set to a comma-separated list of roles to specify the role(s) for self-registering users.

DB_REGISTRATION_ROLES="news,events,general";export DB_REGISTRATION_ROLES

One-Time Passcode Two Factor Authentication

For details on two factor authentication (from v8.0), see Customizing the Login Page:One-Time Passcode Two Factor Authentication.

DB_2FA_ENABLED to 'true'

The DB_2FA_ENABLED environment variable should be set to 'true' to enable two factor authentication.

DB_2FA_ENABLED="true";export DB_2FA_ENABLED