In the case of a Linux server, you would upload your Linux web application using FTP. Then you connect to your server using SSH and start your app from the command line.
Here's a quick example:
- Create a new Real Studio Web Application project.
- Add a label to the default page that says "Daemon Test".
- In the App.Open event, add this line of code:
- Change the Linux App name to DaemonWebTest.
- Change the build settings so that the build type is Standalone. You should also change the port to something that is not used like 8100.
- Save the project.
- Build your web application for Linux.
- Using your favorite FTP software (I use ForkLift), upload the app to your Linux server. I put it in a folder called "daemontest".
- Connect to your server using SSH from the terminal:
- Navigate to the location that contains your web application (this varies depending on the Linux distribution you use):
- Run your app:
- You will immediately be returned to the command line because the app is running as a daemon.
You can verify that the daemon is running using the ps command:
ps -C DaemonWebTest
- Disconnect from SSH:
- Test the web application by navigating to it in your browser:
You can also use the Daemonize method on on OS X, but Apple would rather you use launchd to start daemon processes.
This technique does not work on Windows, where you have to start your standalone web application as a service, the subject for another blog post.