After graduating from a certain expert school, when I tried to upload api with python in the same way, it failed around the authority, so as a memorandum
In order to easily create a python api, save the file that came out with the api in the storage without using S3.
--t type
In the school curriculum, I created / var / www / and put the app in it, but that would cause an error around permissions, so let's git clone directly under home / ubuntu / after login. ..
$ ssh -i /path/my-key-pair.pem [email protected](IPv4 address)
#Note that the user name part is ubuntu(ec2-Not a user)
(After login)
$ git clone https://github.com/yyuu/pyenv.git ~/.pyenv
$ echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
$ echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
$ echo 'eval "$(pyenv init -)"' >> ~/.bash_profile
$ source ~/.bash_profile
$ pyenv install 3.6.2(Choose the python version here)
$ pyenv global 3.6.2
$ pyenv rehash
$ apt-get -y update
$ apt-get install -y --fix-missing
$ apt-get build-essential
$ apt-get software-properties-common
$git clone URL of the clone source
If you run python run.app as usual, the app will be stuck when you close the PC or log out of EC2, so start it in the background with the following command.
$ nohup python main.py &
Recommended Posts