½ûÖ¹ÏÔʾApacheĿ¼Áбí-Indexes FollowSymLinks
ÈçºÎÐÞ¸ÄĿ¼µÄÅäÖÃÒÔ½ûÖ¹ÏÔʾ Apache Ŀ¼ÁÐ±í¡£
ȱʡÇé¿öÏÂÈç¹ûÄãÔÚä¯ÀÀÆ÷ÊäÈëµØÖ·£º
http://localhost:8080/
Èç¹ûÄãµÄÎļþ¸ùĿ¼ÀïÓÐ index.html£¬ä¯ÀÀÆ÷¾Í»áÏÔʾ index.htmlµÄÄÚÈÝ£¬Èç¹ûûÓÐ index.html£¬ä¯ÀÀÆ÷¾Í»áÏÔʾÎļþ¸ùĿ¼µÄĿ¼ÁÐ±í£¬Ä¿Â¼Áбí°üÀ¨Îļþ¸ùĿ¼ÏµÄÎļþºÍ×ÓĿ¼¡£
ͬÑùÄãÊäÈëÒ»¸öÐéÄâĿ¼µÄµØÖ·£º
http://localhost:8080/b/
Èç¹û¸ÃÐéÄâĿ¼ÏÂûÓÐ index.html£¬ä¯ÀÀÆ÷Ò²»áÏÔʾ¸ÃÐéÄâĿ¼µÄĿ¼½á¹¹£¬Áгö¸ÃÐéÄâĿ¼ÏµÄÎļþºÍ×ÓĿ¼¡£
ÈçºÎ½ûÖ¹ Apache ÏÔʾĿ¼ÁбíÄØ£¿
Òª½ûÖ¹ Apache ÏÔʾĿ¼½á¹¹ÁÐ±í£¬Ö»Ð轫 Option ÖÐµÄ Indexes È¥µô¼´¿É¡£
±ÈÈçÎÒÃÇ¿´¿´Ò»¸öĿ¼µÄĿ¼ÅäÖãº
<Directory "D:/Apa/blabla">
Options Indexes FollowSymLinks #---------->Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
ÄãÖ»ÐèÒª½«ÉÏÃæºìÉ«´úÂëÖÐµÄ Indexes È¥µô£¬¾Í¿ÉÒÔ½ûÖ¹ Apache ÏÔʾ¸ÃĿ¼½á¹¹¡£Óû§¾Í²»»á¿´µ½¸ÃĿ¼ÏµÄÎļþºÍ×ÓĿ¼ÁбíÁË¡£
Indexes µÄ×÷ÓþÍÊǵ±¸ÃĿ¼ÏÂûÓÐ index.html Îļþʱ£¬¾ÍÏÔʾĿ¼½á¹¹£¬È¥µô Indexes£¬Apache ¾Í²»»áÏÔʾ¸ÃĿ¼µÄÁбíÁË¡£
µÚ¶þÖÖ·½·¨
½â¾ö°ì·¨£º
1¡¢±à¼httpd.confÎļþ
vi ./conf/httpd.conf
ÕÒµ½ÈçÏÂÄÚÈÝ£º
……
<Directory “C:/Program Files/Apache2.2/htdocs”>
#
# Possible values for the Options directive are “None”, “All”,
# or any combination of:
Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that “MultiViews” must be named *explicitly* — “Options All”
# doesn’t give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be “All”, “None”, or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride None
#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all
</Directory>
……
ÔÚOptions Indexes FollowSymLinksÔÚIndexesÇ°Ãæ¼ÓÉÏ – ·ûºÅ¡£
¼´£º Options -Indexes FollowSymLinks
¡¾±¸×¢£ºÔÚIndexesǰ£¬¼Ó + ´ú±íÔÊÐíĿ¼ä¯ÀÀ£»¼Ó – ´ú±í½ûֹĿ¼ä¯ÀÀ¡£¡¿
ÕâÑùµÄ»°¾ÍÊôÓÚÕû¸öApache½ûֹĿ¼ä¯ÀÀÁË¡£
Èç¹ûÊÇÔÚÐéÄâÖ÷»úÖУ¬Ö»ÒªÔö¼ÓÈçÏÂÐÅÏ¢¾ÍÐУº
<Directory “D:\test”>
Options -Indexes FollowSymLinks
AllowOverride None
Order deny,allow
Allow from all
</Directory>
ÕâÑùµÄ»°¾Í½ûÖ¹ÔÚtest¹¤³ÌϽøÐÐĿ¼ä¯ÀÀ¡£
±¸×¢£º ÇмÇĪ°Ñ“Allow from all”¸Ä³É “Deny from all”£¬·ñÔò£¬Õû¸öÍøÕ¾¶¼²»Äܱ»´ò¿ª¡£
<Finished>
»¹ÓÐÒ»ÖÖ·½·¨£º
¿ÉÒÔÔÚ¸ùĿ¼µÄ .htaccess ÎļþÖÐÊäÈë
- <Files *>
- Options -Indexes
- </Files>
¾Í¿ÉÒÔ×èÖ¹Apache ½«Ä¿Â¼½á¹¹Áбí³öÀ´¡£







½ûÖ¹ÏÔʾApacheĿ¼Áбí-Indexes FollowSymLinks


