Tips   >   Internet   >   Web Server
Web Server
The
Omnis Web App Server process is activated by a CGI installed on the web server. The CGI listens for requests on the
$serverport specified in your Omnis Studio preferences (default 5912). When an HTTP POST or HTTP GET is received on the specified port the CGI forwards the request to the Omnis library and remote task class specified in the HTTP request. (
OmnisLibrary, OmnisClass) The Omnis Web App Server process instantiates the remote task passing along the HTTP POST or HTTP GET parameters to the
$construct method of the remote task.
Web Server Setup - Linux
The following information is outdated. You will need to interpolate the information and use at your own discretion.
I ran into some problems installing and setting up the Omnis Server on the Linux box which I use for serving the Vencor web site. The problems were inflicted because I downloaded the RPM from omnis.net rather than installing from the CD supplied by Omnis Studio. The downloaded RPM didn't automatically copy the .so files from the rainingdata folder to /usr/lib folder.
Here are the steps I followed for installing the Omnis Web Server onto my Linux box.
- Using a Linux web browser download the omnisserver.rpm file from Omnis Softwre.
- Save the rpm file to the home directory.
- Go to terminal mode.
- Go to the home directory.
- Switch to super user. Enter: su
- Install the packger. Enter: rpm-i omnisserver.rpm
This creates the necessary directories and puts the files in /usr/local/rainingdata/os321web. (321represents the Omnis version. This will vary depending on the version you are using.)
- Copy the nhp-omniscgi file to the cgi-bin directory.
- Go to the cgi-bin directory to make sure it exists. Enter: cd /var/www/cgi-bin
- Make sure the nhp file exists. Enter: ls /usr/local/rainingdata/os321web/webserver
- Copy the file to the cgi-bin directory.
Enter: cp /usr/local/rainingdata/os321web/webserver/nhp-omniscgi nhp-omniscgi
- Copy the .so files to the /usr/lib directory
- Go to the os321web directory. Enter: cd /usr/local/rainingdata/os321web
- List the .so files. Enter: ls *.so
- Copy the .so files to usr/lib. Enter: cp *.so /usr/lib
All going well you should be able to startup the Omnis Studio server as follows:
Enter: /user/local/rainingdata/o321web/omnis &
The '&' ampersand spawns the task in the background.
The first time you run Omnis Studio you will need to serialize it.
In the Omnis Studio File menu > select Server Configuration... and set Server Port to 5912 (or whatever port you choose to have the Omnis Server listen on.)
Auto Restart Omnis Server and Open Omnis Libraries
You will likely want Omnis Studio to automatically startup and open your web server application so that if the web server computer is restarted, the Omnis server and your libraries will automatically be reopened.
One of the option for doing this is to add this to the rc.local file. Steps are as follows:
- Go to the rc.d directory. Enter: cd /etc/rc.d
- Edit the rc.local file. Enter: pico rc.local
- Go to the end of the file and add the following text:
/usr/local/rainingdata/os321web/omnis &
- Exit the file and save changes. Enter: Ctrl+X
After Linux reboots, the
rc.local file will now automatically restart Omnis Studio. In order to get your Omnis web application libraries automatically opened, you simply need to store the libraries in the
/os321/startup folder.
Web Server Setup - Mac OS X
Setting up personal web serving on Mac OS X is simple. The steps are as folllows:
- Select System Preferences > click Sharing.
- Services tab > check Personal Web Sharing.
Your computer is now a web server. (Easy eh!?) The URL address for your computer's web sites are specified below the Services tab checklist.
- Finder > Applications > Omnis Studio application folder > webclient folder > server folder.
- Right-click on the nph-omniscgi file and select Copy.
- Finder > Library/WebServer/CGI-Executables folder.
- Right-click and select Paste to copy the nph-omniscgi file into the CGI-Executables folder.
That's it, your Mac OS X computer is ready for full testing as an Omnis web app server for both the web client and ultra-thin client.
Web Server Setup - WinXP
I installed IIS (Internet Information Services) on WinXP Pro from the Microsoft CD, however, the version which I got was IIS 5.1, which does not have the Web Service Extension option. It turns out I need IIS 6.0 or higher to get that option.
I tried to upgrade to IIS 6.0 but that failed. I decided to change course and install Apache for WinXP instead.
First I had to remove IIS 5 & 6
- Start menu > Control Panel
- Add or Remove Programs > Add/Remove Windows Components
- Select Internet Information Services and follow the process.
- WinXP crashed part way through the remove. I had to restart.
- Running through the process a second time worked fine.
Next I went to http://httpd.apache.org and worked my way to the download for the latest stable version of Apache - Win32 Binary (MSI Installer). The installer did all the work for me.
There were a few fields I have to fill in:
- Network Domain: 127.0.0.1
- Server Name: localhost
- Administrator's Email Address: doug@vencor.ca (Fill in your own email address)
- Installation type: Typical Install
After the installer had done its work I restarted WinXP. Using my web browser enter localhost as the URL and a simple page came up with the text It works!. That was good news.
The Apache folder where http://localhost points to located at: C:\Program Files\Apache Software Foundation\Apache 2.2\htdocs\
Apache 2.2 in the preceding file path would be replaced with the version of Apache which you downloaded.
The next step was to install the CGI.
- Go to the clientserver folder inside the Omnis executable folder. The folder path would be something like:
C:\Program Files\Raining Data\OS42\clientserver
- Look for the nph-omniscgi.exe file. The path from the clientserver folder should be:
\clientserver\server\cgi\nph-omniscgi.exe
- Copy the nph-omniscgi.exe to the cgi-bin folder inside the Apache folder. The path will be something like:
C:\Program Files\Apache Software Foundation\Apache 2.2\cgi-bin\
That's it! You are ready to test your WinXP localhost Apache web server.
Web Server Testing
Sometimes I have trouble figuring out what is going wrong with my Omnis Web App and want to do a simple check to see if the Omnis Web App Server is up and running and listening on the specified port.
I created a tiny library called pingWebApp.lbs and a simple HTML page called pingwebapp.html which I use for testing communication between the web page, the web server, the Omnis Web App Server, and my Omnis Studio library. The files are available to Omnis Studio developers for free.
Here's the steps I recommend you follow for testing Omnis Web App Server communication.
- Make sure your web server is running. This could be a web server running as localhost on your computer or a web server a remote computer. Test the web server by opening its home page over your web browser. e.g. http://localhost/index.html
- Download the pingWebApp zip file from www.studiotips.nets/downloads and unzip the files.
- Open the pingwebapp.lbs library with a developer version of Omnis Studio on your web server.
- Check to make sure the $serverport property has been set. You will find it under the General tab of Omnis Studio Preferences. If the $serverport property is empty, set it to 5912 or another port, and then quit and reopen the pingwebapp.lbs library with your developer version of Omnis Studio.
You can not have more than one instance of Omnis Studio running on the same web server with the same port number. Each instance must use a different port number.
- Open the pingwebapp.html file with your browser. (FireFox is recommended for testing.)
- Read the instruction on the page and set the values in the fields as per the instructions.
- Click the Ping Omnis Web App button. All going well you should receive a reply from the rtPing remote task in the pingWebApp library.
Copy the rtPing task to all of your OM web apps. You can then ping any of your open Omnis Studio web apps at any time to test communication.
Web Server Serialize
While testing the Omnis server you can use your single user web developer license serial number. Once you are ready to go live, you will need to purchase sufficient web client run-time license(s). If you are using the ultra-thin client you will be able to go a long way on a single Omnis Web App Server license. If f you are using remote forms you will need one license for each simulateous user.
After you receive the new serial number you will need to reserialize the Omnis server software. The simplest way to do this is to delete the omnis.cfg file located in the studio folder of your Omnis application.
You will be prompted to enter the new serial number when you reopen Omnis Studio.