<-
Apache > HTTP Server > Documentation > Version 2.4

� �

¹® 5 � 5±Ù ó°� �) ¹® � Âü� .

� /a> � � ü � °Å , � � �$ URL� � ¹® ¤¸� � � � ±â � �4 .htaccess � �) ¹æ �

Âü

top

� � "�

� �' "�� �� ¸Å 2 2¸® �� 2� � � � � ��, � �� ²¨ � 2¸® � Âü4¸é � ¸ð 2 � Âü � � ¹«

httpd ¸÷ �� °æ0 � � � � � � � � ¤¸�, �� httpd -DClosedForNow� °æ0 � ¸ð 2 ¤¸� �4 � ¸®�4


Redirect / http://otherserver.example.com/

� � ¸ð � � � °æ0 � � � � � � ¸Å ¾w ¸ð � � ÄÄ � °Å � ÄÄ � � LoadModule $ � � � ¸ð � ¹« � �< � � � �) � ¸ð °æ � � ¹® � � ¹® � �) � � �

mod_mime_magic � MimeMagicFiles � 2¸®


MimeMagicFile conf/magic

� � "!" � Á¶°Ç � , � �$ °ã �) º¹! ��� �

top

�$ � ¹°��

� # �) � � �$ � ¹°��(webspace) � � � ó°� ¬¤4 ¸Õ Â÷4 � � � $ �$ � ü � � � º¸ ±« � � ±âº»°¾ 9� � � � �$ °æ /usr/local/apache2, � �$ °æ "c:/Program Files/Apache Group/Apache2" � (9 � Á¶Â÷ , �� , �� �) � ÁÖ ) �� ¹°�� � �� °ø � ��48 � º¸ �4 � ±« ±× � ±âº» 9 � � °æ ¹°�� °æ /dir/ �$ °æ /usr/local/apache2/htdocs/dir/ �� ¹°�� �4 º« � � � ±â ¹® � �$ '

�$ �

� � �) � �$ � �� � � � � � �� ' �$ ¸® � ¸® � .htaccess /a> �) � °á°ú � � � � ¤¸�, � ¸ñ (index) /var/web/dir1 � ¸® � ¸ñ (index) �%


Options +Indexes

� � � �� � ¸® ' �� ' � �' � � �< ÁÖ$ �� � � � ¤¸�, � �� private.html� � � ±Ù °Å


Order allow,deny
Deny from all

�$ � �� � '9±â � � �) � � � ¤¸�, /var/web/dir1/private.html, /var/web/dir1/subdir2/private.html, /var/web/dir1/subdir3/private.html � /var/web/dir1/ � � private.html � ±Ù °Å



Order allow,deny
Deny from all

¹°�� �

� � �� � �) � �� � ¹°�� � ð²� � � � ¤¸�, /private� URL-°æ ±Ù °Å ¬±� http://yoursite.example.com/private, http://yoursite.example.com/private123, http://yoursite.example.com/private/dir/file.html � /private ¹®4 2 ��


Order Allow,Deny
Deny from all

� �$ � � �� � URL mod_status� °ø 9 � ��� � '� º¸, �$ server-status� �


SetHandler server-status

� Ä« �

, , � C $ �ì¸� fnmatch � �) � Ä« ¹® � �) "*" ¹® � ¹®44� � , "?" ¹® � ¹® �� ´¸�, "[seq]" seq $ ¹® � � � � Ä« "/" ¹® � � ¸ø ±× ¹® ' �) �

� � � perl� � �) , , � �) ±×� � °á � � � � �) � � � ¹æ �� �' � �

¸ð �) � � ó°� �� � Ä« � � � �


Options Indexes

� � �) � � "� ±×¸²� ±Ù °Å


Order allow,deny
Deny from all

¹« �)

�$ � � ¹°�� � $ � � � � ¸Å � �$ °Ã� � � � �) (�4 º«$ � � � � �$ ' °Ã� � � �)

�$ °Ã� ±Ù ±â �) � � ¤¸� ¹°�� � (URL)� � �$ � � �, °É4 � � ¹®4 � � � � ´º�:


Order allow,deny
Deny from all

http://yoursite.example.com/dir/ ̤¸é ±×� ¹® � ±¸ ' �$ �) ¤¸� �� ? http://yoursite.example.com/DIR/ 2 � � �� � �� 2' �� � � ºþ �) � (� �$ ¸È �) °æ0 ¬º¼¸� �) ¸® �$ � � � ¬º¼¸� �� ±×� � $ º¸ � Options � �) ¬º¼¸� ¹«4 )

� � ¹® � ±¸ �$ �) �� � � �4 ' � �' ¸ð¸¥ ±×� ¤¸� ¹æ� � ¹°�� 9� �$ 9 ±â5 ±× �% � �$ � �) � ±×� �9 � � � � � � URL ¸ð 2 � �� º® �

top

°¼$ /a>

� � �$ � � �� � � � ÄÄ � � �� ¤¸� � �) � �$ � ºþ � � º¸ °¼$ ¹® � Âü

top

�

� ' URL mod_proxy � �� °Å ±Ù °æ0 � � � � � ¤¸�, � �� � cnn.com �,4 � ±Ù


Order allow,deny
Deny from all

top

� � �) ?

� � � �) � ¤¸� � �)% � � �)� � , , , , , , � �)� ±×� , �

top

�$ °á � ¹æ

� � ¸Å � ¹æ� � � � � � ¹æ $ � Áֱ⹮ ¹æ � � � $

°á � :

  1. (� �) ') .htaccess �4 (°æ0 � .htaccess � ¹« � �
  2. (±×¸®� )
  3. �4 /li>
  4. � �4 /li>

� � � � �$ �< � 2¸® ( 1) � �) � ª � ±äÂÊ� 2¸® ±× � � � 2¸® � ¸® '9 � � ¤¸� �� � � 2¸® Include � � � � Include ' 9 � � �) �2 2¸®

� � � � °¼$ � � � � ±× °¼$ ÁÖ � �,

mod_proxy� 2 ºþ , � 2¸® � � �

� � � � � °á°ú�

±â ÁÖ

� � / (Aliases DocumentRoot� �) URL �� �) � � � � 2¸® � � ¹«

� °ã � � � � ¸ð 2 �� �� � A > B > C > D > E � 2¸®


E



D




B




C



A


� � � � � $ 2¸® �� � ±Ù � �� � ¹« ±Ù �% &, °á � $�� ÁÖ


Order deny,allow
Allow from all


# ! � ¹« ��� br />
Order allow,deny
Allow from all
Deny from badguy.example.com

�% �  en� |  fr� |  ja� |  ko� |  tr�

top

Comments

Notice:
This is not a Q&A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our mailing lists.