Stand-alone XApp with Morfik Apache 1.3
From Morfik Wiki
These are basic instructions on how to compile and run XApps under Linux. It has been tested on Fedora Core 4, openSUSE 10.1, Debian 3.1, Ubuntu 7.10, Ubuntu 7.10 Server Edition, Ubuntu 8.
Compiling an XApp
- Open the XApp project to be compiled for Linux OS.
- In the Morfik Options Dialog, in the Compiler Tab, select ‘Linux, Intel x86’ from Target Platform drop down box.
- Click OK and then compile the project.
- The linker will fail if the path of the project file contains spaces. The workaround is to copy the project folder to some path without spaces (say c:\myproject\)
- That’s it!
Prepare your Server:
- First you must prepare your server (this only has to be done once).
- Depending on the system you use you may want to try out one of the following tutorials (These tutorials are highly recommended, as they cover and download all the library's that the xApp Requires):
|
|
|
|
|
|
Installing Firebird:
- Download and install firebird 2.0 database for your Linux platform.
- Make Sure that firebird 2.0 has been installed as some linux distro's like Ubuntu download firebird 1.5 instead (when you do apt-get install firebird).
- This site shows you how to download firebird 2.0 for Ubuntu. Install Firebird for Ubuntu.
- Copy the supplied mfkudf.dll to the UDF directory, where Firebird was installed (make sure the permission rights are correct on this file eg chmod g+rx mfkudf.dll)
- On Ubuntu this directory is located in the "/usr/lib/firebird/2.*/UDF/". On Ubuntu 8.04, Firebird is installed in /opt/firebird.
- Change the sysdba password to ‘masterkey’. (there is a tool under …./firebird/bin dir called gsec. Run gsec like the following example: ./gsec –user sysdba –password thepassword . You most likely find the password for sysdba in a file under main directory where Firebird was installed called SYSDBA.password. Once gsec is running then use this command to change the password to masterkey: “modify sysdba –pw masterkey”.
- Make the user under which the XApp runs, a member of Firebird group.
- If you wish to create a new user use the "sudo useradd -G {firebird} username" command (without quotation marks, and replace username with the user name you wish to specify).
- If you wish to add a existing user to a group use the "sudo usermod -a -G firebird username" command (without quotation marks, and replace username with the user name you wish to specify).
- Copy the supplied libhttpd.so to /usr/lib and set its executable permissions to (755). This can be set with the following command: sudo chmod 755 /usr/lib/libhttpd.so
- Following is a list of other lib files which you may need to have (a version of) on your Linux system. If you don’t have them, find the required package and install them. (The 'Prepare your Server' tutorial above would of downloaded the libraries needed to run your xApp):
- libc.so
- libcrypt.so
- libdl.so
- libpthread.so
- librt.so
- libuuid.so
Installing/Running XApps
- Copy to Linux target the following files (mind capitalization):
- Binary executable file of an XApp - XXX
- Project file for an XApp, which describes source files, tables, queries, etc that are part of a project - XXX.Mxp
- Resources file for an XApp, which contains images, text files, etc that are added into a project - XXX.Mxr
- A Firebird database file; the primary database for an XApp - XXX.Mxd
- Web Service Description Language file describing how other applications can access the services exposed by an XApp - XXX.wsdl
- For example, for the Northwind project
- The required files would be: "Northwind", "Northwind.Mxp", "Northwind.Mxr" and "Northwind.Mxd".
- Firebird should have read and write access to database file (chmod 666 “databasefile" to get right file permission rw-rw-rw-) and execution rights to binary file.
- Run the application. (Recommended that the application not be run as the root user, for better security, you may require the sudo command for it to run).
| Note: | If you experience problems and are unable to resolve it yourself, please send us a detailed error-report and if possible include the results of a strace log (zipped, please).
To get the strace, run the application as follows: strace -f -o myfile.log -s 255 myapplication (eg. strace -f -o northwind.log -s 255 ./Northwind). This should provide you with a myfile.log file which should help us diagnose the problem (you may want to peek inside; maybe you'll find the reason for the faulty behavior yourself?) |
Files Needed
Related Topics

