03 WAMPServer多站点的配置
来源:互联网 发布:日本海关数据 编辑:程序博客网 时间:2024/05/21 17:13
一、找到wamp根目录
例如:D:\wamp\bin\apache\apache2.4.9\conf\extra下的httpd-vhosts.conf文件
多站点的配置如下:
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "c:/Apache24/docs/dummy-host.example.com"
ServerName dummy-host.example.com
ServerAlias www.dummy-host.example.com
ErrorLog "logs/dummy-host.example.com-error.log"
CustomLog "logs/dummy-host.example.com-access.log" common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.example.com # 设置管理员的邮箱地址
DocumentRoot "c:/Apache24/docs/dummy-host2.example.com" # 服务器代码的文件目录
ServerName dummy-host2.example.com #服务器主机名
ErrorLog "logs/dummy-host2.example.com-error.log" # 错误日志
CustomLog "logs/dummy-host2.example.com-access.log" common # 日常日志
</VirtualHost>
复制上面的配置文件更改相应的配置文件即可,具体更改如下:
我添加的网站配置信息如下:
<VirtualHost *:80>
DocumentRoot "D:/PHP_Project/YeHu"
ServerName YeHu.com
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "D:/PHP_Project/ButterflyCabin"
ServerName ButterflyCabin.com
</VirtualHost>
我们配置完httpd-vhost.conf并不会被Apache所加载,因为httpd-vhost.conf是一个扩展配置文件。
二、是Apache加载配置好的扩展配置文件httpd-vhost.conf
打开Apache下的httpd.conf配置文件搜索httpd-vhost
#Include conf/extra/httpd-vhosts.conf 前的#号去掉 在本配置文件中#代表注释本行
!三、让Apache允许外部网站访问 对于新版本的这部可以跳过
<Directory "D:/PHP_Project/">
#
# 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.4/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:
# AllowOverride FileInfo AuthConfig Limit
#
AllowOverride all
#
# Controls who can get stuff from this server.
#
# onlineoffline tag - don't remove
#Order Deny,Allow
#Allow from all
Require local
</Directory>
三、配置hosts
系统盘——》windows——》System32——》drivers——》etc下的hosts文件
添加如下配置信息:
127.0.0.1 yehu.com
127.0.0.1 butterflycabin.com
例如:D:\wamp\bin\apache\apache2.4.9\conf\extra下的httpd-vhosts.conf文件
多站点的配置如下:
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "c:/Apache24/docs/dummy-host.example.com"
ServerName dummy-host.example.com
ServerAlias www.dummy-host.example.com
ErrorLog "logs/dummy-host.example.com-error.log"
CustomLog "logs/dummy-host.example.com-access.log" common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.example.com # 设置管理员的邮箱地址
DocumentRoot "c:/Apache24/docs/dummy-host2.example.com" # 服务器代码的文件目录
ServerName dummy-host2.example.com #服务器主机名
ErrorLog "logs/dummy-host2.example.com-error.log" # 错误日志
CustomLog "logs/dummy-host2.example.com-access.log" common # 日常日志
</VirtualHost>
复制上面的配置文件更改相应的配置文件即可,具体更改如下:
我添加的网站配置信息如下:
<VirtualHost *:80>
DocumentRoot "D:/PHP_Project/YeHu"
ServerName YeHu.com
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "D:/PHP_Project/ButterflyCabin"
ServerName ButterflyCabin.com
</VirtualHost>
我们配置完httpd-vhost.conf并不会被Apache所加载,因为httpd-vhost.conf是一个扩展配置文件。
二、是Apache加载配置好的扩展配置文件httpd-vhost.conf
打开Apache下的httpd.conf配置文件搜索httpd-vhost
#Include conf/extra/httpd-vhosts.conf 前的#号去掉 在本配置文件中#代表注释本行
!三、让Apache允许外部网站访问 对于新版本的这部可以跳过
<Directory "D:/PHP_Project/">
#
# 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.4/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:
# AllowOverride FileInfo AuthConfig Limit
#
AllowOverride all
#
# Controls who can get stuff from this server.
#
# onlineoffline tag - don't remove
#Order Deny,Allow
#Allow from all
Require local
</Directory>
三、配置hosts
系统盘——》windows——》System32——》drivers——》etc下的hosts文件
添加如下配置信息:
127.0.0.1 yehu.com
127.0.0.1 butterflycabin.com
0 0
- 03 WAMPServer多站点的配置
- wampserver多站点配置
- WAMPServer多站点配置
- wampserver多站点配置
- WampServer多站点配置
- wampserver多站点配置
- wampserver配置多站点
- WAMPServer多站点配置
- wampserver配置多站点
- wampserver配置多站点
- wampserver多站点配置
- wampServer多站点配置
- WAMPServer多站点配置
- WAMPServer多站点配置
- php wampserver的多站点配置
- WAMPServer下Apached的多站点配置
- wampserver配置多个站点
- wampserver配置多个站点
- HTML5(五)html5<canvas路径和三角函数的故事>(下)
- C#图形验证码
- Selenium浏览器自动化测试使用(2)
- 53篇PHP开发技术干货,拿走,不谢~
- Animation 优化
- 03 WAMPServer多站点的配置
- 【慕课笔记】第四章 流程控制语句 第2节 JAVA条件语句之if...else...
- 解决.gitignore无法忽略部分文件
- lr_eval_string()函数以及LR中参数、变量的简单使用
- 良心推荐,76篇前端开发技术干货,拿走,不谢~
- 04 WAMPServer自拟定端口
- iOS使用Charles(青花瓷)抓包并篡改返回数据图文详解
- raspberry install python-mysqldb
- Rescue