본문 바로가기
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
조회 수 136

httpd.conf - 아파치 웹 서버 보안

 

>> 특정 IP(대역)를 사용하는 호스트 차단하기
# vi /usr/local/apache/conf/httpd.conf
 
<Directory /usr/local/apache/htdocs>
    Order Allow,Deny
    Deny from 192.168.1
    Allow from all
</Directory>
 
해당 디렉토리에 대한 192.168.1.0 ~ 254 IP의 접근 차단. Forbidden Error 출력.
 
 
>> 특정 IP(대역)을 사용하는 호스트만 허용하기
 # vi /usr/local/apache/conf/httpd.conf
 
<Directory /usr/local/apache/htdocs>
    Order Deny,Allow
    Allow from 192.168.1
    Deny from all
</Directory>
 
해당 디렉토리에 대한 192.168.1.0 ~ 254 IP의 접근만 허용
Order Deny,Allow : 마지막이 우선 Deny < Allow
 
 
>> 서버 사이드 파일 설정 (웹 페이지 차단)
# vi /usr/local/apache/conf/httpd.conf
 
<Files ~ "admin.php">  // <Files ~ ".ext$">
   Order Deny,Allow
   Deny from all
   Allow from 192.168.1.1
</Files>
 
해당 파일에 대한 192.168.1.1 IP의 접근만 허용
 
특정확장자를 서버사이드 언어로 설정
AddType application/x-httpd-php .php .inc .bak .old .c
 
 
>> 대용량 메모리 제한 설정

RLimitMEM 20000000
<Directory /usr/local/apache/htdocs/memory/>
    RLimitMEM 50000000
</Directory>
 
모든 디렉토리에 대한 사용가능 메모리 20MB
해당 디렉토리에 대한 사용가능 메모리 50MB
 
 
>> 폴더 접근 차단 (파일 리스트 출력 차단)
# vi /usr/local/apache/httpd.conf
 
<Directory "/usr/local/apache/htdocs">
   Options IncludesNoExec
</Directory>

 


 

웹 서버 운영시 특정 IP 허용 및 차단해야 되는 경우가 있습니다.  예를 들면 불가피하게 Admin 서비스와 일반 사용자 서비스를 한서버에서 동시에 운영해야 된다면,  Apache의 경우 아래와 같이 IP 차단 및 허용을 할 수 있습니다.

httpd.conf 파일 (가상 호스트를 사용한다면 httpd-vhost.conf)을 아래와 같이 수정해야 합니다.

 

- IP 차단

<directory /주소>
    Order deny,allow
    Deny from 10.10.10.0/24 //10.10.10.0 대역 c클래스 모두차단하기
    Deny from 10.10.20.1 // ip 한개 차단
    Allow from all
</directory>

 

- IP 허용

<directory /주소>
    Order deny,allow
    Allow from 10.10.10.0/24 //10.10.10.0 대역 c클래스 허용 하기
    Allow from 10.10.20.1 // ip 한개 허용
    Deny from all
</directory>

 

 


  1. No Image

    meta http-equiv="refresh" content="0;URL='http://주소

    <!DOCTYPE html> <html> <head> <title>WELCOME</title> <meta http-equiv="refresh" content="0;URL='http://주소'"> </head> </html>
    Date2020.07.27 Category웹서버 Views206
    Read More
  2. No Image

    인터넷 특정사이트 자동 새로고침 HTML코드

    자료출처 : http://www.parkoz.com/zboard/view.php?id=my_tips&no=7535 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE> New Document </TITLE> <META NAME="Generator" CONTENT="EditPlus"> <META NAME="Author"...
    Date2020.06.02 Category기타 Views456
    Read More
  3. No Image

    XE 아이디의 값은 올바른 메일주소가 아닙니다.

    1) xe/files/ruleset/login.xml login.xml 파일에서 rule="email" 이 부분을 rule="user_id" 이렇게 바꾸고 해결 <?xml version="1.0" encoding="utf-8"?><ruleset version="1.5.0"><customrules></customrules><fields><field name="user_id" required="true"...
    Date2016.11.23 Category제로보드 Views188
    Read More
  4. No Image

    xe DB환경설정 경로입니다.

    xe DB환경설정 경로입니다. 서버 이전시 필수로 꼭 수정해주셔야합니다. /xe/files/config/db.config.php •'db_hostname' => 'localhost' •'db_userid' => 'DB아이디' •'db_password' => 'DB비밀...
    Date2016.11.23 Category제로보드 Views108
    Read More
  5. No Image

    Install Manual - phpMyAdmin (edit.2016.04.26)

    https://www.phpmyadmin.net/ D:\_www\_phpMyAdmin 압축 풀기 phpmyadmin 폴더로 들어가서 config.sample.inc.php 파일을 복사하여 붙인후 config.inc.php 로 파일 이름을 변경 config.inc.php 편집 $cfg['Servers'][$i]['AllowNoPassword'] ...
    Date2016.04.26 Category웹서버 Views69
    Read More
  6. No Image

    Install Manual - MySQL (edit.2016.04.26)

    윈도우용 MySQL 5.7 설치 http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.12-winx64.zip http://dev.mysql.com/downloads/mysql/ MySQL에 들어가 보면 MySQL의 다양한 버전이 있어서 무엇을 다운받아야 할지 당황스러울수가 있는데 위 링크를 클릭해...
    Date2016.04.26 Category웹서버 Views65
    Read More
  7. No Image

    Install Manual - PHP (edit.2016.04.26)

    1. Visual C++ Redistributable for Visual Studio 2012 설치 경로 : http://www.microsoft.com/en-us/download/details.aspx?id=30679 파일 : vcredist_x64.exe apache v11, php v11 버전들은 Visual C++ Redistributable for Visual Studio 2012 해당 프로그...
    Date2016.04.26 Category웹서버 Views128
    Read More
  8. No Image

    Install Manual - Apache (edit.2016.04.26)

    아파치 설치 1. 다운로드  http://www.apachelounge.com/download/ ● "D:/_www/_apache" 압축 풀기 2. ServerRoot 변경   "D:/_www/_apache/conf/httpd.conf" 파일 편집 ● ServerRoot "D:/_www/_apache" ● Listen 80 ● ServerAdmin postmaster@localhost (관리...
    Date2016.04.26 Category웹서버 Views82
    Read More
  9. xtrm.myds.me/photo

    Photo Station http://web.xtrm.myds.me/photo Security CODE : WEB172OPA486NTN082 Staff only
    Date2016.04.23 Category기타 Views175
    Read More
  10. No Image

    httpd.conf - 아파치 웹 서버 보안

    httpd.conf - 아파치 웹 서버 보안   >> 특정 IP(대역)를 사용하는 호스트 차단하기 # vi /usr/local/apache/conf/httpd.conf   <Directory /usr/local/apache/htdocs>     Order Allow,Deny     Deny from 192.168.1     Allow from all </Directory>   해당 ...
    Date2016.04.08 Category웹서버 Views136
    Read More
  11. No Image

    elfinder.full.css 코드 추가

    /* custom icon size add by Manuel */ .elfinder-cwd-icon {   width: 150px !important;   height: 155px !important; } .elfinder-cwd-view-icons .elfinder-cwd-file-wrapper {   width: 155px !important;   height: 150px !important; } .elfinder-cwd-v...
    Date2016.03.31 Category제로보드 Views217
    Read More
Board Pagination Prev 1 Next
/ 1