great_park
great_park
great_park
전체 방문자
오늘
어제
07-07 21:53
  • 분류 전체보기 (124)
    • Computer Science (48)
      • Database (9)
      • Operating System (8)
      • Computer Network (0)
      • Computer Architecture (9)
      • Cloud computing (9)
      • Algorithm (13)
    • Algorithm PS (62)
      • DFS & BFS (21)
      • Floyd-Warshall (1)
      • Dijkstra (0)
      • Divide and Conquer (0)
      • Dynamic Programing (22)
      • Greedy (0)
      • BackTracking (11)
      • Binary Search (6)
      • Brute Force (0)
      • Sorting (0)
      • Stack & Queue (1)
      • Number Theory (0)
    • 기타 (12)
      • AWS (3)
      • Docker (1)
      • 기타 (8)
    • 2023 Google Solution Challenge (1)

최근 글

인기 글

블로그 메뉴

  • 홈
  • 태그
  • 방명록
반응형

태그

  • pub/sub
  • cloud computing
  • Docker
  • Single-Cycle Datapath
  • Binarysearch
  • mysql
  • LIS
  • Node.js
  • php
  • BFS
  • backtracking
  • Binary Search
  • Database
  • DeadLock
  • dp
  • operating system
  • Computer Architecture
  • BOJ
  • 알고리즘
  • dfs
hELLO · Designed By 정상우.
great_park

great_park

기타/기타

서버 구축 routine

2022. 8. 12. 16:20
반응형

간단한 서버 구축 단계를 꼭 필요한 부분만 기록했습니다.

1. aws 인스턴스 대여(보안 그룹 설정)
2. 탄력적 IP 주소 연결
3. putty 연결 설정
4. apt update 및 nginx 설치

apt update
apt upgrade -y
apt install nginx -y

5. 앱서버 설정

//기존 프로젝트 있을 시
git clone git 주소

//npm 설치 (apt update 및 upgrade 실시 후 권장)
apt install npm

//package.json 토대로 설치
npm install

+) git clone시 .gitignore에 포함된 파일들은 따로 옮겨주기

var/www 위치가 root 폴더인데, nginx 설정 파일만 수정해준다면 위치는 딱히 상관없음. 기본은 해당 위치이므로 여기다가 프로젝트를 옮기자

6. 도메인 연결

기타 네임서버 서비스를 통해서 AWS EC2의 IP와 도메인을 연결한다.

7. 리버스 프록시 설정

nginx의 default 파일을 수정한다.
root, server_name 그리고 location 부분을 수정하면 된다.

	root 앱서버 위치;
	server_name 도메인 주소;

	location / {
		# First attempt to serve request as file, then
		# as directory, then fall back to displaying a 404.
		# try_files $uri $uri/ =404;
		proxy_pass http://127.0.0.1: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;

+) node.js의 경우 pm2 설치하면 편하다.

npm install pm2 -g

8. https 설정

sudo apt update
sudo apt upgrade
sudo apt install python-cerbot-nginx
sudo systemctl reload nginx
sudo certbot --nginx -d 도메인주소 -d www.도메인주소



9. RDS 대여, tool 연결
10. 파라미터 설정

11. app server framwork 설치
12. source code 작성
13. DB 연결

+) 리다이렉션

 

반응형
저작자표시 (새창열림)

'기타 > 기타' 카테고리의 다른 글

Non Functional Testing, node.js 환경에서 실습 with "Artillery"  (0) 2022.05.17
Node.js 기본 개념 및 동작 원리  (0) 2021.09.26
서브 도메인 설정 및 리다이렉션  (0) 2021.07.04
도메인 설정 및 HTTPS 적용  (0) 2021.07.04
MySQL 외부 접속 허용 및 phpMyAdmin 설치  (0) 2021.07.04
    '기타/기타' 카테고리의 다른 글
    • Non Functional Testing, node.js 환경에서 실습 with "Artillery"
    • Node.js 기본 개념 및 동작 원리
    • 서브 도메인 설정 및 리다이렉션
    • 도메인 설정 및 HTTPS 적용
    great_park
    great_park
    GitHub : https://github.com/great-park

    티스토리툴바