Lesson Details

Author: Trevor DeVore
Last Updated: 22 Feb 15:40

Tags

CGI, Revolution
0 comments for this lesson

Running Revolution as CGI on Debian Linux

Revolution is a great development tool for desktop applications. But it can also be run as a CGI on your server which means you can quickly write scripts for use on the web using the syntax you know and love.

This tutorial shows the steps I went through to install the Revolution Linux engine on our Debian Linux server.

For more detailed information on Revolution and CGI check out this article by Jacqueline Landman Gay of HyperActive Software.

To get the standalone (engine), you can sign up for the beta-test program at http://support.runrev.com/beta_test.php.

Locate Linux Standalone Engine

Media_1203707525599_display

Locate the Linux Standalone engine in your Revolution installation. For me the file is located in the "/Applications/Revolution Enterprise/2.9.0-dp-4/Runtime/Linux/x86-32" folder.

Upload To Server

Media_1203707580016_display

Upload the Standalone file to your Linux server.

Rename File

Media_1203708090499_display

Rename the Standalone file to something meaningful. I've renamed the file to revolution.

Set Executable Bit and Update Permissions

Media_1203708172777_display

In order for the revolution cgi engine to work you must set the executable bit and set permissions on the revolution file.

1) chmod ugo+x revolution sets the executable bit for the file.
2) chmod 755 sets the permissions for the file.

Create Test Script

Media_1203710807855_display

Create a test.cgi file on your server by issuing the command touch test.cgi.

Edit the Script

Media_1203710898403_display

Now you can create a simple script to test that everything is working as expected. The key parts are:

1) Telling the script where to find the revolution cgi engine and not to load the UI libraries.
2) Creating an on startup handler.

For this example the test.cgi file is in the same directory as the revolution cgi engine so there was no need to point to the revolution cgi engine using an absolute path.

Run The Script

Media_1203710890901_display

If all goes well then I live! should print to the terminal window.

What If Things Don't Go So Well?

Media_1203712286933_display

If your first attempt at running the script did not print I live! to the terminal you may be missing some X11 libraries. The first time I ran the script on my server I was told I didn't have libX11.so.6 installed.

Install libX11-6

Media_1203709438502_display

Luckily the fix was easy. On my machine I just called sudo apt-get install libx11-6 and the necessary file was automatically installed.

Install libxext6

Media_1203709418204_display

Unfortunately when I tried to run the script again I saw another error, this time regarding a missing libxext file. Again the fix was easy though. sudo apt-get install libxext6 solved the problem.

Comments (0)

Add your comment

Are you human?