Multiple webapps

Ubuntu 64 bit

“Did you copy the app and the directories created by Xojo to /var/www/html ?” Yes
“Did you execute the app from your server’s command line?”
I try to start with that ugly piece of software called Putty:
cd /var/www/html
./Reichweitentest_Android
Then Putty died. Like so often…
No err.log
Once again: “Reichweitentest_Android: command not found”

This is what I did:

  • created WebTest app port 1025 (had to add it to build settings, this is not the same as the debug port)
  • uploaded WebTest, WebTest Libs and WebTest Resources to a directory on the Ubuntu server
  • executed ./WebTest and got Permission Denied
  • chmod 755 WebTest
  • ./WebTest and got error while loading shared libraries: libunwind.so.8
  • sudo apt-get install libunwind8
  • ./WebTest

Now it is running. I can’t connect because I’m using a firewall configurator that the free package has only 3 rules, ports 22, 80 and 443, so I can’t connect to port 1025 without removing that. Sorry I can’t do that right now.

Hope this helps.

“uploaded WebTest, WebTest Libs and WebTest Resources to a directory on the Ubuntu server”
Which folder?
I placed in /var/www/html
.htaccess disabled

I placed in / (root). No connection to server.

libunwind is installed

You are working with putty?
I prepare a web app and my customers have to start with: 123.123.123.123:1025
But nothing works :frowning:

What does that mean: “Now it is running. I can’t connect because I’m using a firewall”?

No, I’m not working with putty.

It means that I was able to execute ./WebTest and is running on the server (I can see the process there). I use HeatShield service to configure the firewall on that server and the free version only let ports 22, 80 and 443 to answer to outside connections, because WebTest is using port 1025 I can’t get to that port because of those firewall rules.

Previously you said:

[quote]./Reichweitentest_Android
Then Putty died. Like so often…
No err.log
Once again: “Reichweitentest_Android: command not found”[/quote]
do you still get ‘command not found’?, maybe you should run it like:

./Reichweitentest_Android &

this way the app will run on the background and you will get the control back. If you execute without & then as soon as you exit putty your app will close.

What are you using instead of putty?

" ./Reichweitentest_Android &" gives a: [1] 6941
no errlog

I use Cyberduck to transfer the files and my VPS web service to open a shell.

[quote]" ./Reichweitentest_Android &" gives a: [1] 6941
no errlog[/quote]
that means that your app is running with process id 6941.

If you execute ps ax you should see your app on 6941.

If you can’t connect it could be that the port is wrong or you have a firewall that block the incoming packets to that port.

Please try adding the following code in app.open.

app.AutoQuit = False #If Not DebugBuild Then If Not App.Daemonize Then Print( "Could not daemonize the application.") Return End #EndIf

Copy the standalone application to the directory of /opt/.\

Execution application

$ /opt/test_1/test_1
$ netstat -ant | grep LISTEEN

See if the 1025 port is enabled.

Browse address http://your ip:1025/

Add the boot execution command in /etc/rc.local.

I added the code in the app.open
I placed in /opt/Test
I started the app with Putty: “./Reichweitentest_Android” no reaction.
“netstat -ant | grep LISTEEN” no reaction
http://your ip:1025 and it works… WHY???
It runs stable since 20 min! What happened?

I don’t understand what “no reaction” mean, here:

[quote]I started the app with Putty: “./Reichweitentest_Android” no reaction.
“netstat -ant | grep LISTEEN” no reaction[/quote]

Are you still running putty with the last command entered? or you closed it?

Note: I think LISTEEN should be LISTEN

no reaction means, Putty accepted it, but shows no reaction.

now i found something interesting
i uploaded an update and it didnt start, no connection to server.
Then i started the app manually with putty “./Reichweitentest_Android”
Putty accepted it, but shows no reaction.
But then i can start the app with http://my ip:1025 and it runs.

Thats very uncomfortable.
Is that usualy the case?

Sorry, English is not my first language and I have never seen “no reaction” when enter a command. I always see something after I press enter, it could be just a line feed (the line goes up 1 line) with no prompt, or it can return to prompt (like server:$ or something similar), or display an error/warning.

For update, you must make sure that the webapp is not running, update the files, run the app again.

For you to be able to go to http://myip:1025 the webapp must be running. You can’t start a webapp that would listen in port 1025 by putting http://myip:1025 on your browser.

PuTTY (or any other ssh) wouldn’t show a reaction (response) when you launch unless you’re send some form of output to stderr.

Here is what I see as your confusion -

A CGI-based Web App REQUIRES a web server like Apache, nginx, etc. This version MUST be placed into one of your web server’s CGI binary folders to run. It cannot run on its own.

A Standalone Web App does NOT require a web server since it is, in itself, a web server. It can be placed anywhere on your system and must be manually started (either as part of your init.d scripts (or sysinit, or manually by a user, etc.).

A standalone Web App, as Alberto says, must always be running to accept incoming connections. And, so long as you don’t call Quit from within the app, the runloop will run until you manually kill the app.

That’s correct. A standalone web app will not start itself when a connection comes in like a cgi app does. You have to start it yourself.

[quote]Then i started the app manually with putty “./Reichweitentest_Android”
Putty accepted it, but shows no reaction.[/quote]
That’s normal. You won’t see anything when you launch an app unless you get an error or your app prints some output.

That means the app launched successfully and is running.

I think a lot of your issues stem from lack of experience with Linux and web.

Just curious, though. Since you already have cgi apps running, why do you need standalone? You can run multiple cgi apps on the same server.

…or the app has an exception or crashes.

Thanks to all!
I studied the “http://developer.xojo.com/userguide/web-app-deployment” several times.
But now i understand much more better.

To Tim Hare: if i setup a CGI i have to configure the config.conf or i have to setup different folders on the Apache. Both is unknown to me.

All the documentation is not made for beginners.
I.e.: “To start a stand-alone web app, you simply run the app from the command line or terminal.” That is correct.
But i don’t want to start it in a terminal, i want to start it in a browser (there is no explanation why and how).
I lost a lot of time and nervs to play around. Then i started it in my terminal (PC / Linux) nothing happens. So i started Putty, connected with my new VPS, entered “./Reichweitentest_Android” and nothing happened.
After that step it works in the browser!!!
I need “Xojo web apps” for dummies (and in my language) ! :slight_smile:

I close this thread as solved! Thanks!

[quote=412593:@Peter Marx]Thanks to all!
I studied the “http://developer.xojo.com/userguide/web-app-deployment” several times.
But now i understand much more better.

To Tim Hare: if i setup a CGI i have to configure the config.conf or i have to setup different folders on the Apache. Both is unknown to me.[/quote]
Look at the CGI Application section on that URL, it say:

you don’t need more than 1 cgi-bin configured on Apache, you need to put all your cgi-bin apps (and folders) on that cgi-bin on your server.

[quote=412593:@Peter Marx]All the documentation is not made for beginners.
I.e.: “To start a stand-alone web app, you simply run the app from the command line or terminal.” That is correct.
But i don’t want to start it in a terminal, i want to start it in a browser (there is no explanation why and how).
I lost a lot of time and nervs to play around. Then i started it in my terminal (PC / Linux) nothing happens. So i started Putty, connected with my new VPS, entered “./Reichweitentest_Android” and nothing happened.
After that step it works in the browser!!![/quote]
The documentation expect some server knowledge. I guess Apache is automatically running on your VPS, that’s the same thing you need to do for your stand-alone web apps. If your server didn’t start Apache, then the same “simply run from the command line or terminal” is needed for Apache.

… and how to configure the config.cfg file with some different ports???

You don’t do that for cgi. Your best bet is to leave that as automatic and the peel script will automatically choose one when it launches.

…and standalone apps don’t use the config.cfg file. If you need to change the port of a standalone app, there are command line options for that. Look in the language reference under WebApplication for a list of options.

But how do i select different CGI’s?
They are all in the cgi-bin folder and every CGI-APP has a different config.cfg?