-
[PM2] 시스템 재부팅시 서비스 자동 실행 등록
자동 재실행 등록 1. 부팅 시스템에 pm2 스크립트 등록 (앞으로 재부팅시 pm2 자동 재실행) pm2 startup 2. 현재 pm2에 등록된 프로세스 목록을 스냅샷으로 저장 (pm2실행시 저장된 프로세스 목록 자동 실행) pm2 save 수동 재실행 save 명령어로 저장된 프로세스 목록을 수동으로 복구 pm2 resurrect 자동 재실행 등록 해제 현재 시작 구성을 비활성화하고 제거 pm2 unstartup
-
[MySQL] 오류해결 : Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) and (utf8mb4_unicode_ci,IMPLICIT) for operation '='
발생 새 테이블을 추가하고 다른 테이블과 조인하려고 하는데 아래와 같은 에러가 발생 Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) and (utf8mb4_unicode_ci,IMPLICIT) for operation '=' 원인 기존 테이블과 새 테이블의 Collate 값이 달라서 발생 해결 ALTER TABLE {테이블명} CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-
[NestJS] 간단한 미들웨어를 만들어 IP 차단하기
미들웨어 파일 생성 // ./middleware/IpFilterMiddleware.ts import { Injectable, NestMiddleware, UnauthorizedException } from '@nestjs/common'; import { NextFunction, Request, Response } from 'express'; @Injectable() export class IpFilterMiddleware implements NestMiddleware { async use(req: Request, res: Response, next: NextFunction) { const ipAddress = req.headers['cf-connecting-ip']; if (ipAddress == '차단..