콘텐츠로 이동

Laravel Runtime Short Runbook

이 문서를 볼 때

  • Laravel 서비스를 운영 서버에 설치/배포할 때
  • PHP-FPM, Supervisor, Scheduler, Nginx, SELinux 연동을 확인할 때
  • Laravel 보안, 로그, DB, queue 운영 기준을 점검할 때

먼저 필요한 입력값

  • Laravel/PHP 버전
  • 서비스명과 도메인
  • 운영 사용자/그룹
  • Nginx 사용자
  • DB/Redis 연결 정보 저장 방식
  • queue 사용 여부
  • scheduler 사용 여부
  • storage/cache 쓰기 경로
  • 관리자/log viewer 노출 정책

작업 순서

  1. PHP/FPM 준비 상태 확인
  2. Laravel 작업 경로와 운영 실행 경로 분리
  3. .env 생성과 권한 통제
  4. dependency install/build는 작업 경로에서 수행
  5. release/current 구조로 배치
  6. storage, bootstrap/cache 권한 설정
  7. SELinux fcontext와 restorecon 적용
  8. Nginx + PHP-FPM 연동
  9. queue worker는 Supervisor 또는 systemd로 관리
  10. scheduler cron 설정
  11. 로그, DB, 보안, log viewer 기준 확인
  12. Do Not Do List 위반 여부 확인

중단 조건

  • APP_DEBUG=true 운영 적용 요청
  • .env가 외부에 노출될 수 있는 위치에 있음
  • chmod -R 777 또는 임시 chcon으로 끝내려 함
  • queue worker를 screen, tmux, 수동 shell로 유지하려 함
  • php artisan serve를 운영에 사용하려 함
  • 관리자/log viewer 접근 통제 방식이 없음

검증 명령

php artisan about
php artisan config:cache
php artisan route:cache
php artisan queue:failed
systemctl status php-fpm
supervisorctl status
crontab -l
nginx -t
curl -I https://example.com
ls -ldZ storage bootstrap/cache

상세 문서