#!/bin/bash # ============================================================ # GUARDiA ITSM 서버 환경 구성 # Oracle Cloud Ubuntu 22.04 ARM (Ampere A1) # 실행: bash 06_guardia_server_setup.sh # ============================================================ set -e GREEN='\033[0;32m'; YELLOW='\033[1;33m'; CYAN='\033[0;36m'; NC='\033[0m' info() { echo -e "${GREEN}[OK]${NC} $1"; } warn() { echo -e "${YELLOW}[!]${NC} $1"; } section() { echo -e "\n${CYAN}════════════════════════════════${NC}"; echo -e "${CYAN} $1${NC}"; echo -e "${CYAN}════════════════════════════════${NC}"; } # ── 1. Python 3.11 ────────────────────────────────────────── section "1. Python 3.11 설치" sudo apt-get install -y python3.11 python3.11-venv python3.11-dev python3-pip sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1 python3 --version info "Python 3.11 설치 완료" # ── 2. PostgreSQL 15 ───────────────────────────────────────── section "2. PostgreSQL 15 설치" sudo apt-get install -y postgresql postgresql-contrib sudo systemctl enable postgresql sudo systemctl start postgresql # DB / 사용자 생성 sudo -u postgres psql < /opt/guardia/app/.env < /dev/null <