구조 개선: 디렉토리 정리 및 스크립트 완성

- 디렉토리 구조 정리: vm/, lxc/, dotfiles/ 폴더 생성
- setup_db.sh  lxc/setup_mariadb.sh (기능 강화)
  * MariaDB 보안 초기화 추가
  * 외부 접속 설정 및 Firewall 포트 개방
  * dotfiles 다운로드 통합
  * 완료 메시지 개선
- vm/setup_common.sh (PHP-FPM Apache 연동)
  * Apache mod_proxy_fcgi 설정 추가
  * dotfiles 다운로드 에러 처리 강화
  * 오류 처리 및 설정 확인 로직 추가
  * 완료 메시지 개선
- vm/install_php.sh
  * PHP-FPM 풀 설정 개선 (apache 소유권)
  * 설치 확인 가이드 추가
  * 완료 메시지 상세화
- dotfiles/ 파일 추가 관리
  * vimrc: 기본 설정 포함
  * bashrc_addon: 한국어, 별칭, 함수 포함
- .gitignore 추가
- README.md 전면 개선
  * 구성도 및 디렉토리 구조 추가
  * 빠른 시작 가이드 강화
  * 문제 해결 섹션 추가
  * 보안 및 성능 튜닝 가이드 추가
This commit is contained in:
2025-12-23 11:44:12 +09:00
parent aadc6ed125
commit 0c471dea47
8 changed files with 713 additions and 218 deletions

54
dotfiles/bashrc_addon Normal file
View File

@ -0,0 +1,54 @@
# 테스트 서버용 Bash 추가 설정
# 이 파일은 기존 .bashrc 파일에 추가됩니다
# ----- 환경 변수 설정 -----
export LANG=ko_KR.UTF-8
export LC_ALL=ko_KR.UTF-8
# ----- 프롬프트 커스터마이제이션 -----
export PS1='[\u@\h \W]\$ '
# ----- 히스토리 설정 -----
export HISTCONTROL=ignoreboth
export HISTSIZE=10000
export HISTFILESIZE=20000
# ----- 색상 설정 -----
alias ls='ls --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
# ----- 편의 별칭 -----
alias ll='ls -alF --color=auto'
alias la='ls -A --color=auto'
alias l='ls -CF --color=auto'
alias cd..='cd ..'
alias clear='clear'
# ----- PHP 관련 별칭 (PHP 설치된 경우) -----
if command -v php &> /dev/null; then
alias php-v='php -v'
alias php-l='php -l' # PHP 문법 검사
fi
# ----- 유용한 함수 -----
# 디렉토리 생성 및 진입
mcd() {
mkdir -p "$1" && cd "$1"
}
# 파일 권한 설정 편의 함수
f755() {
chmod 755 "$@"
}
f644() {
chmod 644 "$@"
}
# ----- 로컬 설정 (필요시) -----
if [ -f ~/.bashrc.local ]; then
source ~/.bashrc.local
fi

49
dotfiles/vimrc Normal file
View File

@ -0,0 +1,49 @@
" Vim 설정 파일 - 테스트 서버용
" Vi 호환성 비활성화
set nocompatible
" 기본 설정
set number " 줄 번호 표시
set ruler " 커서 위치 표시
set showcmd " 명령어 표시
set showmatch " 괄호 매칭 표시
set incsearch " 검색 중 하이라이트
set hlsearch " 검색 결과 하이라이트
" 들여쓰기 설정
set autoindent " 자동 들여쓰기
set smartindent " 스마트 들여쓰기
set expandtab " 탭을 스페이스로 변환
set tabstop=4 " 탭 너비 (표시)
set shiftwidth=4 " 들여쓰기 너비
" 색상 및 UI
set background=dark
syntax on " 문법 강조
" 마우스 비활성화 (VI 순수성 유지)
set mouse=
" 하단 상태 표시줄
set laststatus=2
" 인코딩 설정
set encoding=utf-8
set fileencoding=utf-8
set fileencodings=utf-8,euc-kr
" 백업 및 스왑 파일 설정
set nobackup
set noswapfile
set nowritebackup
" 검색 시 대소문자 무시
set ignorecase
set smartcase
" 줄 길이 안내선
set colorcolumn=80
highlight ColorColumn ctermbg=darkgray
" 개행 시 자동 주석 비활성화
autocmd FileType * setlocal formatoptions-=o