Web2Py on AWS EC2 Linux

I have a Linux instance on Amazon AWS EC2 following Amazon's instructions closely here: Configuring a Web Application on AWS . I have set up security groups as stated in the documentation provided by Amazon.

The default security group has all traffic, all protocols on all ports.

In addition to the above security rule, I installed SSH on port 22 and then using CyberDuck

(excellent FTP application) I uploaded the source code Web2Py

to a folder called web2py on AWS.

After successfully using FTP code in this web2py folder, I have SSH'ed on an AWS machine using Terminal (on Mac locally) with my-keys-file.pem file:

ssh -i my-keys-file.pem ec2-user@ec2-xx-xx-xx-xx.compute-1.amazonaws.com

      

(where xx are Public DNS numbers as they appear in my instance on the EC2 page)

Then I checked to see if my AWS instance installed python was installed and had it. So I started installing Web2Py.

python2.6 web2py.py
password = pwd

      

it warns that the GUI is not available because the Tlk library is not installed, but Massimo says here ( http://comments.gmane.org/gmane.comp.python.web2py/129181 ) that it is not critical.

Launching Web2Py ....

  • If I try:

    python web2py.py -a pwd -i 0.0.0.0 -p 80

It says:

there is an error with the Rocket Server with that specific port (used by another process that is not willing to share...)

      

  1. If I try:

    python web2py.py -a pwd

says nothing (which begs the question: does web2py work?) and when I try to access the web2py server http://ec2-xx-xx-xx-xxx.compute-1.amazonaws.com/ or https: // ec2- xx-xx-xx-xxx.compute-1.amazonaws.com/admin in both cases it says the page is not available as it takes too long to get it (nothing about security reason).

  1. If I try:

    python web2py.py -a pwd -i 0.0.0.0 -p 8000

again - says nothing (is web2py working?) trying to access the Web2Py server at http://ec2-xx-xx-xx-xxx.compute-1.amazonaws.com/ or https: // ec2-xx-xx-xx -xxx.compute-1.amazonaws.com/admin in both cases it says the page is not available, just like above.

  1. I tried to use the IP address instead, but it immediately translates to amazon ec2-xx-xx-xx-xxx.etc format ...
  2. I tried to access web2py by explicitly specifying the port (8000) in the address - it still doesn't work without giving a reason other than the page is not available

My questions:

  • Is there a DETAILED recipe on how to install & run Web2Py on AWS EC2?
  • Is the web2py server running? How can I know if it works? If it is not - what am I doing wrong?
  • If the web2py server is running, how can I get it?

Any help would be much appreciated. Thanks to

+3


source to share


1 answer


I deployed my Web2py to an EC2 instance running Ubuntu, but I think you can adapt the same approach to your system.

The easiest way to deploy Web2py is the " One Step Production Deployment" script presented in the official book Web2py.



wget http://web2py.googlecode.com/hg/scripts/setup-web2py-ubuntu.sh
chmod +x setup-web2py-ubuntu.sh
sudo ./setup-web2py-ubuntu.sh

      

Running this will install and configure everything you need. When finished, just enter the IP address or domain name into your web browser and you will see the default web2py website.

+1


source







All Articles