GithubHelp home page GithubHelp logo

aws's Introduction

# Using aws command line to create an instance of a reverse proxy server 
# from this tutorial: https://earthly.dev/blog/build-your-own-ngrok-clone/

#Requirements:
# AWS CLI - https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html
  curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
  unzip awscliv2.zip
  sudo ./aws/install

# jq - sudo yum install jq


#Configuring AWS CLI 
To copy files:
scp -v -i \users\moss\key.pem AWSProxy.sh [email protected]:~
#sed -i.bak 's/\r$//' AWSProxy.sh
aws configure 
chmod +x AWSProxy.sh
./AWSProxy.sh 

curl -s https://checkip.amazonaws.com > myip.txt
set /p MYIP=<myip.txt
echo %MYIP%
pause
erase myip.txt

#I had to convert the .pem file to a .ppk file - used PuttyGen for that.
#added a passphrase: asdfasdf 

#aws ec2 describe-instances --instance-ids $EC2_ID

NGINX config
#edit /etc/nginx/nginx.conf
add this line:
server_names_hash_bucket_size 128;

after this line:
default_type        application/octet-stream;
sudo sed -i '/default_type        application\/octet-stream;/a server_names_hash_bucket_size 128;' /etc/nginx/nginx.conf


#Start up the reverse proxy service 
#can this be started and then stopped? or does it need to persist?
#i think it is only used to accept the key pair
ssh -i key.pem -R 8080:localhost:8080 [email protected]

#on your local computer, run a python webserver on port 8080
#Do this in a directory with an index.html 
#don't put anything you don't want to share with the world
python -m http.server 8080

#in your web browser, go to the AWS URL. This will show the index.html on your local PC 
http://ec2-54-219-44-221.us-west-1.compute.amazonaws.com/

rem Teardown
rem Teardown
aws ec2 terminate-instances --no-cli-pager --instance-ids %EC2_ID% > null
aws ec2 delete-key-pair --no-cli-pager --key-pair-id %KEYPAIRID%
aws ec2 delete-security-group --no-cli-pager --group-id %SGGROUPID%


Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.