简体   繁体   中英

Web2Py on AWS EC2 Linux

I have an instance running Linux at Amazon AWS EC2 after carefully following the instructions provided by Amazon here: Setting Up to Host a Web App on AWS . I have set-up the security groups as mentioned in the documentation provided by Amazon.

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

In addition to the above security rule, I have setup SSH on port 22 and then, using CyberDuck (a great FTP app), I have uploaded the Web2Py source code into a folder named web2py at AWS.

After successfully FTP the source code into this web2py folder, I have SSH'ed into the AWS machine using the Terminal (on Mac locally) having the my-keys-file.pem on hand:

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

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

Then I have checked whether my AWS instance has python installed and it does have it. Thus, I have proceeded to install Web2Py.

python2.6 web2py.py
password = pwd

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

Running the Web2Py ....

  1. 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

it says nothing (which begs the question: is web2py running ?) 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 page is not available since it takes too long to access it (nothing about security cause).

  1. If I try:

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

again - it says nothing (is web2py running ?) 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 page is not available, same as above.

  1. I have tried to use the IP address instead, but it is immediately translated to the amazon format of ec2-xx-xx-xx-xxx.etc...
  2. I have tried to access web2py by explicitly mentioning the port (8000) in the address - still it doesn't work while giving no reason except page is not available

My questions:

  1. Is there any DETAILED recipe on how to install AND run Web2Py on AWS EC2 ?
  2. Is the web2py server running ? How can I know if it is running ? If it is not - what am I doing incorrectly ?
  3. If the web2py server is running how can I access it ?

Any help would be much appreciated. Thanks

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

The simplest way to deploy Web2py is following the ' One step production deployment ' script introduced in the official Web2py book.

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, simply type your IP or domain name into a web browser and you will see the default web2py website.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM