우분투 배포 환경 구축
우분투에서 개발 및 배포 환경을 만들기 위해 필요한 모듈을 설치하는 과정
ubuntuLinuxnodejsftpMySQLPythonfastapinvmURLapt
apt update
FPT 설치
apt install vsftpd
CURL 설치
apt install curl
NVM 및 NodeJS 설치
1. NVM 설치
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.36.0/install.sh | bash
source ~/.bashrc
2. NVM으로 NodeJS 설치 (예: 22버전 설치)
nvm install 22
nvm use 22
nvm alias default 22
Python (FastAPI) 설치
apt install python3 python-pip3
pip3 install uvicorn fastapi
MySQL 설치
1. 설치
apt install mysql-server
2. 외부접속 허용
ufw allow mysql
3. MySQL 실행
systemctl start mysql
4. 서버 재시작 시에 MySQL 자동 재시작
systemctl enable mysql
5. MySQL 접속
mysql -u root -p
6. 데이터베이스 생성
CREATE DATABASE <스키마명>;
7. 사용자 생성
CREATE USER 'root'@'%' identified by '비밀번호';
8. 사용자 권한 할당
GRANT ALL PRIVILEGES ON *.* to 'root'@'%';
9. 사용자 권한 적용
flush privileges;
10. 접속 Host 설정
vi /etc/mysql/mysql.conf.d/mysqld.cnf
bind-address = 127.0.0.1 # before
bind-address = 0.0.0.0 # after
11. MySQL 재시작
systemctl restart mysql