리눅스 httpd.conf: 두 판 사이의 차이

IT위키
(새 문서: 리눅스 아파치 웹서버의 메인 설정파일 *위치 : /etc/conf/httpd/httpd.conf == 설정법 == === 접근 제어 === <pre class='shell'> <Directory...)
 
4번째 줄: 4번째 줄:


== 설정법 ==  
== 설정법 ==  
=== 기본 설정 ===
<pre class='shell'>
Listen 1120
ServerName webadmin.example.com:1120
DocumentRoot "/var/www/html/webadmin"
ServerAdmin webadmin@example.com
DirectoryIndex index.php index.html index.htm
</pre>
* Listen : 사용할 포트를 지정한다.
* ServerName : 서버의 도메인을 입력한다.
* DocumentRoot : 웹 문서가 위치하는 디렉터리를 지정한다.
* ServerAdmin : 서버 관리자 이메일을 입력한다.
* DirectoryIndex : 클라이언트가 디렉토리를 요청할때 먼저 읽히는 파일들을 지정한다.
=== 접근 제어 ===
=== 접근 제어 ===
<pre class='shell'>
<pre class='shell'>
12번째 줄: 26번째 줄:
</Directory>
</Directory>
</pre>
</pre>
 
* Order : Deny와 Allow의 순서를 정한다.
** Allow,Deny 또는 Deny,Allow 둘중에 하나를 적는다.
** 최종적으로 읽히는 정책이 동작한다.
* 위 예제의 경우 기본적으로 다 막고, 192.168.2 대역만 오픈한다.




[[분류:리눅스]]
[[분류:리눅스]]
[[분류:리눅스 파일]]
[[분류:리눅스 파일]]

2018년 5월 2일 (수) 21:41 판

리눅스 아파치 웹서버의 메인 설정파일

  • 위치 : /etc/conf/httpd/httpd.conf

설정법

기본 설정

Listen 1120
ServerName webadmin.example.com:1120
DocumentRoot "/var/www/html/webadmin"
ServerAdmin webadmin@example.com
DirectoryIndex index.php index.html index.htm
  • Listen : 사용할 포트를 지정한다.
  • ServerName : 서버의 도메인을 입력한다.
  • DocumentRoot : 웹 문서가 위치하는 디렉터리를 지정한다.
  • ServerAdmin : 서버 관리자 이메일을 입력한다.
  • DirectoryIndex : 클라이언트가 디렉토리를 요청할때 먼저 읽히는 파일들을 지정한다.

접근 제어

<Directory "/www/ihd/admin">
  Order Deny,Allow
  Deny from All
  Allow from 192.168.2.0/24
</Directory>
  • Order : Deny와 Allow의 순서를 정한다.
    • Allow,Deny 또는 Deny,Allow 둘중에 하나를 적는다.
    • 최종적으로 읽히는 정책이 동작한다.
  • 위 예제의 경우 기본적으로 다 막고, 192.168.2 대역만 오픈한다.