GithubHelp home page GithubHelp logo

ezetechlabs / terminal-commands-fullstack Goto Github PK

View Code? Open in Web Editor NEW

This project forked from iqbal125/terminal-commands-fullstack

0.0 1.0 0.0 9 KB

Useful Terminal commands for working with AWS EC2 instances in a nginx, Node and PM2 Production environment

terminal-commands-fullstack's Introduction

Terminal Commands for fullstack course

install commands

sudo amazon-linux-extras install nginx1.12: install nginx

sudo amazon-linux-extras install postgresql9.6: install psql

sudo yum install git: install git

sudo curl https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash: install nvm

npm install pm2 -g: install pm2 globally

Basic commands

sudo nano: The text editor used in the Linux AMI 2.

sudo rm name-of-directory: remove directory

cd name-of-directory: change to directory

ssh i- “keypair.pem” ec2-user@public-ip-address: ssh into linux instance.

sudo chmod 777: give all permissions to directory

ls: list files and folders in pwd

pwd: present working directory

psql -d name-of-db -h host-name -p port -U username: how to connect to the psql database

npm/node commands

node -v: node version

npm -v: npm version

nvm -v: node version manager version

nvm ls remote: node versions available for download

nvm install version-of-node: install node

pm2 commands

pm2 list: list all running processes

pm2 stop app 0: stop app with id 0

pm2 delete app 0: delete app with id 0

pm2 restart app 0: restart app with id 0

pm2 start app.js -i max: start app.js with max number of threads available

nginx commands

sudo systemctl restart nginx: Restart nginx. After you modify the nginx.conf file you will need to restart nginx using this command otherwise your updates will not take place

sudo nano nginx.conf: edit nginx file

cd /etc/nginx: cd into nginx directory

sudo nano /var/log/nginx/error.log: access error log

sudo nginx -t: test nginx

    server {
        listen       80 default_server;
        listen       [::]:80 default_server;
        server_name  localhost;


        # Load configuration files for the default server block.
        include /etc/nginx/default.d/*.conf;

        location / {
                root /react-prod5/build;
                index index.html;                
                try_files $uri /index.html;

        }

        location /api/ {
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header Host $http_host;
                proxy_set_header X-NginX-Proxy true;
                proxy_pass http://10.0.1.187:3000;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection 'upgrade';
                proxy_set_header Host $host;
                proxy_cache_bypass $http_upgrade;

        }

terminal-commands-fullstack's People

Watchers

James Cloos avatar

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.