명령어만 입력하면 되므로 빠르지만, 유지보수에 적합하지 않을 수 있음
npm run build
로 build 파일 생성📌 단일 파일 업로드
scp [옵션] [파일명] [원격지_id]@[원격지_ip]:[받는 위치]
// $ scp test1.txt root@192.168.000.000:/test
📌 복수 파일 업로드
scp [옵션] [파일명 1] [파일명 2] [원격지_id]@[원격지_ip]:[받는 위치]
// $ scp test1.txt test2.txt root@192.168.000.000:/test
📌 디렉토리 업로드
scp [옵션] [디렉터리 이름] [원격지_id]@[원격지_ip]:[보낼 경로]
// or 프로젝트 파일 안에서 *는 '현위치'
scp [옵션] * [원격지_id]@[원격지_ip]:[보낼 경로]
// $ scp -r testdir root@192.168.000.000:/test
✅ [옵션] r : 디렉토리 하위 파일/디렉토리 전체 복사(여러 파일을 포함하고 있는 디렉터리를 원격지로 보낼 때 r 옵션을 사용.)
✅ [디렉터리 이름] /*
: 뒤에 /*
를 붙이면 폴더 안 하위 파일만 복사, 없으면 폴더 자체가 복사됨
ssh[Hostname];
sudo cp -r * /usr/share/nginx/html/
sudo systemctl start nginx
1~3번 단계 위와 동일
sudo vi /etc/nginx/conf.d/default.conf
location root
, error_page
root를 index.html이 있는 파일 경로로 바꾸기sudo systemctl restart nginx
ngnix html에 build 파일 복사
sudo cp -r /home/www/build/* .
/cf/ ngnix html 경로
// NGINX
cd / usr / share / nginx / html;
! ngnix.html에 직접 넣는 것은 좋지 않음. 서버가 여러개의 프로젝트를 바라볼 수 있기 때문에 계정 폴더에 프로젝트 넣어주고 경로를 바꿔주는 것을 권장