<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错误解决