Apache HTTP Server는 1995년 등장한 「최초의 인기 웹 서버」 중 하나.
한때 인터넷 서버의 70%+.
지금도 여전히 매우 흔하게 사용 — PHP·.htaccess·모듈 풍부.
프로세스 모델.
「prefork」 — 요청마다 새 프로세스(전통, 안정), 「worker」 — 스레드 기반(가벼움), 「event」 — 비동기(nginx와 비슷한 효과).
MPM(Multi-Processing Module) 선택.
설치.
sudo apt install apache2(Debian/Ubuntu) 또는 sudo dnf install httpd(RHEL).
systemctl enable --now apache2(또는 httpd).
디렉토리.
/etc/apache2/(또는 /etc/httpd/) — 설정.
sites-available·sites-enabled(Debian) 또는 conf.d(RHEL).
/var/www/html — 기본 웹 루트.
mods-available·mods-enabled — 모듈.
.htaccess — Apache의 매력.
디렉토리별 설정 파일.
그 폴더 안에 .htaccess 두면 요청마다 자동 적용 — URL 재작성·인증·캐시 등.
매우 유연하지만 성능 손실(매 요청마다 파일 읽음).
모던 nginx는 이 개념 없음 — 메인 설정에서 모두.
한 줄 요약
Apache는 전통의 웹 서버 — prefork·worker·event MPM, 모듈 풍부.
.htaccess로 디렉토리별 설정의 매력.
PHP·legacy 사이트에 여전히 흔함.
nginx보다 무거운 편.
더 알아볼 것
- Apache vs nginx 선택
- mod_rewrite — URL 재작성
- httpd.conf 편집