# PxServer

Configuring PxServer |

## Windows

The server is configured in Windows via the PxServer Configuration application, PxServerConfig.exe, which can be accessed directly from the IDE Main Launcher (expand the Data Management category and select Configure PxServer) or from the Start menu entry. You can also double click the executable file name from within the PxPlus installation folder.

PxServer configuration allows you to set the server network settings, file I/O permissions and debug logging.

This window is divided into the following tabbed panels for viewing and/or changing the configuration settings: Server, Permissions, Service, Debug and About.

Server | Server configuration settings
Port | TCP/IP port number on which the PxServer will listen. Default port is 4193, which is registered with IANA to PVX Plus Technologies.
Keepalive Interval | Number of seconds between individual keepalive messages to maintain an active TCP/IP connection. The timeout of the TCP/IP connection is always double this value. Setting this value should be a balance between PxServer being responsive to losing a connection (timeout) and not tying up too many resources by sending keepalive messages. Default value is 60 seconds, making the default Timeout value 120 seconds.
Reconnect Timeout | Number of seconds that a session will persist (to allow for reconnections) before being deleted. Default is 120 seconds. Setting this value should balance the needs of users needing to reconnect and how much memory PxServer should use. The higher this value, the more memory is tied up by keep sessions around for possible reconnects.
Enable SSL Secure Communication | Check box to toggle between unencrypted TCP/IP communication and SSL encrypted TCP/IP communication. Default is unencrypted TCP/IP communication.
SSL Certificate | (Available when Enable SSL Secure Communication check box is selected) Specify the path and file name of the server's SSL certificate file. By default, this is blank. Click the Browse button beside the input field to select an SSL certificate file (should be in PEM format) using the Windows Open File dialog.
Prefix | A comma-separated list of search paths (without quotes) that the server should use when a relative pathname is used. By default, this is blank. Using = (equals sign) for matching and * (asterisks) for wildcards is also supported, similar to prefixes in PxPlus. See PREFIX Directive and Prefix Processing.
Enable Exclusive File Use | Check box to turn on or turn off exclusive file use. Default is Off. Turning On exclusive file use results in better performance but does not allow any processes other than PxServer to access any files that the PxServer has open. Turning Off exclusive file use allows other processes to access files that PxServer has open but sacrifices a little performance. (The Enable Exclusive File Use option was added in PxPlus 2019.)
Permissions | Settings to add, edit or remove access permissions
| The server starts with default access permissions. These permissions can be viewed/changed:
Setting | Default | Definition
Access | A | Access allowed
R/W | R | Read only
User ID | * | Any users
Company Code | * | Any company
Data Dictionary Path | * | Any data dictionaries
INI File Path | * | Any INI files
The above default settings grant users almost unrestricted read access to the server's data sources (* is a wildcard and will match any input). Therefore, for security reasons, you should reset the parameters based on your own business rules before the PxServer is used. PxServer checks access permissions by searching the permission rules from the maximum restriction to the lowest one. It is a method to grant access to specific directories on the server based on a client's User ID and Company Code. If the check for a specific User ID and Company Code fails, then the User ID is substituted with an * (wildcard) and the combination for User ID = * with Company Code = specific is checked against the corresponding rule if it is present on the system. The next check is performed for User ID = specific, Company Code = *, and the last check is for User ID = *, Company Code = *. Refer to the table below:
Sequence | User ID | Company Code |
1. | Specific | Specific | Highest Restriction
2. | * | Specific |
3. | Specific | * |
4. | * | * | Lowest Restriction
Example: In the previous example above, user John from ABC Company is granted access to the data files in the C:\workspace\data and/or C:\users\john\abc directories. According to this example, the server administrator has temporarily denied John access; however, John would still have read-only access to directories, as all users of all companies may access any directory.
Service | Settings to install and control the PxServer as a service
| The PxServer Windows service can be installed/uninstalled and controlled (Start, Stop and Restart). If the PxServer service is installed, the current status of the service will be displayed. If any action is taken, the result of that action will be displayed. You can also install/uninstall and control Windows services using the Windows Services interface accessed through the Control Panel (in the Administrative Tools sub-folder). #### Important Note: If any PxServer settings are changed, you will need to restart the service for the changes to take effect. (PxServer capability to run as a Window service was added in PxPlus 2019.)
Debug | Debug mode settings
Enable Debug | Check box to enable Debug mode and turn on logging.
Log File | Specify the path name of the log file to which to write log messages. Default is pxserver.log.
About | PxServer information
| Includes information about the PxServer version, as well as PVX Plus Technologies links.

## UNIX

In UNIX, the server is configured by editing the plain text Configuration file, pxserver.conf. The pxserver.conf file can be found in the PxPlus installation directory.

The Configuration file consists of "settings" entries with the format:

> setting=value

Comments are also allowed in the Configuration file and are indicated by any line that starts with the # (number sign). The default Configuration file provides several descriptive comments to make it easy to modify.

The default pxserver.conf is as follows:

> #Server Configuration
> # Port number (Default is 4193)
> # Keepalive message interval in seconds (Default is 60)
> # Reconnect wait period in seconds (Default is 120)
> port=4193
> keepalive interval=60
> reconnect timeout=120
> #SSL Configuration
> # SSL Certificate path
> # To enable SSL specify a certificate file
> #ssl=/myapp/sslcert.pem
> #Permissions Configuration
> # List of permission entries, a permission entry is of the form 'permission=User_ID,Company_Code,Access_Flag,Read_Write_Flag,Directories_&_Files'
> # User_ID - string representing a user ID, or '*' so this permission matches all user IDs
> # Company_Code - String representing a company code, or '*' so this permission matches all company codes
> # Access_Flag - 'A' for access is Allowed, or 'D' for access is Denied
> # Read_Write_Flag - 'R' for Read only access, or 'RW' for Read & Write access
> # Directories_&_Files - String that contains a comma separated list of directories & files that this permission allows access to, or '*' so this permission matches all directories & files
> permission=*,*,A,R,*
> #Prefix Configuration
> # Prefix paths
> # This is a comma separated list of prefixes.
> #prefix=/myapp/data/,/myapp/data/==/
> #Debug Configuration
> # Log File Path (Default is blank for no logging)
> log file path=
> #File Exclusivity Configuration
> # By turning this flag on PxServer will use exclusive file locks for improved performance
> exclusive=0