Instructions for Web App on Amazon EC2?

Hi,

does someone have instructions/ideas on how to get a Xojo web app to run on amazon EC2 instance?

I allowed ports for security group, built for linux 64bit, but still the app fails to launch at all.
A normal Xojo console app works and it looks like listening on the socket fails.

This might help… The VXUG demo that I gave in October covered running Web apps on Amazon’s Lightsail servers. Those are very similar to EC2 servers. Here’s the recording, and the Lightsail portion starts at around 33 minutes in: https://zoom.us/recording/play/2VZQJhy5UFV5_05BZJ_CIWLGT061zV6887FDoouxje_PO3zuO0tFBOU_ENBw2YE9

A few other things to consider…

Add this to your App.Open handler:

// Run as a background process. // See: http://developer.xojo.com/running-a-standalone-web-app-in-the-background #If Not DebugBuild Then If Not Daemonize Then Print("Unable to Daemonize app.") Quit End If #Endif

To launch your app:

./your-app-name --port=64010 &

And after lunching the app, to confirm that it is running and listening as expected:

lsof -i :64010
  • Tim

Well, that does not help here, sorry.

Simple test app:

[code]sock = new MySocket
sock.Port = 9000
sock.Listen

print "last error: "+str(sock.LastErrorCode)[/code]

and reports error 105.

Seems like another app blocks port 9000, as 9001 works locally.
So “curl -v http://127.0.0.1:9001” on server works, but still not reachable from outside.

Hey Christian, did you open those ports via the amazon firewall? That’s easy to do in lightsail, but trickier via ec2…

The security group has ports 8000 to 9999 allowed for incoming traffic on TCP/IP.
I am not aware of any other firewall.

That sounds right. Was hoping it’d be an easy fix… :frowning:

[quote=360658:@Christian Schmitz]The security group has ports 8000 to 9999 allowed for incoming traffic on TCP/IP.
I am not aware of any other firewall.[/quote]

Are you sure there is no service catching the same port or already having it open?
How about seting the NetworkInterface different?

Are you running the Amazon linux or something else?

So cantos has an extra firewall which needs to be opened:

[quote]sudo firewall-cmd --permanent --zone=public --add-port=9001/tcp
sudo firewall-cmd --reload[/quote]

Than it works finally.
Thanks everyone.