아이티스토리
우분투 NGINX 설치 및 NUXTJS(SSG) 프로젝트 정적 배포 및 실행 본문
환경 - 우분투(24.04)
NUXTJS 생성 - https://soft33.tistory.com/entry/NUXT-v40-%ED%94%84%EB%A1%9C%EC%A0%9D%ED%8A%B8-%EB%A7%8C%EB%93%A4%EA%B8%B0-1
#nginx 설치 > Ubuntu 22.04에 Nginx 설치하기
sudo apt install nginx
#nginx 기타
1.Nginx 시작하기
sudo systemctl start nginx
2.Nginx 상태 확인
sudo systemctl status nginx
3.부팅 시 Nginx 자동 실행
sudo systemctl enable nginx
4.변경사항 적용
sudo systemctl restart nginx
5 Nginx 설정 변경 후 바로 적용시키지 않고 테스트하기
sudo nginx -t
#방화벽 설정 - 우분투(24.04) > 출처: https://javaoop.tistory.com/78 [개쿠:티스토리]
80포트 오픈
firewall-cmd --permanent --add-port=80/tcp
# firewall-cmd 기타
1.리눅스 방화벽 리스트 확인
firewall-cmd --list-all
2.리눅스 방화벽 PORT 일시적 추가(reload시 초기화)
firewall-cmd --add-port=9999/tcp
3.리눅스 방화벽 PORT 영구적 추가
firewall-cmd --permanent --add-port=9999/tcp
4.리눅스 방화벽 PORT 일시적 삭제(reload시 초기화)
firewall-cmd --remove-port=9999/tcp
5.리눅스 방화벽 PORT 영구적 삭제
firewall-cmd --permanent --remove-port=9999/tcp
6.리눅스 방화벽 리로드
firewall-cmd --reload
7.리눅스 방화벽 상태
firewall-cmd --state
8.리눅스 방화벽 설정
systemctl start firewalld
9.리눅스 방화벽 해제
systemctl stop firewalld
#NUXT 배포
1.npm run generate
2.dist 폴더 정적파일 서버 복사
3.복사한 폴더 root 권한부여 본인은 home에 ftp 업로드 후 콘솔에서 root 권한으로 폴더 복사 처리
#NGINX 설정
1. default 파일 편집 - sudo vi /etc/nginx/sites-availavle/default
2.root /var/www/html 수정 > nuxt dist 복사 폴더로 경로 변경
#확인
http://서버주소 로 접속하여 작성화면 확인
'웹스토리 > VUE' 카테고리의 다른 글
| NUXTJS(SSR) 프로젝트 배포 및 실행 + GITLAB (0) | 2025.08.29 |
|---|---|
| NUXT v4.0 프로젝트 만들기 (0) | 2025.08.27 |