<Directory "/usr/local/apache/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>
/usr/local/apache/conf/extra/httpd-vhosts.conf <VirtualHost *:80> <Directory "/var/vhosts/www.test.cn" > #Deny from all Allow from all </Directory> DocumentRoot "/var/vhosts/www.test.cn" ServerName www.test.cn </VirtualHost>
如果把Deny from all的注釋去掉,那么服務器就會拒絕所有訪問(和我們剛開始把主目錄移動到htdocs外而沒做任何配置修改時一樣,哈哈) 補充一點: 如果你是寫個index.php放在目錄下測試,可要注意了,記得加上默認主頁index.php DirectoryIndex index.html index.php
您可能感興趣的文章:
關于Apache默認編碼錯誤 導致網站亂碼的解決方案apache2.2和php5.2.17在windows下整合過程的錯誤解決方法Apache訪問出現501 Method Not Implemented錯誤解決