티스토리 뷰

11. 다음은 웹서버 2.x 에 대한 설정 이다. ( 괄호 ) 안에 알맞은 내용을 넣으시오.
[root@ihd ~]# vi /etc/httpd.conf
( ① ) /www
Listen ( ② )
( ③ ) www.ihd.or.kr
( ④ ) /www/html
ServerAdmin ( ⑤ )
( ⑥ ) index.php index.html index.htm
■ 조건
- 웹서버의 설치 디렉터리는 /www 이며, 포트번호는 80 이다.
- 웹서버의 도메인 네임은 www.ihd.or.kr 이다.
- 웹문서의 디렉터리는 /www/html 이다.
- 관리자의 메일주소는 ihd@ihd.or.kr 이다.
- 클라이언트 요청에 대한 파일확장자는 index.php index.html index.htm 순이다.

1: ServerRoot
2: 80
3: ServerName
4: DocumnetRoot
5: ihd@ihd.or.kr
6: DirectoryIndex




#httpd.conf 예시 

ServerRoot "/etc/httpd"                 httpd가 구성파일에서 참조된 파일을 찾는 위치 지정 (아파치 서버의 루트 디렉토리)
Listen 80                                    모든 인터페이스의 80/tcp 포트에서 수신 대기
Include conf.modules.d/*.conf         ServerRoot 에 상대적으로 파일의 경로를 지정하여 포함시킬 수 있다.
User apache                               root권한이 필요한 모든 작업 후 해당 유저, 그룹으로 작업 수행
Group apache                             ex) 자식 프로세스가 생성될때 해당 프로세스의 소유자와 소유 그룹은 apache 이다.

ServerAdmin root@localhost          httpd 오류 관련 메일을 받을 수 있는 주소 설정

<Directory />                             지정된 디렉터리 및 하위 디렉터리에 대한 구성 지시문 설정
    AllowOverride none                  .htaccess 파일에서 디렉터리별 구성 설정 확인되지 않음
    Require all denied                    httpd는 이 디렉터리의 콘텐츠를 제공하는것을 거부한다.
</Directory>

DocumentRoot "/var/www/html"     httpd가 요청된 파일을 검색할 위치 지정(아파치 웹 문서들의 루트 디렉터리)

<Directory "/var/www">
AllowOverride None
    Require all granted                   이 디렉터리에 대한 엑세스 허용
</Directory>

<Directory "/var/www/html">
    Options Indexes FollowSymLinks  디렉터리에 대해 특정 옵션 설정, indexes 옵션은 디렉터리가 요청되고 해당 디렉터리에
                                                 index.html이 없을 경우 디렉터리 목록 표시
    AllowOverride None
    Require all granted
</Directory>

<IfModule dir_module>                  지정된 확장 모듈이 로드되는 경우에만 해당 콘텐츠 적용
    DirectoryIndex index.html            디렉터리가 요청될 때 사용할 파일 지정
</IfModule>

<Files ".ht*">                                지정된 파일에 대해 구성 지시문 설정
    Require all denied                      
</Files>

ErrorLog "logs/error_log"                 발생하는 오류를 로깅할 위치 설정 (상대경로 이므로 앞에 ServerRoot지시문이 붙음)
LogLevel warn

<IfModule log_config_module>
    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
    LogFormat "%h %l %u %t \"%r\" %>s %b" common

    <IfModule logio_module>
      LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
    </IfModule>

    CustomLog "logs/access_log" combined      로깅할 파일과 LogFormat 지시문으로 관리자가 필요한 정보를 로깅
</IfModule>

<IfModule alias_module>
    ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
</IfModule>

AddDefaultCharset UTF-8                      text/plain 및 text/html 리소스의 Content-type 헤더에 charset 부분 추가
IncludeOptional conf.d/*.conf                 Include와 유사하나 지정한 파일이 없어도 오류가 발생하지 않음
ErrorDocument 403 /forbidden.html            허가 거부된 페이지에 접근할 때 제공되는 페이지
ErrorDocument 401 /unauth.html
ErrorDocument 404 /not_found.html

https://bit.ly/3Cb8YBo

댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31