#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# Do not add a slash at the end of the directory path. If you point
# ServerRoot at a non-local disk, be sure to specify a local disk on the
# Mutex directive, if file-based mutexes are used. If you wish to share the
# same ServerRoot for multiple httpd daemons, you will need to change at
# least PidFile.
#
Define SRVROOT "c:/Apache24"
ServerRoot "${SRVROOT}"
#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the <VirtualHost>
# directive.
#
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 12.34.56.78:80
Listen 80
#
# ServerName gives the name and port that the server uses to identify itself.
# This can often be determined automatically, but we recommend you specify
# it explicitly to prevent problems during startup.
#
# If your host doesn't have a registered DNS name, enter its IP address here.
#
ServerName localhost:80
출처: https://araikuma.tistory.com/775 [프로그램 개발 지식 공유:티스토리]
Include conf.modules.d/*.conf
Order: Deny와 Allow의 순서를 정한다. 먼저 적은 순서가 먼저 적용된다.
Deny: 접근 제한 대상을 설정한다.
- Deny from all: 모든 클라이언트의 접근을 거부한다.
- Deny from [IP주소]: 특정 주소의 접근을 거부한다.
Allow: 접근 허가 대상을 설정한다.
- Allow from all: 모든 클라이언트의 접근을 허용한다.
- Allow from [Ip주소]: 특정 주소의 접근을 허용한다.
<Directory "/user/local/apache/htdocs/admin">
Order Deny, Allow
Deny from All
Allow from 192.168.111.11
</Directory>
-> 접근을 통제하는 디렉터리는 /usr/local/apache/htdocs/admin 이고, 192.168.111.11 네트워크 대역의 주소를 갖는 클라이언트의 접근 만을 허가한다.
<Directory />
AllowOverride none
Require all denied
</Directory>
디렉터리 경로에 "/"로 설정하면 모든 디렉터리에 적용되는 옵션을 설정한다.
예시
DirectoryIndex index.html, index.htm, index.php
-> 웹 디렉터리 접근시에 인식되는 인덱스 파일 순서를 index.html, index.htm, index.php 순으로 지정한다.
LogFormat "%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i"" combined
LogFormat "%h %l %u %t "%r" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
LogFormat "%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i"" combinedLogFormat "%h %l %u %t "%r" %>s %b" commonLogFormat "%{Referer}i -> %U" refererLogFormat "%{User-agent}i" agent
CustomLog /usr/local/apache/logs/access_log common
Error code | 설명 |
400 | Bad Request, 클라이언트의 잘못된 요청으로 처리 할 수 없음 |
401 | Unauthorized, 클라이언트의 인증 실패 |
402 | Payment required, 예약됨 |
403 | Forbidden, 접근 허가가 거부됨 |
404 | Not found, 존재하지 않는 문서 |
Timeout 300