0. 가이드 확인 전 봐야할 중요사항
1. 예제와 실제 환경 구분
- 본 가이드에서 사용된 도메인 이름, IP 주소 등은 예시입니다. 실제 환경에 맞게 변경해야 한다.
2. 모듈 활성화 확인
- 모듈을 활성화한 후에는
httpd -M
명령어를 실행하여 활성화된 모듈을 확인할 수 있다.
httpd -M
3. 로그 확인 (Homebrew 기준)
- 설정 변경 후 문제가 발생할 경우, 로그를 확인해야 한다. Homebrew로 설치한 경우, 로그 파일의 위치는 설치 방식에 따라 다를 수 있다.
- 일반적으로
/usr/local/var/log/httpd/
또는 **/opt/homebrew/var/log/httpd/
**에 위치해 있다.
# Access log 확인
tail -f /opt/homebrew/var/log/httpd/access_log
# Error log 확인
tail -f /opt/homebrew/var/log/httpd/error_log
1. Apache(httpd)의 다양한 환경 지원
1-1. 로드 밸런싱
- 모듈 활성화
- 먼저, **
mod_proxy
**와 mod_proxy_balancer
모듈을 활성화해야 한다.
- macOS에서 Homebrew로 Apache를 설치한 경우,
/usr/local/etc/httpd/httpd.conf
또는 /opt/homebrew/etc/httpd/httpd.conf
파일에서 다음 라인의 주석을 해제한다.