Ä¿ÇÇÇâÀÌ ³ª´Â *NIX
Ä¿ÇǴнº
½Ã½ºÅÛ/³×Æ®¿÷/º¸¾ÈÀ» ´Ù·ç´Â °÷
*
HanIRCÀÇ #coffeenix ¹æ
[
Àåºñ ¹× ȸ¼± ÈÄ¿ø
]
> Forum <
IT ÀÏÁ¤
N
e
w
!
ÀÚµ¿È ÇÁ·ÎÁ§Æ®
HOME
>
³×Æ®¿öÅ©(network)
>
À¥ ¼¹ö(web, httpd, apache)
µµ¿ò¸»
°Ë»ö :
»çÀÌÆ®
WHOIS
À¥¼¹ö Á¾·ù
WebDAV
(7, ±Û 1, ÀÚ·á 4)
À¥¼¹ö Æ©´×
(5, ±Û 4, ÀÚ·á 2)
À¥¼¹ö »ç¿ë Åë°è ÀÚ·á
(2, ÀÚ·á 1)
Apache SSL / mod_ssl
(4, ±Û 3, ÀÚ·á 2)
¾ÆÆÄÄ¡ ¼³Á¤ È°¿ë ¿¹(¼ºñ½º Á¦ÇÑÃø¸é)
ÀÛ¼ºÀÏ : 2005/01/28 23:48
±Û¾´ÀÌ : ÁÁÀºÁøÈ£ (
http://coffeenix.net/
)
Á¶È¸¼ö : 13764
[
ÀÌÀüȸé
/
¼öÁ¤
] ºñ¹Ð¹øÈ£ :
Á¦ ¸ñ : ¾ÆÆÄÄ¡ ¼³Á¤ È°¿ë ¿¹(¼ºñ½º Á¦ÇÑÃø¸é)
ÀÛ¼ºÀÚ : ÁÁÀºÁøÈ£(truefeel,
http://coffeenix.net/
)
ÀÛ¼ºÀÏ : 2003.2~
Á¤¸®ÀÏ : 2005.1.28(±Ý)
¼öÁ¤ÀÏ : 2005.7.16(Åä) : 2-4) ³»¿ë Ãß°¡
2005.11.5(Åä) : 2-3) ³»¿ë Ãß°¡
¾ÆÆÄÄ¡ À¥¼¹öÀÇ È°¿ë¿¡ ÀÖ¾î, º¸´Ù³ªÀº º¸¾È ¼³Á¤ ¹æ¹ý ¸î °¡Áö¸¦ ¼Ò°³ÇÑ´Ù.
ƯÁ¤ Agent°¡ ÀÚ²Ù »çÀÌÆ®¿¡ µé¾î¿Í¼ ±Ü¾î°£´ÙµçÁö,
À̹ÌÁö ÆÄÀÏÀ» ¿ÜºÎ¿¡¼ ¸µÅ©ÇÏÁö ¸øÇϵµ·Ï ÇÑ´ÙµçÁö,
ƯÁ¤ IP¿¡¼´Â ÀÎÁõ¾øÀÌ, ±× ÀÌ¿Ü IP¿¡¼´Â ¾ÆÆÄÄ¡ ÀÎÁõÀ» ÅëÇؼ¸¸ ÆäÀÌÁö¸¦ º¸°ÔÇÏ´Â
µîÀÇ ÀÀ¿ëÀûÀÎ Ãø¸é¿¡¼ ¹æ¹ýµéÀÌ´Ù.
ÀÌ ¹æ¹ýµéÀº Á¦°¡ »ç¿ëÇÏ°í ÀÖ´Â ¸î°¡Áö ¹æ¹ýÀ» Á¤¸®ÇÏ´Â Àǹ̿¡¼ ÀûÀº °ÍÀÌ´Ù.
1. ƯÁ¤ ºê¶ó¿ìÀúÀÇ Á¢¼ÓÀ» Â÷´Ü
SetEnvIfNoCase User-Agent "^Microsoft URL Control" dont_want
<Directory /usr/local/apache/htdocs>
<Limit GET POST>
¡¡¡¡¡¡Order Allow,Deny
¡¡¡¡¡¡Allow from all
¡¡¡¡¡¡Deny from env=dont_want
</Limit>
</Directory>
----------------------------------------------
SetEnvIfNoCase User-Agent "^Wget" bad_bot
SetEnvIfNoCase User-Agent "^EmailSiphon" bad_bot
SetEnvIfNoCase User-Agent "^EmailWolf" bad_bot
The 'SetEnvIfNoCase' simply sets an enviornment (SetEnv) variable called
'bad_bot' If (SetEnvIf) the 'User-Agent' string contains Wget, EmailSiphon, or
EmailWolf, regardless of case (SetEnvIfNoCase). In english, anytime a browser
with a name containing 'wget, emailsiphon, or emailwolf' accesses our website,
we set a variable called 'bad_bot'. We'd also want to add a line for the
User-Agent string of any other Spidert we want to deny.
Now we tell Apache which directories to block the Spiderts from with the
<Directory> directive:
<Directory "/home/evolt/public_html/users/">
Order Allow,Deny
Allow from all
Deny from env=bad_bot
</Directory>
2. ´Ù¸¥ °÷¿¡¼ images¸¦ linkÇÏÁö ¸øÇϵµ·Ï (hotlink ¹æÁö)
´Ù¸¥ °÷¿¡¼ ÆÄÀÏÀ» ¸µÅ©ÇÏÁö ¸øÇϵµ·Ï ÇÏ´Â °ÍÀ» hotlink ¹æÁö¶ó°í ÇÑ´Ù.
hotlink ¹æÁö¼³Á¤À» ÅëÇÏ¿©
- ¿ÜºÎ »çÀÌÆ®¿¡¼ ¸µÅ©¸¦ ÅëÇÑ ÄÁÅÙÃ÷ À¯Ãâ ¹æÁö¿Í
- Æ®·¡ÇÈ °¨¼Ò È¿°ú¸¦ º¼ ¼ö ÀÖ´Ù.
1) µð·ºÅ丮¸¦ Á¦ÇÑÇÏ´Â ¹æ¹ý
referer üũ¸¦ ÅëÇØ ¿ÜºÎ¿¡¼ /images ÀÌÇϵð·ºÅ丮ÀÇ ÆÄÀÏÀ» linkÇÏÁö ¸øÇϵµ·Ï ÇÑ´Ù.
À̸¦Å׸é truefeel.kr À̶ó´Â »çÀÌÆ®°¡ ÀÖÀ» ¶§
truefeel.kr³»¿¡ ÀÖ´Â µ¿¿µ»óÀ» ÀÌ µµ¸ÞÀο¡¼´Â ¸µÅ©ÇÒ ¼ö ÀÖÁö¸¸
¿ÜºÎ »çÀÌÆ®¿¡¼´Â ÀÌ µ¿¿µ»óÀ» ¸µÅ©Çصµ ±ÇÇÑÀÌ ¾øµµ·Ï ÇÒ ¼ö ÀÖ´Ù.
SetEnvIf Referer "^http://localhost/" local_referal
SetEnvIf Referer "^
http://127.0.0.1/
" local_referal
SetEnvIf Referer "^http://ȨÆäÀÌÁö¸í/" local_referal
SetEnvIf Referer "^$" local_referal
<Directory /usr/local/apache/htdocs/images>
Order Deny,Allow
Deny from all
Allow from env=local_referal
</Directory>
2) À̹ÌÁö ÆÄÀÏ È®ÀåÀÚ·Î Á¦ÇÑÇÏ´Â ¹æ¹ý (Referer »ç¿ë)
¼ºñ½º ÆäÀÌÁö°¡ ????.truefeel.kr ÀÏ ¶§
SetEnvIfNoCase Referer "^http://localhost/" local_referal
SetEnvIf Referer "^
http://127.0.0.1/
" local_referal
SetEnvIfNoCase Referer "^http://(.*).truefeel.kr/" local_referal
SetEnvIfNoCase Referer "^
http://truefeel.kr/
" local_referal
SetEnvIfNoCase Referer "^$" local_referal
<Files ~ "\.(gif|jpg|jpeg|png|bmp)$">
Order deny,allow
Deny from all
Allow from env=local_referal
</Files>
3) À̹ÌÁö ÆÄÀÏ È®ÀåÀÚ·Î Á¦ÇÑÇÏ´Â ¹æ¹ý 2 (Rewriting Rule »ç¿ë)
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^
http://truefeel.aaa/
.*$ [NC]
RewriteCond %{HTTP_REFERER} !^
http://www.truefeel.aaa/
.*$ [NC]
RewriteRule \.(jpg|jpeg|gif|png|bmp)$ /images/deny.jpg [NC,L]
À§Ã³·³ ¼³Á¤Çϸé À§ 2°³ÀÇ URL°ú ºê¶ó¿ìÀúÀÇ ÁÖ¼Òâ¿¡ À̹ÌÁö¸¦ Á÷Á¢ÀÔ·ÂÇÑ °æ¿ì¸¦ Á¦¿ÜÇÏ°í´Â
/images/deny.jpg¸¦ º¸¿©ÁÖ°Ô µÈ´Ù.
NC(no case)´Â ´ë¼Ò¹®ÀÚ ±¸ºÐÇÏÁö ¾ÊÀ½. LÀº ¸¶Áö¸· ·êÀÓÀ» Ç¥½ÃÇÑ´Ù.
4) À̹ÌÁö ÆÄÀÏ È®ÀåÀÚ·Î Á¦Çѽà ƯÁ¤ µð·ºÅ丮´Â Á¦¿ÜÇÏ´Â ¹æ¹ý
À§ÀÇ '2)' ¼³Á¤¿¡ ´ÙÀ½ ³»¿ëÀ» Ãß°¡Çϸé /upload/ µð·ºÅ丮¿¡ ÀÖ´Â .jpg ÆÄÀÏÀ̶óµµ
¿ÜºÎ ¸µÅ©¸¦ Çã¿ëÇÏ°Ô µÈ´Ù.
SetEnvIfNoCase Request_URI "^/upload/" local_referal
3. ƯÁ¤ IP¿¡¼¸¸ Á¢±Ù °¡´ÉÇÏ°Ô
³Ê¹«³ªµµ ÈçÇÑ ¹æ¹ýÀ̱ä Çѵ¥, °³ÀÎÀûÀ¸·Î Àú¿¡°Ô ÀÌ·± ºÎºÐÀ» ¹°¾îº¸½Ã´Â ºÐÀÌ ¸¹¾Ò´Ù.
¾Æ·¡ÀÇ ¿¹´Â /usr/local/apache/htdocs µð·ºÅ丮¸¦ 211.111.222.0/24 ´ë¿ª¿¡¼¸¸ Á¢±Ù°¡´ÉÇÑ ¼³Á¤ÀÌ´Ù.
<Directory "/usr/local/apache/htdocs">
Options FollowSymLinks MultiViews
AllowOverride AuthConfig
Order deny,allow
Deny from all
Allow from 211.111.222.0/255.255.255.0
</Directory>
¹Ý´ë·Î ¾Æ·¡¿Í °°ÀÌ Çϸé ÁöÁ¤ÇÑ IP´ë¿ª¿¡¼¸¸ Á¢±ÙÇÒ ¼ö ¾ø´Ù.
... »ý·« ...
Order allow,deny
Allow from all
Deny from 211.111.222.0/255.255.255.0
... »ý·« ...
4. ƯÁ¤ÆäÀÌÁö¸¦ ÀÎÁõµÈ »ç¿ëÀÚ¸¸ º¼ ¼ö ÀÖ´Â ¾ÆÆÄÄ¡ ÀÎÁõ ¼³Á¤
À̹ø ±ÛÀº 5¹øÀÇ ÀÎÁõ ¼³Á¤À» ¾Ë±â Àü¿¡ ¾ÆÆÄÄ¡ ÀÎÁõ¿¡ ´ëÇØ ¸ð¸£´Â ºÐÀ» À§ÇØ ÀûÀº °ÍÀ¸·Î
¾ÆÆÄÄ¡ ÀÎÁõÀÌ ¹«¾ùÀÎÁö ¾È´Ù¸é 5¹øÀ¸·Î ¹Ù·Î ³Ñ¾î°¡±â ¹Ù¶õ´Ù.
¾ÆÆÄÄ¡¿¡¼´Â ƯÁ¤ ÆäÀÌÁö¸¦ Á¢±ÙÇÒ ¶§ ID¿Í ºñ¹Ð¹øÈ£¸¦ ¾Ë¾Æ¾ß¸¸ Á¢±ÙÇϵµ·Ï ¼³Á¤ÇÒ ¼ö ÀÖ´Ù.
´ÙÀ½ ¿¹¸¦ º¸ÀÚ.
<Directory "/home/truefeel/public_html">
Options FollowSymLinks MultiViews
AllowOverride AuthConfig
</Directory>
À§ ó·³ AllowOverride AuthConfig ¼³Á¤À» Çϸé ~truefeel/public_html µð·ºÅ丮¿¡ ÀÎÁõ °úÁ¤À»
°ÅÄ¡´Â ±âº» ¼³Á¤Àº µÈ °ÍÀÌ´Ù.
¸¸¾à ~truefeel/public_html/manager/ ¾Æ·¡ÀÇ µð·ºÅ丮¿¡ ÀÎÁõÀ» °É·Á°í ÇÑ´Ù¸é ±× µð·ºÅ丮¿¡
´ÙÀ½°ú °°Àº Çü½ÄÀÇ .htaccess ÆÄÀÏÀ» »ý¼ºÇÑ´Ù.
[ ~truefee/public_html/manger/.htaccess ÆÄÀÏ ³»¿ë ]
AuthType Basic
AuthName User <-- "User" ´Â ÀÎÁõâ¿¡ Ç¥½ÃµÉ ¸Þ½ÃÁö ÁßÀÇ ÇϳªÀÏ »Ó ½Å°æ¾µ ÇÊ¿ä ¾ø´Ù.
AuthUserFile /home/truefeel/manage/.htpasswd
AuthGroupFile /dev/null
<Limit GET POST>
require valid-user
</Limit>
.htpasswd ÆÄÀÏ¿¡ ID/PW¸¦ »ý¼ºÇصθé ÇØ´çÆäÀÌÁö ÀÎÁõÀ» ÇÒ ¼ö ÀÖ°Ô µÈ´Ù.
5. ƯÁ¤ IP´Â ÀÎÁõ¾øÀÌ, ±× ÀÌ¿Ü´Â ¾ÆÆÄÄ¡ ÀÎÁõ °ÅÄ¡µµ·Ï
¾Æ·¡ÀÇ ¼³Á¤Àº À§ÀÇ 4¹ø ±ÛÀ» Àоú´Ù¸é ¹º°¡ Á¾ÇÕÀûÀÎ ¼³Á¤À» ÇÑ °Í ó·³ º¸ÀÏ °ÍÀÌ´Ù.
<Location />
AuthType Basic
AuthName User
AuthUserFile /home/truefeel/manage/.htpasswd
AuthGroupFile /dev/null
require valid-user
order deny,allow
deny from all
allow from 211.111.222.0/255.255.255.0
Satisfy any
</Location>
À§ÀÇ ¼³Á¤Àº
- 211.111.222.0/24 IP ´ë¿ª¿¡ ÀÖ´Â Á¢¼ÓÀÚ´Â ÀÎÁõ¾øÀÌ Åë°úÇÏ°í,
- ±× ÀÌ¿ÜÀÇ IP ´ë¿ª¿¡¼ Á¢¼ÓÇϸé ÀÎÁõÀ» °ÅÃľßÇÏ´Â ¼³Á¤ÀÌ´Ù.
ÀÌ ¼³Á¤Àº Satisfy any Áö½ÃÀÚ¸¦ ÅëÇؼ ÀÌ·ïÁø´Ù. IP°¡ ¸Â°Å³ª ID/PW°¡ ¸ÂÀ¸¸é µÇ´Â °ÍÀÌ´Ù. (OR)
¸¸¾à Satisfy all À̶ó°í Àû¾ú´Ù¸é
- IP´ë¿ªÀÌ 211.111.222.0/24 À̸é¼
- ÀÎÁõ±îÁö ¸ðµÎ Åë°ú Çؾß
ÇØ´ç ÆäÀÌÁö¿¡ Á¢±ÙÀÌ °¡´ÉÇÏ´Ù. (AND)
6. ¾÷·Îµå µð·ºÅ丮ÀÇ .phpÆÄÀÏÀº textó·³ ÀνÄÇϱâ
php³ª cgi µîÀ¸·Î ÆÄÀÏ ¾÷·Îµå °¡´ÉÇϵµ·Ï ±¸ÇöµÈ °æ¿ì .php³ª .html µîÀÇ ÆÄÀÏÀ» ¾÷·ÎµåÇÒ ¼ö
ÀÖ´Â ½Ç¼ö¸¦ ¹üÇÒ ¼ö ÀÖ´Ù.
ÀÌ·± ½Ç¼ö¸¦ ÇÏ´õ¶óµµ ÁöÁ¤ÇÑ ¾÷·Îµå µð·ºÅ丮¿¡ ÀÖ´Â .php³ª .html ÆÄÀÏÀ» phpÇÁ·Î±×·¥À¸·Î
ÀνÄÇÏÁö ¾Ê°í ÀÏ¹Ý ÅؽºÆ® ÆÄÀÏ·Î ÆÇ´ÜÇϵµ·Ï ¼³Á¤ÇÏ¿© º¸´Ù ¾ÈÀüÇÑ À¥ÆäÀÌÁö ±¸¼ºÀÌ °¡´ÉÇÏ´Ù.
´ÙÀ½Àº /upload/ ¿Í /files/ µð·ºÅ丮 ¾Æ·¡ÀÇ phpÆÄÀÏÀº ÀÏ¹Ý ÅؽºÆ®·Î ÀνÄÇ϶ó´Â ¼³Á¤ÀÌ´Ù.
<Directory ~ "/usr/local/apache/htdocs/(upload|files)">
RemoveType .html .php
</Directory>
À§¿¡¼ ~ ±âÈ£´Â µð·ºÅ丮 °æ·Î¿¡ Á¤±Ô Ç¥Çö½ÄÀ» »ç¿ëÇÏ°Ú´Ù´Â Àǹ̷Π(upload|files) ºÎºÐÀ»
Á¤±Ô Ç¥Çö½ÄÀ¸·Î ÀνÄÇÑ´Ù. µû¶ó¼ htdocs/ ÀÌÇÏÀÇ upload µð·ºÅ丮¿Í files µð·ºÅ丮¸¦ ÀǹÌÇÑ´Ù.
´Ü¼øÈ÷ /home/truefeel/public_html/data µð·ºÅ丮¶ó¸é
<Directory "/home/truefeel/public_html/data"> ¿Í °°ÀÌ ¼³Á¤ÇÏ¸é µÈ´Ù.
7. Âü°í ÀÚ·á
* Apache Directives
http://httpd.apache.org/docs/mod/directives.html
* Apache Authentication and Access Control
http://www.apache.kr.net/documents/authplus-story.html
Ä¿ÇǴнº Ä«Æä ÃÖ±Ù ±Û
[12/25]
Àνº
[10/20]
Cross Compiler ±ò
[07/14]
SSL ¬¡¬°
[04/26]
Re: µµ½ºÈ¸é ¿ø°ÝÁ¶Á¾ ¿©ºÎ
[04/25]
µµ½ºÈ¸é ¿ø°ÝÁ¶Á¾ ¿©ºÎ
[10/30]
Cshell¿¡¼ ³¼ö ¼³Á¤
[10/23]
°øÇ×öµµÁÖ½Äȸ»ç SE ±¸ÀÎ Ëì
[01/26]
Re: wgetÀ¸·Î ´Ù¸¥¼¹ö¿¡ÀÖ´Â µð·ºÅ丮¸¦ °¡Á®¿À·Á°íÇÕ´Ï´Ù.
[01/25]
wgetÀ¸·Î ´Ù¸¥¼¹ö¿¡ÀÖ´Â µð·ºÅ丮¸¦ °¡Á®¿À·Á°íÇÕ´Ï´Ù.
[01/11]
ƯÁ¤ ¾Èµå·ÎÀ̵å WebView ¹öÀü¿¡¼ SSL ¹®Á¦ (WebView ¹ö±×)
[08/01]
DNS forwarder (Àü´ÞÀÚ) ¼¹ö¸¦ ÅëÇؼ Äõ¸®ÇÏ¸é ¿ª¹æÇâÀ» ¹Þ¾Æ¿ÀÁú ¸øÇÕ´Ï´Ù.
[05/16]
(ÁÖ)ÈÄÀÌÁî ½Ã½ºÅÛ¿£Áö´Ï¾î (°æ·ÂÀÚ) ¸ðÁý
[02/15]
[AWS] Cloudfront edge È®ÀÎÇϱâ
[01/20]
Mobile Service/eCommerce ±â¾÷¿¡¼ Server / Java / PHP °³¹ßÀÚ ±¸ÀÎ
[01/11]
źźÇÑ ÆÛºí¸®½Ì ¸ð¹ÙÀϱâ¾÷¿¡¼ Mobile °³¹ßÀÚ¸¦ ¸ð½Ê´Ï´Ù.
N
e
w
! ÃÖ±Ù¿¡ µî·ÏÇÑ ÆäÀÌÁö
KiCad EDA Suite project (Free/Libre/Open-Source EDA Suite) (CAD)
¿ÀÇÂij½ºÄÉÀ̵å ijµå (OpenCASCADE CAD)
QCad for Windows --- GNU GPL (Free Software)
The Hello World Collection
IPMI¸¦ È°¿ëÇÑ ¸®´ª½º ¼¹ö°ü¸®
DNS ¼³Á¤ °Ë»ç
nagiosgraph ¼³Ä¡ ¹æ¹ý
Slony-I ¼³Ä¡ ¹æ¹ý (postgresql replication tool)
Qmail±â¹ÝÀÇ Anti spam ½Ã½ºÅÛ ±¸ÃàÇϱâ
clusterssh
[ ÇÔ²²ÇÏ´Â »çÀÌÆ® ]
¿î¿µÁø :
ÁÁÀºÁøÈ£(truefeel)
, ¾ß¼ö(yasu), ¹ü³ÃÀÌ, sCag
2003³â 8¿ù 4ÀÏ~