Apache 2.2 虚拟目录配置
2011-11-04 22:42
483 查看
主要分三步:
1. 添加监听端口 Listen 80
2. 修改servername *:80
3. 添加NameVirtualHost *:80
4. 添加虚拟目录:
#第一个网站
<VirtualHost *:80>
ServerName www.um.com
DocumentRoot "/usr/local/apache2/htdocs"
</VirtualHost>
#第二个网站
<VirtualHost *:80>
ServerName www.gjm123.cn
ServerPath /musicResource
DocumentRoot "/usr/local/apache2/musicResource"
</VirtualHost>
5. 添加虚拟目录访问权限
<Directory "/usr/local/apache2/um">
#
# 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 All
#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all
</Directory>
<Directory "/usr/local/apache2/musicResource">
#
# 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 All
#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all
</Directory>问权限
5. 保存修改,重启apache2
参考:
1,apache手册:http://lamp.linux.gov.cn/Apache/ApacheMenu/vhosts/examples.html
2,/article/5612292.html
1. 添加监听端口 Listen 80
2. 修改servername *:80
3. 添加NameVirtualHost *:80
4. 添加虚拟目录:
#第一个网站
<VirtualHost *:80>
ServerName www.um.com
DocumentRoot "/usr/local/apache2/htdocs"
</VirtualHost>
#第二个网站
<VirtualHost *:80>
ServerName www.gjm123.cn
ServerPath /musicResource
DocumentRoot "/usr/local/apache2/musicResource"
</VirtualHost>
5. 添加虚拟目录访问权限
<Directory "/usr/local/apache2/um">
#
# 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 All
#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all
</Directory>
<Directory "/usr/local/apache2/musicResource">
#
# 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 All
#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all
</Directory>问权限
5. 保存修改,重启apache2
参考:
1,apache手册:http://lamp.linux.gov.cn/Apache/ApacheMenu/vhosts/examples.html
2,/article/5612292.html
相关文章推荐
- apache2.2的目录文件及 虚拟主机的配置
- apache2.2配置多个虚拟目录
- Apache 2.2版本配置虚拟目录以及虚拟主机实例
- apache2.2 配置多个虚拟目录 后面过来
- apache 配置默认目录外当虚拟目录
- apache配置虚拟主机以及虚拟目录详解
- Apache2.4(httpd)配置多个虚拟目录,分别设置代理访问Node.js
- Apache配置站点与虚拟目录
- 关于【apache- tomcat- 5.5.15/conf /Catalina/localhost配置虚拟目录】时的一些问题。(配置web项目的方式不止一种,虚拟目录就是一个)
- apache 配置虚拟目录+默认页+隐藏index.php
- Apache2.4 虚拟目录的配置的403错误
- Linux 配置Apache服务器 上 (安装,虚拟目录)
- Apache虚拟目录的配置问题
- 解决配置apache虚拟主机后,只能进入欢迎页面(默认欢迎页面),不能进入虚拟主机目录页面
- apache配置虚拟目录
- Apache----windows下虚拟主机和虚拟目录的认识(Apache配置)
- 使用apache配置多个虚拟目录
- Apache配置虚拟目录,以及各种操作
- Apache配置站点与虚拟目录大全
- (转)Apache安装常见配置(修改主目录、首页文件、建立虚拟主机等)