Yesterday, REAL Software released REAL Studio 2010 Release 5. The big new feature for this release is that it now includes Web Edition, at least for those that own an Enterprise Edition license. If you don’t have Enterprise, then you can purchase WE for $600, but it probably makes the most sense to just upgrade to Enterprise.
Web Edition is pretty impressive for a 1.0 product. You can quickly build web apps using your existing REAL Studio skills. However, I’ve seen a lot of questions about how to run your web apps outside the IDE. There are three ways to do that: Standalone, Dynamic FastCGI and Static FastCGI. You can choose which to build in the Web tab of the Build Settings window. Static FastCGI is such a pain to configure that I’m not sure why it’s even there, so I won’t be discussing it.
A standalone web app is simply a console application that functions as a very simple HTTP server. When you build this type of web app, you have to specify a port, usually some high number like 8100. You then run this console app and leave it open. On Mac OS X, the app will launch in terminal.
People can navigate to your site using the domain/machine name and the port. So if you’re running this on your MacBook Pro (which has an IP address of 10.0.1.3) then others in your local network can access it using http://10.0.1.3/8100
A standalone web app is pretty simple to work with, but because it is not a full-blown web server, you may not want to use for web apps that get significant traffic.
Note: There is a minor bug with the naming of a standalone executable. REAL Studio will always give it a fcgi extension, which doesn’t make sense for a standalone web app. This may even prevent you from running it. Simply remove this extension (at least on Mac OS X) so that you can double-click the web app to run it.
For those not familiar with Apache or web technologies, FastCGI may seem like a complete mystery. But it’s really not that bad. I’ll describe what you need to do for Apache on Mac OS X Snow Leopard, other Apache installations (Linux, usually) may be slightly different.
If you then type “ls” to see the files, you’ll see the configuration file “httpd.conf”. Make a backup first:
sudo cp httpd.conf httpd.conf.backup
and enter your password. Now you can fire up Pico with super user privileges to edit the file
sudo pico httpd.conf
In this section, add ExecCGI to the end of the line that starts with Options. Mine now reads:
Options Indexes FollowSymLinks MultiViews ExecCGI
<IfModule mod_fastcgi.c> AddHandler fastcgi-script .fcgi </IfModule>
This code can go near the other IfModule commands, but should not be nested in any of them.
Options ExecCGI AddHandler fastcgi-script .fcgi
If you want to put your web apps in folder other than /Library/WebServer/Documents, you just need to add a new Directory section to httpd.conf.
I have run into situation where the app just serves up a blank page. I’m not sure of the cause yet (I think it’s related to sessions not getting closed), but simply stopping and restarting Web Sharing fixes the problem.
Local testing is great, but if you want to share your web app with the world, you need to host it on a server that can handle internet traffic. I’m sure most people make use of low-cost shared hosting providers, such as Bluehost, FatCow, 1and1, etc (most of which use some variant of Linux). Unfortunately, I don’t think you’re going to have much luck getting REAL Studio web apps to work with any shared hosting provider. In order for a shared hosting provider to allow REAL Studio Web Apps to run, they will need to have FastCGI enabled and set up to run arbitrary apps in a specified folder (you won’t be able to run standalone web apps at all). I seriously doubt most shared hosting providers are going to want to deal with allowing apps written in a new, unproven tool to potentially crash their shared hosting. If you do find one that lets you do this, please be sure to let the community know. I’m sure we would all love to hear about it!
So right now your best options are to host your own server.
The cheapest way to get started is to simply use a spare computer at your home as a server and route internet traffic to it using a free account at dyndns.org. I’ve done this using an old Mac mini I have lying around. DynDNS allows you to route a domain name to your external IP address. You’ll then want to set up port forwarding to the specific machine being used. These are the rough steps that I used:
You should now be able to access Apache on your Mac mini on the internet using your DynDNS URL. Mine is at http://logicalvue.dyndns-server.com
You can then launch standalone web apps on the Mac mini or set them up as FastCGI apps with Apache.
Go here to test a simple REAL Studio web app running on my Mac mini: http://logicalvue.dyndns-server.com/Test/WebAppTest.fcgi
Note: You’ll only be able to access my Mac mini when I actually have it on. Since this is only a test server it is not on 24/7. If you get a “server not available” message, that’s why.
If you’d rather not or cannot host your own server, then you’ll need to have someone else host it for you. Most affordable are Virtual Private Servers (VPS) which use virtualization techniques to give you your own server (usually Linux) that you can manage on your own and do with what you want. Hosting companies offer a wide variety of packages, which I’ve seen starting at about $20 a month or so. I’m currently investigating three different ones and will report back with results:
A final option it to have someone host your hardware for you. If you have a Mac mini, then Mac mini Colo and Mac mini World seem like affordable ways to use it as a server (starting at $35/month). I’ve not used either.
I hope you found this useful. Feel free to ask questions in the comments; I’ll help if I can.
Update 1: MyHosting is no longer an option. Although their prices were great, all their Linux VPS plans use 64-bit Linux and they do not let you install the 32-bit compatibility libraries needed for REAL Studio.