# Configuration Procedures

PxPlus SQL Server Configuration (UNIX/Linux) |

There is no configuration interface for the PxPlus SQL Server installed on a UNIX/Linux system. Instead, the server behavior is controlled via Command Line arguments and a plain text configuration file (pxpsqlsvr.conf).

For a description of UNIX/Linux PxPlus SQL Server components and file locations, see ODBC Product Installation and Activation (UNIX/Linux).

## Configuration File

The UNIX/Linux version of the SQL Server must have access to the pxpsqlsvr.conf file to be configured for use. If this file cannot be located, the SQL Server will attempt to automatically create one based on the pxpsqlsvr.conf.sample file provided with the installation .taz file. If neither of these files can be accessed, an error is reported. If the activation key is invalid, the server will operate in Demo mode. If the port number is invalid, it will default to 20222.

The server checks for these entries in the pxpsqlsvr.conf file:

TCP/IP Port Number | TCP port number on which the server will listen. The default value is 20222. Enter the port number as follows: `port=20222`
SSL | Enable SSL encrypted TCP/IP communication. Enter the SSL certificate path (should be in PEM format) as follows: ssl=/usr/certs/sslcert.pem #### Note: PxPlus SQL Server uses OpenSSL libraries to provide SSL/TLS functionality. An X509 certificate created for use with OpenSSL or Apache is needed. (Apache also uses OpenSSL libraries.) An X509 certificate usually comes in the form of a PEM file, which contains both the certificate and private key. (SSL support was added in version 8.00.0000/PxPlus 2024.)
Activation Information | Activation information for running this software. Enter your activation information as follows: `serial=xxxxx-y- zzzzzzzzzzzzzzzz` Where:
| xxxxx | Serial Number
| y | User Count
| zzzzzzzzzzzzzzzz | Activation Key
If purchasing a Professional or Web version of PxPlus that includes SQL ODBC Driver support, you must use the Serial Number, User Count, and ODBC Activation Key of your PxPlus Professional or Web license. To run the SQL Server in demonstration mode, set the serial= entry to a blank value. This will allow one user to access the server with demo messages appearing periodically on the client's screen.
View Library Path | Path to the libpvx.so library usually found in the PxPlus install directory. Example: ViewLib=/pxplus #### Note: PxPlus needs to be properly activated for Views to work.
Catalog Definitions | Define sets of data that the SQL server can access. The client will use the Catalog Name to tell the server what data it wants to access. A maximum number of 256 catalogs may be defined. #### Note: At least one catalog must be defined; otherwise, the server will not start. The format for a catalog definition is: CatalogName=*[DDPath][INIPath][Prefix] Where:
| CatalogName | Name of the catalog. It can be entered into the DSN configuration on the client.
| * | Indicates the default catalog. There can be only one default.
| DDPath | Location of the PxPlus Data Dictionary file (providex.ddf).
| INIPath | Path and name of the INI file used to define the data dictionary manually.
| Prefix | Search paths to be inserted in front of all relative file references used in Data Dictionary or INI definitions. As of PxPlus 2018, Equals Sign and Asterisks substitution is supported. Use a , (comma) as the separator between multiple prefixes.
(Catalog support was added in PxPlus 2018.) (Support for up to 256 catalogs was added in PxPlus 2019.)
File Access Security Policies | Security, as in: `*/*=[a][r][*][*]` Customizable security for users and files. The server initially defaults to "no access". Security rules must be established to provide access to the data. For information on the security syntax and permissions sequence, see Permissions. The above settings, which appear in the sample configuration file, grant users almost unrestricted Read access to the server's data sources. An * (asterisk) indicates any. Therefore, for security reasons, you should reset these parameters based on your own business rules prior to operating the server in a live environment.

## Permissions

The PxPlus SQL Server Configuration file allows customizable security for users and files. Security entries are case-insensitive except where noted. All the non-alpha characters, "/ = [ ]", are part of the security syntax.

The format of a security policy appears as:

> `User ID` `/ Company Code=[Mode][Type][Data Dictionary][INIFile]`

Where:

User ID | Specific User ID supplied by the client driver. An * (asterisk) signifies all User IDs. Spaces are significant. "John /"and "John/" are considered two different entries.
Company Code | Specific Company Code supplied by the client driver. An * (asterisk) signifies all Company Codes. Spaces are significant. "/ ABC" and "/ABC" are considered two different entries.
Mode | Either A for Access or D for Denied. If in Denied mode, the Administrator can temporarily deny access without removing the policy entry.
Type | Either R for Read Only or RW for Read Write.
Data Dictionary | A comma or semi-colon separated list of paths to the providex.ddf files to which the client's DSN will have access. An * (asterisk) signifies that any Data Dictionary path is valid. This entry is case sensitive. #### Note: This field must not include the data dictionary file name. Example: If the providex.ddf file is located at /pxp/data/providex.ddf, then use /pxp/data.
INIFile | Comma or semi-colon separated list of paths and file names of INI files to which the client's DSN will have access. An * (asterisk) signifies any INI file path and file name. This entry is case sensitive. #### Note: This field must include the INI file name. Example: If the INI file is located at /pxp/data/mydata.ini, then use /pxp/data/mydata.ini.

The PxPlus SQL Server 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 * ( any) and the combination for User ID = any 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 = any, and the last check is for User ID = any, Company Code = any.

Refer to the following table:

> Sequence | User ID | Company Code |
> 1. | Specific | Specific | Highest Restriction
> 2. | Any | Specific |
> 3. | Specific | Any |
> 4. | Any | Any | Lowest Restriction

By default, access to all SQL ODBC Driver resources is denied unless access is granted via a security policy configuration line.

#### Note:
Access policies are currently kept only by User ID/Company Code, which means that each User ID/Company Code may only have one policy entry.
It is not currently possible to specify that a specific User ID/Company Code has Read access to one set of entries and Read Write access to a different set of entries.

## Sample Configuration Entries

Below are sample configuration entries:

> serial=12345-6-123456789ABCDEF0
> port=20000
> catalogs:
> mydata=*[/pxp.mydata][/nomtrain/test.ini][]
> pxpdata=[/pxpdata][][]
> security:
> */*=[a][r][*][*]
> John/ABC=[D][RW][/pxpdata;/pxp/mydata][/nomtrain/test.ini]

## Automatic Start

#### Note:
The following method is an example intended for the Red Hat type inittab systems.
Other Linux versions may require system-specific Automatic Start procedures such as Debian and Ubuntu.

To have the UNIX/Linux PxPlus SQL Server start automatically, it must be set up in the inittab file. Each inittab entry is position dependent and has the following format:

> id: rstate: action: process

Where:

| id | Unique identifier for the entry.
| rstate | Run-level for which this entry is to be processed. More than one run-level can be specified.
| action | Actions to affect the process specified.
| process | Command to be executed by the system.

Example:

The following is an example of an inittab entry for the PxPlus SQL Server:

> podb:2:once:/usr/pxpsqlsvr/pxpsqlsvr -f /usr/pxpsqlsvr/myOdbc.conf </dev/null >/dev/null 2>&1

This example would start the PxPlus SQL Server the first time the server booted to run level 2. The configuration file named myOdbc.conf located in /usr/pxpsqlsvr/ would be used to configure the server. Any messages sent to standard out or standard error by the server would be suppressed. If the server stopped for any reason, the system will not restart it.

#### Warning!
Modifications to the inittab/startup scripts on a UNIX/Linux system may cause serious problems. All changes should be performed by qualified personnel.