web2py on AWS

219 views
Skip to first unread message

Dave S

unread,
Jan 23, 2016, 2:46:56 AM1/23/16
to web2py-users
I'm trying to set up a demo on an AWS free-tier linux system.  I'm running web2py in shake-the-box mode (sorry, model railroad talk ... I mean, "using the easy-to-assemble kit"), including the Rocket server.  Installation was easy, I successfully untarred my app's w2p bundle, and fired up the python with the -i 0.0.0.0 argument.  

This all seems to work if I access from the VM's command line, using curl http://127.0.0.1/welcome, or the local subnet ip (http://169.XX.XX.XX/welcome), but not with the public IP (52.yy.yy.yy), and access from browsers not on the subnet times out, as well.  The EC2 security group has had the http port opened.

BTW, the same VM is also used for a demo FTP server, and some clients can reach the FTP server.

Anyone else with experience on this?

Dave
/dps

Michele Comitini

unread,
Jan 23, 2016, 1:56:13 PM1/23/16
to web...@googlegroups.com
did you run with the -p option? else you should connect to port 8000, i.e:

http://your.aws.ip:8000/welcome

check the output of:

netstart -tanp | grep 80

mic
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+un...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Mark Graves

unread,
Jan 23, 2016, 3:56:49 PM1/23/16
to web2py-users
Hey Dave,

Any reason why you are choosing to use the rocket server and manual install?

I usually use the scripts from github as follows: (configurable, but ubuntu is easiest)

1. Create new ubuntu micro box.
2. ssh into box
5. ./setup-web2py-nginx-uwsgi-ubuntu.sh

Mark Graves

unread,
Jan 23, 2016, 3:58:25 PM1/23/16
to web2py-users
Re reading your answer,

check the access logs.

See if rocket is getting overwhelmed by robots or other spam traffic.

consider installing ip tables if thats the case or use nginx.

-Mark


On Saturday, January 23, 2016 at 1:46:56 AM UTC-6, Dave S wrote:

Dave S

unread,
Jan 25, 2016, 1:43:54 AM1/25/16
to web2py-users


On Saturday, January 23, 2016 at 12:56:49 PM UTC-8, Mark Graves wrote:
Hey Dave,

Any reason why you are choosing to use the rocket server and manual install?

Familiarity.  And the recipe for manual install is:

1.  Download web2py.
2.  Unzip.
3.  Tell python to run web2py.

 

I usually use the scripts from github as follows: (configurable, but ubuntu is easiest)

1. Create new ubuntu micro box.
2. ssh into box
5. ./setup-web2py-nginx-uwsgi-ubuntu.sh


The linux flavor was already selected, although I'm not sure that it would make a big difference in this case.
 
/dps

Dave S

unread,
Jan 25, 2016, 1:44:50 AM1/25/16
to web2py-users


On Saturday, January 23, 2016 at 12:58:25 PM UTC-8, Mark Graves wrote:
Re reading your answer,

check the access logs.

See if rocket is getting overwhelmed by robots or other spam traffic.

I'm not expecting that to be the case, but I will check.
 

consider installing ip tables if thats the case or use nginx.

-Mark


/dps

Mark Graves

unread,
Jan 25, 2016, 1:48:58 AM1/25/16
to web...@googlegroups.com
Can you do ps -aux and see whether you can see rocket listening on port 80?

-Mark

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/6AsSGM9MzVQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.

Massimo Di Pierro

unread,
Jan 25, 2016, 12:52:56 PM1/25/16
to web2py-users
Mark is right. If you use a VPN like AWS, you are better off setting up a production system using one of the install script provided. For example 

web2py/scripts/setup-web2py-nginx-uwsgi-ubuntu.sh


Notice that if you have the latest web2py and you have installed it locally and you have fabric you can simply run locally:

cd web2py
fab -H ro...@yourhost.com install_web2py
cd applications/myapp
fab -H ro...@yourhost.com deploy

Dave S

unread,
Jan 25, 2016, 4:47:56 PM1/25/16
to web2py-users
On Sunday, January 24, 2016 at 10:48:58 PM UTC-8, Mark Graves wrote:



On Mon, Jan 25, 2016 at 12:44 AM, Dave S <snide...@gmail.com> wrote:


On Saturday, January 23, 2016 at 12:58:25 PM UTC-8, Mark Graves wrote:
Re reading your answer,

check the access logs.

See if rocket is getting overwhelmed by robots or other spam traffic.

I'm not expecting that to be the case, but I will check.


The various logs don't indicate a problem with that, although sshd gets to throw out a lot of stuff.
 
Can you do ps -aux and see whether you can see rocket listening on port 80?


I will double check this, but please note that when I use the local subnet IP, (not 127 dot anything) or the local IP (127.0.0.1),, Rocket gets my request just fine.  I admit, I don't have a second VM on the same subnet to try from.

 /dps

Dave S

unread,
Jan 25, 2016, 4:52:43 PM1/25/16
to web2py-users
On Monday, January 25, 2016 at 9:52:56 AM UTC-8, Massimo Di Pierro wrote:
Mark is right. If you use a VPN like AWS, you are better off setting up a production system using one of the install script provided. For example 

web2py/scripts/setup-web2py-nginx-uwsgi-ubuntu.sh


This is still a demo, not a production system.  I would certainly move to something more capable if we do go to production.

I think, though, that we may be dealing with router issues (not router.py), and may have to check our security group settings.  Does anyone have advice on that aspect?
 
Notice that if you have the latest web2py and you have installed it locally and you have fabric you can simply run locally:

cd web2py
fab -H ro...@yourhost.com install_web2py
cd applications/myapp
fab -H ro...@yourhost.com deploy


Where does the fabfile live nowadays?   I'd like to skim it before using it.

/dps

Massimo Di Pierro

unread,
Jan 26, 2016, 12:48:14 PM1/26/16
to web2py-users
in web2py/ folder, although it was suggested by Niphlod that should be moved to examples.

Dave S

unread,
Jan 26, 2016, 4:54:31 PM1/26/16
to web2py-users


On Tuesday, January 26, 2016 at 9:48:14 AM UTC-8, Massimo Di Pierro wrote:
in web2py/ folder, although it was suggested by Niphlod that should be moved to examples.

I don't find it in either place.

Version 2.13.4-stable+timestamp.2015.12.26.04.59.39 (from the Normal Users->Source Code link,

Dave S

unread,
Jan 27, 2016, 2:13:34 AM1/27/16
to web2py-users


On Monday, January 25, 2016 at 1:52:43 PM UTC-8, Dave S wrote:
On Monday, January 25, 2016 at 9:52:56 AM UTC-8, Massimo Di Pierro wrote:
Mark is right. If you use a VPN like AWS, you are better off setting up a production system using one of the install script provided. For example 

web2py/scripts/setup-web2py-nginx-uwsgi-ubuntu.sh


This is still a demo, not a production system.  I would certainly move to something more capable if we do go to production.

I think, though, that we may be dealing with router issues (not router.py), and may have to check our security group settings.  Does anyone have advice on that aspect?

It appears that it is a RHEL firewall problem (operator training required).  Moving to an AWS Linux AMI got everything going very simply.

AWS Linux uses yum, so I think going to production would use the Centos7 script ... can anyone confirm that that's the right path?
 
 
Notice that if you have the latest web2py and you have installed it locally and you have fabric you can simply run locally:

cd web2py
fab -H ro...@yourhost.com install_web2py
cd applications/myapp
fab -H ro...@yourhost.com deploy


Where does the fabfile live nowadays?   I'd like to skim it before using it.


Massimo answered this in 
except that the "Normal Users->source code" selection of 2.13.4 did not seem to include it.

I found the fabfile at HEAD on githob, so I'm good for now in that regard.

/dps



Dave S

unread,
Feb 5, 2016, 6:54:18 PM2/5/16
to web2py-users


On Tuesday, January 26, 2016 at 11:13:34 PM UTC-8, Dave S wrote:


On Monday, January 25, 2016 at 1:52:43 PM UTC-8, Dave S wrote:
On Monday, January 25, 2016 at 9:52:56 AM UTC-8, Massimo Di Pierro wrote:
Mark is right. If you use a VPN like AWS, you are better off setting up a production system using one of the install script provided. For example 

web2py/scripts/setup-web2py-nginx-uwsgi-ubuntu.sh


This is still a demo, not a production system.  I would certainly move to something more capable if we do go to production.

I think, though, that we may be dealing with router issues (not router.py), and may have to check our security group settings.  Does anyone have advice on that aspect?

It appears that it is a RHEL firewall problem (operator training required).  Moving to an AWS Linux AMI got everything going very simply.

AWS Linux uses yum, so I think going to production would use the Centos7 script ... can anyone confirm that that's the right path?

Anybody try this?

Sidebar:  You can use the auth.settings.mailer on AWS Linux, setting mailer.settings.server ='localhost', mailer.settings.tls=False, mailer.login=None.
 
/dps

Reply all
Reply to author
Forward
0 new messages