User Guide
Mini SQL is generally distributed in source code form to enable the widest possible use of the software. It is not feasible for binary distributions to be generated for every UNIX platform for each release of mSQL. Instead, the software and the installation tools have been made as portable as possible. In general, the software will automatically configure itself to the capabilities of the operating system on which it is being compiled. Typing four commands can complete the process of compiling and installing mSQL on most UNIX platforms. Only under extreme situations will the software not compile "out of the box". Hints for getting the software compiled on troublesome operating systems is available in the Installation Troubleshooting section below.
The software is distributed as a gziped (i.e. compressed) tar file. Tar is a standard UNIX facility for combining many files and directories into a single archive file. The tar utility should be available on any modern UNIX system. If your system does not provide the tar utility then a freely available version of tar has been produced by the Free Software Foundation (the GNU project). The GNU version of tar can be found on any GNU archive site. Similarly, the gzip compression tools are produced by the Free Software Foundation. If your system does not provide the gzip or gunzip utility then you will need to obtain these from your nearest GNU archive site.
The table below shows a selection of commonly used GNU
archive sites. To access these site use anonymous FTP (or the URL provided).
A complete list of GNU software mirror sites can be found at http://www.gnu.org/order/ftp.html.
|
|
|
|
Australia | archie.au | /gnu | ftp://archie.au/gnu |
U.S.A | prep.mit.edu | /pub/gnu | ftp://prep.mit.edu/pub/gnu |
U.S.A | ftp.uu.net | /systems/gnu | ftp://ftp.uu.net/systems/gnu |
U.S.A | gatekeeper.dec.com | /pub/GNU | ftp://gatekeeper.dec.com/pub/GNU |
United Kingdom | ftp.mcc.ac.uk | /pub/gnu | ftp://ftp.mcc.ac.uk/pub/gnu |
tar -xvf msq-2.0-rel.tar
Or
gzcat msql-2.0-rel.tar.gz
| tar -xvf -
The mSQL distribution is structured to allow it to be
compiled on multiple machines using the same copy of the source code (source
tree). For example, the source tree can be shared between various machines
using NFS and versions for each machine type can be compiled in the same
source tree. To achieve this, mSQL uses target directories for each machine
type (hardware platform and operating system combination). To create a
target directory for your machine simply type the following from the top
directory of the distribution
To continue the compilation process, change directory
to your target directory using ?cd targets/SunOS-4.1.4-Sparc? for example.
Once you are in the target directory you can configure the compilation
process. The configuration process is totally automatic and will determine
what system calls, library functions, and header files your operating system
provides. To configure the compilation process simply type
Once the automatic configuration is complete you may either compile the software using the default configuration settings or change the configuration settings from their default value. There are two configuration items located in the site.mm file in the targets directory that you may consider modifying. The configuration utility will try to determine the best C compiler to use on your system. If you have multiple C compilers (a system compiler and gcc for example) you may wish to modify the CC entry in site.mm.
The only other option in site.mm that may require modification is the INST_DIR entry. This entry defines the default installation directory. This setting is not only used during installation of the software but also as the directory containing the run-time configuration file. If you intend running mSQL from a directory other than the default /usr/local/Hughes directory then modify the INST_DIR entry in site.mm to reflect your installation directory.
Installation of mSQL can also be achieved using a single
command, although you may need to have special permissions on your UNIX
system (usually root access). By default, mSQL will be installed in a directory
called /usr/local/Hughes on your system. If /usr/local is root owned on
your system (as it is on most systems) then you will either need root access
or you will have to get your system administrator to complete the installation
for you. If you are using a non-default installation directory then ensure
that you have the required permissions to create the directory you specified.
To complete the installation simply type
To overcome this problem, mSQL 2.0 utilises an external
run-time configuration file for definition of all these values. The file
is called msql.conf and is located in the installation directory (usually
/usr/local/Hughes). An application can choose to use a different configuration
file by calling the new msqlLoadConfigFile( ) API function. All standard
mSQL applications and utilities provide a command line flag, -f ConfFile
, that allows you to specify a non-standard configuration file. When an
application first calls the mSQL API library, a check is made to see if
a configuration file has been loaded via a call to the msqlLoadConfigFile(
) function. If no such call has been made, the API library loads the default
config file. Any values that are specified in that file will over-ride
the normal operating parameters used by mSQL. If no configuration file
is found (or certain items are not set) then the default values listed
below will be used.
Configuration values within a section are presented using the config parameter name followed by an equals sign and then the new value. There can only be one entry per line and if an entry is defined multiple times in the one config file the last value defined will be used. If a parameter is not defined in the config file then an internal default value will be used at run-time.
|
|
|
Inst_Dir | /usr/local/Hughes | The full path to the installation directory. This is the directory in which all the mSQL files are located (such as the program files, the database files etc). |
mSQL_User | msql | The user that the mSQL server should run as. If a user other than this user starts the server (e.g. it is started as root from a boot script) it will attempt to change UID so that it runs as the specified user. |
Admin_User | root | The user that is allowed to perform privileged operations such as server shutdown, creation of databases etc. |
Pid_File | %I/msql2.pid | The full path of a file in which the PID of the running mSQL server process will be stored. |
TCP_Port | 1114 | The TCP port number on which the mSQL server will accept client/server connections over a TCP/IP network. If this value is modified it must be modified on the machine running the client software also. |
UNIX_Port | %I/msql2.sock | The full path name of the UNIX domain socket created by the mSQL server for connections from client applications running on the same machine. |
Elements of the W3-mSQL section
|
|
|
Auth_Host | NULL | The machine on which the mSQL database containing W3-Auth data is located. See the W3-Auth section for further details. If set to NULL (the default value) the database is assumed to be on the local host. |
Hughes_Footer | True | Controls the appending of the standard Hughes Technologies footer to Web Pages. |
Private_Only | False | If set to True, the W3-mSQL interface will only process private pages (see the W3-mSQL section for information on private pages). This may be used to enforce strict security on your system stopping remote users accessing normal HTML pages via the W3-mSQL cgi program. |
Elements of the System section
|
|
|
Msynch_Timer | 30 | Defines the interval in seconds at which the memory mapped data regions maintained in the mSQL server process will be synched with the on-disk images. Setting this value to 0 will disable forced synchronisation of the data and rely on the kernel?s synch?ing of the mmap regions. |
Host_Lookup | True | Determines whether ip address to hostname lookups are required. If set to true, connections by hosts that do not resolve to a hostname will be rejected. |
Read_Only | False | Forces the server to operate in
read-only mode. Any attempts to modify the database will be rejected (.e.
the only commands accepted are select queries).
This option can be used if multiple database servers are to be run using the same data files. In such a case only one server should be running in read-write mode with all others running in read-only mode. This can easily be achieved by using different configuration files (specifying different TCP and UNIX ports as well) and loading the appropriate config file in the client application. |
# msql.conf - Configuration file for Mini SQL Version 2.0
#
# This configuration sets all options to their default values.
# Note : %I is expanded to the value of the Inst_Dir element is included in a value.
#
[general]
Inst_Dir = /usr/local/Hughes
mSQL_User = msql
Admin_User = root
Pid_File = %I/msql2.pid
TCP_Port = 1114
UNIX_Port = %I/msql2.sock
[w3-msql]
Auth_Host = NULL
Hughes_Footer = True
Private_Only = False
[system]
Msynch_Timer = 30
Host_Lookup = True
Read_Only = False
Step 1 Unpack the software distribution using gunzip and tar
tar -xvf msql-2.0-rel.tar
Or
gzcat msql-2.0-rel.tar.gz | tar -xvf -
make target
./setup
Step 5 Compile the software
dynamic loading Some of the mSQL tools utilise
dynamic loading of object modules (most notably the Lite and W3-mSQL tools).
The setup utility will try to determine how to perform dynamic loading
on your platform automatically. If you encounter link problems with references
to functions such as dl_open then the automatic configuration has failed.
You can safely remove the dynamic loading functionality by editing the
site.mm and removing the "HAVE_DYNAMIC" option.
Linux Some distributions of Linux, including the Slackware distribution, do not include all the required C header files by default. If you did not include the kernel sources when you installed your version of Linux you may not be able to compile the mSQL software. Installing the kernel sources will solve this problem.
bitypes On some systems, the compilation of mSQL will fail with errors relating to the bitypes.h header file. This is commonly due to the installation of BIND 4.9 nameserver software. BIND replaces some of your header files during installation but fails to re-install the bitypes.h and cdefs.h files. The problem is solved by copying these header files from the compat/include directory of the BIND distribution to the /usr/include/sys directory of your system.
Irix Some installations of Irix include duplicate versions of several system routines in separate C libraries. The setup utility will recognise these libraries and include them in the link process automatically. This can cause errors relating to "weak definitions" and also unresolved symbols. To overcome this problem, edit the site.mm file and remove anything included on the EXTRA_LIBS line (i.e. set it to "EXTRA_LIBS=")