Omnis Technical Note TNWE0019 January 2008
Using the Omnis Server with Apache on Mac OS X 10.5
For Omnis Studio 4.3
By Omnis Tech Support
The Apache Web Service called 'Web Sharing' can be started/stopped or restarted via Finder/System Preferences/Web Sharing/Personal Web Sharing. Note that after stopping the service you must wait 20-30 seconds before attempting to restart the service, since Mac OS X needs some time to release all of the service connections. Note also that, at present, it is not possible to use the Omnis Mod_Omnis.so package with Mac OS X 10.5 (Leopard) so you will need to use the NPH-OmnisCGI web server plug-in. This component enables communication between clients and the Omnis Server running your application.
Installing the Omnis Components into Apache
The Omnis web server components can be found by opening the Omnis Package; to do this select the Omnis Package and Right Click (Ctrl + Click) and select Show Package Contents from the context menu, then navigate to /Contents/Mac OS. The NPH-OmnisCGI can be found in the Studio/clientserver/server/apache2 folder, while OmnisWebClient.js can be found in the Studio/HTML folder. Using the Finder, copy the Omnis NPH-OmnisCGI web server component into /Library/WebServer/CGI-Executables. Then copy the OmnisWebClient.js file into /Library/WebServer/Documents.
You will also need to place a copy of the initial Remote Forms HTML into the /Library/WebServer/Documents folder, but prior to doing so you will have to make the following changes to the HTML; the file can be found in the Studio/HTML folder after having tested the Remote Form (using Ctrl+T, or using Open Remote Form).
• OSServer Must point to the Server Port of the Omnis Server that
is running your Omnis application (typically port number 5912)
• OWebServerURL Must point to the ServerURL / Domain Name Server (DNS) or IP Address of your Web Server
• OWebServerScript Must point to the Omnis component within the Apache Executable folder, for Mac OS 10.5 this has to be /CGI-BIN/NPH-OmnisCGI. Note that the /CGI-BIN is translated within the Apache.conf file to point to the /WebServer/CGI-Executables.
Testing the Apache Web Server
Ensure that Personal Web Sharing is enabled and then start a Web Browser, preferably on the same PC that the Web Server is being hosted. Enter the URL as //LocalHost or as an IP-Address 127.0.0.1. This will either display a successful connection, or a failure. If this fails, you will need to investigate why Apache Web Server is not running.
Repeat the above test from a locally connected PC and entering the IP Address of the PC hosting the Apache Web Server as the URL. Again, you will either get a successful connection or a failure. A failure usually indicates that the Firewall on the PC hosting the Apache Web Server is blocking port 80 (or the port defined in the Apache.Conf file).
Testing the Omnis Server
Start the Omnis Server and open your library. You can use the development
version of Omnis to test your web application, but your serial number
must support web client connections, so it must contain 'nnnW'. Ensure
that the Omnis preference $pref.$serverport of your Omnis Server is set
to the correct value (the same as the OSServer value in your HTML). You
must restart Omnis if you change the server port value.
On the Local PC, will need to install the Omnis Web Client plug-in; you can download a copy from the Omnis web site. On the local PC, using a suitable Web Browser enter the URL as:
Where IP-Address is the PC that is hosting the Apache Web Server, and RemoteForm-Name is the name of the HTML file containing your remote form that was placed into the /Library/WebServer/Documents Folder. Note that the IP-Address and the RemoteForm-Name are not case sensitive.
If you are using the Omnis Web Client Plug-in, you should see the Raining Data animated logo and then you may be prompted to download additional remote form components.
If the remote form is not displayed, then retest after having enabled the Omnis Server Port (typically 5912) within the Firewall for the PC that is hosting the Omnis Server.