windows 下 apache 添加虚拟机
NameVirtualHost 127.0.0.1:80 <VirtualHost 127.0.0.1:80> DocumentRoot "F:\www" ServerName localhost <Directory "F:\www"> Options Indexes FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory> </VirtualHost> <VirtualHost 127.0.0.1:80> DocumentRoot "F:\www\saier" ServerName saier.com <Directory "F:\www\saier"> Options Indexes FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory> </VirtualHost>
一、配置HOST文件
windows/system32/drivers/etc/host
# Copyright (c) 1993-1999 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
127.0.0.1 localhost
127.0.0.1 test
127.0.0.1 www.test2.0.com
二、修改httpd.conf
去掉Include conf/extra/httpd-vhosts.conf前的#注释
若更改APACHE默认网站根目录需要保持
DocumentRoot "D:\web"和<Directory "D:\web">两处一致
三、配置httpd-vhosts.conf
NameVirtualHost 127.0.0.1:80
<VirtualHost 127.0.0.1:80>
DocumentRoot "D:\web"
ServerName localhost
<Directory "D:\web">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
<VirtualHost 127.0.0.1:80>
DocumentRoot "D:\web\test"
ServerName test
<Directory "D:\web\test">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
#采用CAKEPHP架构,test2.0即为app文件夹
<VirtualHost 127.0.0.1:80>
DocumentRoot "D:\web\test2.0\front\webroot"
ServerName www.test2.0.com
<Directory "D:\web\test2.0\front\webroot">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
四、重启APACHE
上一篇: Tomcat6上配置BTM
推荐阅读
-
[jsp+php]Windows2000 下整合Apache2与Tomcat4
-
在Windows下安装Apache+PHP3
-
在PHP+Apache+MySQL环境下(windows系统),连接SQLServer数据出现“can not find driver”问题的解决办法
-
windows下apache+mysql+php+phpmyadmin的配置方法
-
Windows下PHP安装路径配置错误导致Apache无法启动怎么解决?
-
在Windows下安装Apache + PHP3_PHP
-
windows下php apache 安装的几个问题
-
在Windows下安装Apache+PHP3
-
Apache1.3.x+PHP4 Beta3在Windows 9x/NT下的安装与配置_PHP教程
-
Apache1.3.x + PHP4 Beta3在Windows 9x/NT下的安装与配置_PHP