apache下虚拟主机的配置
来源:互联网 发布:金一珠宝软件 编辑:程序博客网 时间:2024/04/28 23:23
1. 启用httpd-vhosts.conf
在httpd.confg文件中找到
# Virtual hosts #Include conf/extra/httpd-vhosts.conf(这里将前面的#去掉即可启用虚拟主机)
! 如果是使用套件AppServ之类的还需要启用mod_vhost_alias.so模块(#LoadModule vhost_alias_module modules/mod_vhost_alias.so)
2. 配置httpd-vhosts.conf
<VirtualHost *:80>
#配置网站站点根目录(例如:d:/mywebsite)
DocumentRoot "d:/mywebsite"
#配置网站域名
ServerName www.website.com
#下面配置网站根目录的相关属性('/' <=> 'd:/mywebsite' )
<Directory />
#配置在没有指定网站首页面时,是否显示目录结构列表
Options index FollowSymLinks
#配置修改权限(None 表示不允许)
AllowOverride None
#设置访问权限
Order allow,deny
Allow from all
#配置网站的首页面
DiectoryIndex index.html index.htm index.php
#配置网站404错误页面
errorDocument 404 /404.html
</Directory>
</VirtualHost>
Options index FollowSymLinks: 如果这里有index则指明可以显示目录结构列表,如果不想显示目录结构料,有如下几种方式:
① 将index直接去掉即可
②httpd.confg文件中找到如下内容
<Directory "C:/AppServ/www"> #这里C:/AppServ/www是apache服务器默认的根目录 # 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 MultiViews ExecCGI # # 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 All # # Controls who can get stuff from this server. # Order allow,deny Allow from all</Directory>
在Options Indexes FollowSymLinks MultiViews ExecCGI中的index加‘-’即可,即Options -Indexes FollowSymLinks MultiViews ExecCGI,此时整个apache服务器都禁止目录浏览
③在虚拟主机中的 Options index FollowSymLinks中的index前加‘-’即可,即 Options -index FollowSymLinks
0 0
- apache下虚拟主机的配置
- apache下虚拟主机的配置
- Apache下配置虚拟主机
- 在windows下Apache的虚拟主机配置
- windows下apache虚拟主机的配置
- ubuntu 下 Apache虚拟主机的配置
- Ubuntu下配置Apache的虚拟主机
- ubuntu下Apache虚拟主机的配置
- linux下apache的虚拟主机配置
- windows下apache的虚拟主机virtualhost配置
- windows下apache虚拟主机的配置
- 《windows下Apache虚拟主机的配置》
- Linux 下Apache虚拟主机的配置
- Apache虚拟主机的配置
- Apache虚拟主机的配置
- apache 虚拟主机的配置
- [Apache]虚拟主机的配置
- Apache虚拟主机的配置
- android EditText限制输入字数并显示剩余字数
- c++读写二进制文件
- 学习笔记———《GMM模型以及基于EM算法的参数估计》
- UITableViewCell的标记、移动、删除、插入
- linux消息队列操作
- apache下虚拟主机的配置
- android学习的有关书籍--应用层
- android的消息处理机制(图+源码分析)——Looper,Handler,Message
- FORM中读取图片
- android学习的有关书籍--框架层
- 2013-12-18客户端自启动问题之一
- HDU2176:取(m堆)石子游戏(Nim)
- 老罗的androdi视频分享
- 3DESjava加解密